/*
 * encoding.h
 * 
 * Copyright (c) 1989-1991 Adobe Systems Incorporated.
 * All rights reserved.
 *
 * This file may be freely copied and redistributed as long as:
 *   1) This entire notice continues to be included in the file, 
 *   2) If the file has been modified in any way, a notice of such
 *      modification is conspicuously indicated.
 *
 * PostScript, Display PostScript, and Adobe are registered trademarks of
 * Adobe Systems Incorporated.
 * 
 * ************************************************************************
 * THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT
 * NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS
 * INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR 
 * LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY 
 * KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION, 
 * AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR PARTICULAR PURPOSES AND NONINFINGEMENT OF THIRD PARTY RIGHTS.
 * ************************************************************************
 */

#define	true	-1
#define	false	 0

extern void EncodeInteger ();
extern void EncodeReal ();
extern void EncodeName ();

extern int highByteFirst;
extern int ieeeFormat;

#define	MAXSTRING 65535

extern char *stringPointer;
extern long stringLength;

extern void BeginStringEncoding();
extern void EndStringEncoding();

#define	AppendString(text)		\
{					\
  long length = strlen (text);		\
  if ((stringLength + length) > MAXSTRING) \
    FatalError ("String too long.");	\
  strncpy (stringPointer, text, length);\
  stringPointer += length;		\
  stringLength += length;		\
}

#define	AppendByte(byte)		\
{					\
  if ((stringLength + 1) > MAXSTRING)	\
    FatalError ("String too long.");	\
  *stringPointer++ = (byte);		\
  stringLength++;			\
}
