/* Copyright (c) Xerox Corporation 1993. All rights reserved. */
/* tioga.h -- Definitions for reading Tioga files.
   David Nichols
   December, 1990 */

#define tioga←NumFormats	70
#define tioga←NumLooks		50
#define tioga←NumProps		50

/* Lengths of various things. */
#define tioga←LenLen		4 /* length of a length field */
#define tioga←IDLen		2 /* id fields are all two bytes */
#define tioga←CommentHeaderLen	(tioga←IDLen + tioga←LenLen)
#define tioga←ControlHeaderLen	(tioga←IDLen + tioga←LenLen)
#define tioga←TrailerLen	(tioga←IDLen + 3 * tioga←LenLen)

enum tioga←ControlOp {
    endOfFile = 0,
    startNode,
	/** length of formatName in next byte.  Text for format name
	    follows that.
		enter in formatName table
		and assign it the next number */
    startNodeFirst,
    startNodeLast = startNodeFirst + tioga←NumFormats,
	/* these opcodes encode previously seen formatName so don't need
	   to repeat it find formatName in op-startNodeFirst of format
	   table other information follows same as for startNode */
    terminalTextNode,
    terminalTextNodeFirst,
    terminalTextNodeLast = terminalTextNodeFirst + tioga←NumFormats,
	/* these opcodes are for nodes without children so can skip
	   endNode opcode identical to startNodeFirst..startNodeLast,
	   except implies no children find format name in
	   op-startNodeFirst of format table other information follows
	   same as for startNode */
    otherNode,
	/** for "other" format of nodes length of formatName in next byte.
	    text for format name follows that.
		enter in formatName table
		and assign it the next number */
    otherNodeShort,
	/* like otherNode, but followed by a formatName code number
	   instead of length+text */
    otherNodeSpecs,
	/** Gives "variety" and specifications for immediately previous
	   "other" format node.  Length of variety name follows in next
	   byte(s).  Then text of name.
		Enter in property name table and assign next number.
	   Length of specs text in next byte(s) specs follow that. */
    otherNodeSpecsShort,
	/* like otherNodeSpecs, but followed by a propname code number
	   instead of length+text */
    prop,
	/* Specifies property for current node. Property specs are stored
	   on file as a rope. Length of property name follows in next
	   byte(s). then text of name. Enter in property name table and
	   assign next number. Length of property specs rope in next
	   byte(s). Followed by text for property specs rope. */
    propShort,
	/* Like prop, but followed by a propname code number instead of
	   length+text. */
    endNode,
	/* End current node and go back to adding to its parent. */
    rope,
	/* This op declares rope for most recently started node. Length of
	   text for the node in next byte(s). Actual text comes from text
	   block followed by a CR which is not included in the length. */
    comment,
	/* Identical to rope except implies text stored in comment area of
	   file. */
    runs,
	/* This op preceeds definition of looks for most recently started
	   node. Number of runs in following byte(s). Have at most 1 runs
	   op per node.  if omit, then no special looks. */
    looks,
	/** Looks vector in following 4 bytes.
		Enter vector in looks table.
		and assign it the next number
	    Length of run in next byte(s). */
    looksFirst,
    looksLast = looksFirst + tioga←NumLooks,
	/* These ops encode previously encountered looks so don't need to
	   repeat. Find looks in looks table[op-looksFirst]. Length of run
	   in the next byte(s). */
    look1,
	/* Like looks op, except has single look char instead of 4 byte
	   looks vector. */
    look2,
	/* Like looks1, except has two looks chars. */
    look3,
	/* Like look2, except has three looks chars. */
};