-- TiogaFileOps.Mesa
-- written by Bill Paxton December 1980
-- last written by Paxton March 19, 1981  10:06 AM

TiogaFileOps: DEFINITIONS =

BEGIN

numStyles: CARDINAL = 20;
	-- max number of entries in a style table for a file 
	-- others must be given in long form
StyleIndex: TYPE = [0..numStyles);

numTypes: CARDINAL = 100;
	-- max number of entries in a type table 
	-- others must be given in long form
	-- have a separate type table for each style in the file
TypeIndex: TYPE = [0..numTypes);

numLooks: CARDINAL = 70;
	-- max number of entries in a look table
	-- others must be given in long form
	-- each entry in a look table is a distinct vector of 26 bits
	-- have a separate look table for each style in the file
LooksIndex: TYPE = [0..numLooks);

Op: TYPE = CHARACTER;

endOfFile: Op = 0C;
startNode: Op = endOfFile + 1;
	-- length of type name in following byte.  text follows.
	-- enter in type table for style and assign it the next number
startNodeFirst: Op = startNode + 1;
startNodeLast: Op = startNodeFirst + numTypes;
	-- find info in op-startNodeFirst of type table for current style.
endNode: Op = startNodeLast + 1;
	-- end current node and go back to adding to its parent.  
nextNode: Op = endNode + 1;
	-- end current node and start new one with same type
changeStyle: Op = nextNode + 1;
	-- length of style name in following byte.  text follows.
	-- enter in table of styles for file and assign it the next number
	-- use this style for the next node.  then restore prior style.
changeStyleFirst: Op = changeStyle + 1;
changeStyleLast: Op = changeStyleFirst + numStyles;
	-- find info in op-changeStyleFirst of style table.
	-- use this style for the next node.  then restore prior style.
shortTextNode: Op = changeStyleLast + 1;
	-- length of text in next byte.
	-- actual text comes from text block.
	-- number of look runs in following byte
longTextNode: Op = shortTextNode + 1;
	-- length of text in next two bytes.
	-- number of look runs in following byte (if < 255)
		-- if 255 or more, then byte=255 and length in next 2 bytes
veryLongTextNode: Op = longTextNode + 1;
	-- length of text in next four bytes.
	-- number of look runs in following byte (if < 255)
		-- if 255 or more, then byte=255 and length in next 2 bytes
looks0: Op = veryLongTextNode + 1;
looks3: Op = looks0 + 3;
	-- op-looks0 gives first 2 bits of look vector.
	-- rest of vector in next 3 bytes.
	-- length of run in next byte.
	-- enter vector in looks table for current style.
looksFirst: Op = looks3 + 1;
looksLast: Op = looksFirst + numLooks;
	-- find looks in looks table[op-looksFirst] for current style.
	-- length of run in the next byte.
longLooks0: Op = looksLast + 1;
longLooks3: Op = longLooks0 + 3;
	-- identical to looks0..look3 except two bytes for run length
plainText: Op = longLooks3 + 1;
	-- length of run in next byte
longPlainText: Op = plainText + 1;
	-- length of run in next two bytes
makeViewbox: Op = longPlainText + 1;
	-- next two bytes give length of specs.
	-- specs are given in following control bytes.

END.