[net.sources] New NRO file 1 of 3

ron@trsvax.UUCP (09/16/83)

#N:trsvax:66500002:000:28059
trsvax!ron    Sep  9 00:37:00 1983

--------------------------------------------------------------------------------
: Run this shell script with "sh" not "csh"
#! /bin/sh
PATH=:/bin:/usr/bin:/usr/ucb
export PATH
all=FALSE
if [ $1x = -ax ]; then
	all=TRUE
fi
/bin/echo 'Extracting nro.txt'
sed 's/^X//' <<'//go.sysin dd *' >nro.txt
X.TH NRO 1 Local
X.SH NAME
Xnro - text processor
X.SH SYNOPSIS
Xnro
X.I [-n] [+n] [-pxx] [-r]
X.I [-d] [-mmfile] ifile ...
X.SH DESCRIPTION
X.I NRO
Xis a text processor and formatter based on the design
Xprovided in 
X.I "Software Tools"
Xby Kernighan and Plauger.
XThe text and commands found in the
X.I ifile(s)
Xare processed to
Xgenerate formatted text.
XThe output may be directed into a file,
Xotherwise, the output will appear at
Xthe user console.
X.SH INPUT FILES
XTwo types of files may be input to
X.I nro.
XThe first is a macro file which will contain various macros and commands
Xto the processor. The file extension for this file, if none is supplied
Xis ".nro". Any number of macro files may be included.
X.br
XThe second is a text file which will contain the text to output. This
Xfile too may contain macros and commands to the processor. The file
Xextension for this file, if none is supplied is ".txt". Any number
Xof text files may be included.
X.SH OPTIONS
X.I +n
Xoption causes the output to start with page
X.I n.
X.br
X.I -n
Xoption causes the output to stop after page
X.I n.
X.sp
X.I -p
Xoption causes the output to be shifted to the right by
X.I xx
Xspaces.
XThis has the same effect as the
X.I .po
Xcommand.
X.sp
X.I -r
Xoption sets the processor so that all output is raw, meaning it is
Xstripped of all backspacing and underlining.
X.sp
X.I -d
Xoption redirects the formatted output to a file with the same name
Xas the input file, but with a
X.I .lis
Xextension.
X.sp
X.I -m
Xoption processes the file
X.I mfile
Xfor macro definitions.
XNote that files processed in this way should contain only macro
Xdefinitions, no immediate output should be generated from this file.
X.sp
X.SH USAGE
XCommands typically are distinguished by a period in column one of the input
Xfollowed by a two character abbreviation for the command function.
XThe abbreviation may then be followed by an optional numeric or
Xcharacter argument.
XThe numeric argument may be an absolute value such as setting
Xthe right margin to a particular column, or the argument may be
Xpreceded by a plus sign or a minus sign to indicate that the
Xparameter should be modified relative to a previous setting.
X.sp
X.SH NRO COMMANDS
X.I .bo
X- causes the following lines of text to appear in
Xboldface. Only alpha-numerics are boldfaced.
XThe optional argument specifies the number of lines to
Xbe typed in boldface.
XBoldface and underlining are mutually exclusive features.
XThe appearance of a boldface command will cause any underlining
Xto cease.
X.sp
X.I .cb
X- causes the following lines of text to appear in
Xboldface.  All characters (except space and tab) are boldfaced.
XThe optional argument specifies the number of lines to
Xbe typed in boldface.
XBoldface and underlining are mutually exclusive features.
XThe appearance of a boldface command will cause any underlining
Xto cease.
X.sp
X.I .bp
X- causes succeeding text to appear at the top of
Xa new page.
XThe optional argument specifies the page number for the new page.
XThe initial value is one and the default value is one more than
Xthe previous page number.
X.sp
X.I .br
X- causes succeeding text to start on a new line at the
Xcurrent left margin.
XThere is no numeric argument for this command.
X.sp
X.I .cc
X- changes the
X.I NRO
Xcommand character to that specified by the character argument.
XIf no argument is provided, the default is a period.
X.sp
X.I .ce
X- causes the next line of text to appear centered on the output.
XThe optional argument specifies if more than one line is to be centered.
X.sp
X.I .de
X- causes all text and commands following to be used to define
Xa macro.
XThe definition is terminated by a
X.I .en
Xor ".." command.
XThe first two characters of the argument following the
X.I .de
Xcommand become the name of the new command.
XIt should be noted that upper and lower case arguments are considered
Xdifferent.
XThus, the commands
X.I .PP
Xand
X.I .pp
Xcould define two different macros.
XCare should be exercised since existing commands may be redefined.
X.sp
XA macro may contain up to ten arguments.
XIn the macro definition, the placement of arguments is designated by the
Xtwo character sequences, $0, $1, ... $9.
XWhen the macro is invoked, each argument of the macro command line is
Xsubstituted for its corresponding designator in the expansion.
XThe first argument of the macro command is substituted for the $0
Xin the expansion, the second argument for the $1, and so forth.
XArguments are typically strings which do not contain blanks or tabs.
XIf an argument is to contain blanks, then it should be surrounded by
Xeither single or double quotes. 
XIn addition to these, a
Xspecial symbol, $$, has been added which allows for a whole line
Xto be substituted as one argument.
X.sp
X.I .cu
X- causes the next line(s) of text to be continuously underlined.
XUnlike the underline command (see
X.I .ul)
Xwhich underlines only alphanumerics, continuous underlining underlines
Xall printable characters.
XThe optional argument specifies the number of lines of text to underlined.
XAny normal underlining or boldface commands currently in effect will be
Xterminated.
X.sp
X.I .ef
X- specifies the text for the footer on even numbered pages.
XThe format is the same as for the footer command (see
X.I .fo).
X.sp
X.I .eh
X- specifies the text for the header on even numbered pages.
XThe format is the same as for the footer command (see
X.I .fo).
X.sp
X.I .en
X- designates the end of a macro definition.
X.sp
X.I ..
X- designates the end of a macro definition.
X.sp
X.I .fi
X- causes the input text to be rearranged or filled to obtain the
Xmaximum word count possible between the previously set left and
Xright margins.
XNo argument is expected.
X.sp
X.I .fo
X- specifies text to be used for a footer.
XThe footer text contains three strings separated by a delimiter
Xcharacter.
XThe first non-blank character following the command is designated
Xas the delimiter.
XThe first text string is left justified to the current indentation
Xvalue (specified by
X.I .in).
XThe second string is centered between the current indentation value
Xand the current right margin value (specified by
X.I .rm).
XThe third string is right justified to the current right margin value.
XThe absence of footer text will result in the footer being printed as
Xone blank line.
XThe presence of the page number character (set by
X.I .pc)
Xin the footer text results
Xin the current page number being inserted at that position.
XMultiple occurrences of the page number character are allowed.
X.sp
X.I .he
X- specifies text to be used for a header.
XThe format is the same as for the footer (see
X.I .fo).
X.sp
X.I .in
X- indents the left margin to the column value specified by the argument.
XThe default left margin is set to zero.
X.sp
X.I .ju
X- causes blanks to be inserted between words in a line of
Xoutput in order to align or justify the right margin.
XThe default is to justify.
X.sp
X.I .ls
X- sets the line spacing to the value specified by the argument.
XThe default is for single spacing.
X.sp
X.I .m1
X- specifies the number of lines in the header margin.
XThis is the space from the physical top of page to and including
Xthe header text.
XA value of zero causes the header to not be printed.
XA value of one causes the header to appear at the physical top of page.
XLarger argument values cause the appropriate number of blank
Xlines to appear before the header is printed.
X.sp
X.I .m2
X- specifies the number of blank lines to be printed between
Xthe header line and the first line of the processed text.
X.sp
X.I .m3
X- specifies the number of blank lines to be printed between
Xthe last line of processed text and the footer line.
X.sp
X.I .m4
X- specifies the number of lines in the footer margin.
XThis command affects the footer the same way the
X.I .m1
Xcommand
Xaffects the header.
X.sp
X.I .ne
X- specifies a number of lines which should not be broken
Xacross a page boundary.
XIf the number of lines remaining on a page is less than the
Xvalue needed, then a new output page is started.
X.sp
X.I .nf
X- specifies that succeeding text should be printed without
Xrearrangement, or with no fill.
XNo argument is expected.
X.sp
X.I .nj
X- specifies that no attempt should be made to align or justify
Xthe right margin.
XNo argument is expected.
X.sp
X.I .nr
X- causes the value of a number register to be set or modified.
XA total of twenty-six number registers are available designated
X"@na" through "@nz" (either upper or lower case is allowed).
XWhen the sequence "@nc" is embedded in the text, the current value
Xof number register c replaces the sequence, thus, such things as
Xparagraph numbering can be accomplished with relative ease.
X.br
XExamples:
X.br
X	.nr a 3  register "a" SET to 3
X.br
X	.nr b +2 register "b" INCREMENTED by 2
X.br
X	.nr c -4 register "c" DECREMENTED by 4
X.sp 2
X.I .au
X- sets the manual increment/decrement of a register.
XYou may additionally specify a manual increment/decrement to a
Xregister by adding a + sign to the front of the letter.
X.br
XFor example:
X.br
X	.au 1
X.br
X	@n+a
X.br
Xwill cause number register to be incremented by the .au value, then
Xoutput. The default value is +1.
X.sp
X.I .ai
X- causes the values of the number registers to be auto incremented
Xor decremented each time they are ACCESSED. This will allow for
Xparagraph numbering where you won't have to be constantly updating
Xthe number registers yourself. If .ai
Xis entered by itself, auto mode will be turned on. If .ai
Xis followed by a +/- number, auto mode will be turned on and
X+/- number will be used to increment/decrement the register by.
XThe default of the processor is auto increment off.
X.sp
X.I .of
X- specifies the text for the footer on odd numbered pages.
XThe format is the same as the footer command (see
X.I .fo).
X.sp
X.I .oh
X- specifies the text for the header on odd numbered pages.
XThe format is the same as the footer command (see
X.I .fo).
X.sp
X.I .pc
X- specifies the page number character to be used in headers
Xand footers.
XThe occurrence of this character in the header or footer text
Xresults in the current page number being printed.
XThe default for this character is the hash mark (#).
X.sp
X.I .pl
X- specifies the page length or the number of lines per output page.
XThe default is sixty-six.
X.sp
X.I .po
X- specifies a page offset value.
XThis allows the formatted text to be shifted to the right by
Xthe number of spaces specified.
XThis feature may also be invoked by a switch on the command line.
X.sp
X.I .ep
X- specifies additional offset for even pages.
X.sp
X.I .op
X- specifies additional offset for odd pages.
X.sp
X.I .rm
X- sets the column value for the right margin.
XThe default is seventy five.
X.sp
X.I .so
X- causes input to be retrieved from the file specified
Xby the command's character string argument.
XThe contents of the new file are inserted into the output
Xstream until an EOF is detected.
XProcessing of the original file is then resumed.
XCommand nesting is allowed.
X.sp
X.I .sp
X- specifies a number of blank lines to be output before
Xprinting the next line of text.
X.sp
X.I .ti
X- temporarily alters the indentation or left margin value for a single
Xsucceeding line of text.
X.sp
X.I .ul
X- underlines the alphanumeric text in the following line(s).
XThe optional argument specifies the number of lines to be underlined.
XUnderlining and boldface are mutually exclusive features.
XThe appearance of an underline command cancels any existing
Xboldface operations.
X.sp
X.I .tl
X- allows for text to be formatted just as the
X.I .he
Xcommand would format, but the header or footer text is not disturbed.
XThe text is input just like the
X.I .fo
Xcommand. (See
X.I .fo).
X.sp
X.I .pi
X- allows for text to be placed at the left margin within the current
Xindent field. This is very useful is you have text that is indented,
Xyet you wish to have left margin text.
X.sp
X.I .ar
X- specifies that all numerical values generated by the processor are
Xgenerated in arabic numbers. This is the default.
X.sp
X.I .cr
X- specifies that all numerical values generated by the processor are
Xgenerated in upper case roman numerals. This command is useful for
Xpreface pages.
X.sp
X.I .lr
X- specifies that all numerical values generated by the processor are
Xgenerated in lower case roman numerals. This command is useful for
Xpreface pages.
X.sp
X.I .da
X- causes the current date to be output into the text stream. In addition
Xto this command, the character "^" may be placed within any text to
Xcause the current date to be inserted at that point in the text.
X.sp
X.I .dv
X- causes the normal output text to be diverted to a diversion buffer
Xand held for later or footer output. The
X.I ed
Xcommand ends the diversion (See
X.I .ed).
XText diverted is written/input just as if it were intended for
Ximmediate output, all normal nro commands are applicable. The size
Xof the diverted text will temporarily alter the processors idea of
Xthe bottom of the page, such, that the diverted text and the footer
Xwill fit within the page. If the size of the diverted text is
Xlarger than the remaining number of lines on the current page, the
Xdiversion will not occur until the following page. Only one diversion
Xper page is allowed, but that one diversion may contain as much as
X2000 characters (including padding).
X.br
XThis command is very useful when you need to insert a footnote at
Xthe bottom of a page. For example, you may be writing something
Xthat requires a footnote. At this point you may wish to divert
Xtext and enter the footnote itself. At the end of the footnote text,
Xyou will end diversion and continue with normal text. On the
Xoutput side of things, the point at which you entered the
Xdiversion will not appear in the output stream but instead continue
Xwhere you ended the diversion. But, at the bottom of the page, the
Xdiverted text will be output
X.I prior
Xto the footer.
X.sp
X.I .ed
X- causes diversion of text to end and normal output to continue.
X.sp
X.I .rv
X- causes immediate output of the diverted text. This command is
Xnormally used to recall diverted text, for whatever reason, prior
Xto the bottom of the page. If used, the text can only be recalled
Xonce, and will prevent the diverted output at the end of the page.
X.sp
X.I .li
X- causes the processor to output the input text literally, without
Xany trapping, translation, bold output, or underlining. Text is
Xoutput exactly as it is input. Nro commands, however, are still
Xavailable although any that effect the style of output will not
Xbe acted upon. May be used with an optional 'number of lines'
Xargument. Default is one line.
X.sp
X.I .st
X- casues the processor to stop and wait for input from stdin. The
Xmessage "...[stoped]..." will appear on the stderr output device.
XIf the letter "s" is entered, the processor will exit. Any other
Xcharacter will cause processing to continue.
X.SH INDEXING
XNRO now has provisions for automatically indexing words, and their
Xpage numbers, for an index page which would normally be output
Xat the end of the text. There are three commands to allow words
Xto be placed into the index page buffer, and
Xa command to output the index page at the place you wish
Xto have it output. Note that the index page is NOT output unless
Xyou output it. It is not automatically output at the end of the
Xtext. Finally, there is a command to change the index fill
Xcharacter.
XThis fill character will go between the word(s) and the page number(s).
XThe indexing scheme is set up such that if a word is indexed several
Xtimes on one page, only one page number entry will be placed in the
Xsymbol table.
X.br
XThere are two methods of indexing, MANUAL, and AUTOMATIC. In the
XMANUAL mode, a word or words may be entered. In the automatic mode,
Xonly one single word is allowed per entry, and from that point on, the
Xtext will automatically be searched for any occurances of that word
Xand so entered. A word entered in MANUAL mode, will NOT be
Xautomatically looked up in text. Once a word has been declared
XMANUAL or AUTOMATIC, it cannot be changed. In the MANUAL mode, for
Xthe indexing to be correct, you will have to enter the word(s) MANUALLY
Xeach time it is incountered.
X.br
XIn the AUTOMATIC mode
Xupper/lower case of the word(s) is important, as a word declared for
Xindexing will only match if the cases match. The declared index word
Xof "Mode" will NOT match "mode" in the text because the case of the
Xfirst letter are not the same.
X.sp
X.I .ix
X- causes the word(s) following the
X.I ix
Xcommand
Xto be placed into the index symbol table. Word(s) may contain
Xblanks. This is the MANUAL method of inputting to the index page.
XThe word(s) following the
X.I ix
Xcommand will be output into the present text stream.
X.sp
X.I .ax
X- causes the single word following the
X.I ax
Xcommand to be placed into the index symbol table. This is the
XAUTOMATIC method of inputting to the index page. Once a word
Xhas been declared AUTOMATIC, all text following the declaration
Xwill be searched for that word. The word following the
X.I ax
Xcommand will be output into the present text stream.
X.sp
X.I .ex
X- causes the single word following the
X.I ex
Xcommand to be placed into the index symbol table. This is an
XAUTOMATIC method of inputting into the index page. The word
Xfollowing the
X.I ex
Xcommand
X.I WILL NOT
Xbe output into the text stream, but simply added to the lookup table.
X.sp
X.I .px
X- causes the processor to print the contents of the index page. No
Xtext break or page ejects are automatically done.
XMargins, headers, and footers will still be observed during the index
Xpage outputting.
X.sp
X.I .sx
X- causes the index page fill character to be changed. The fill character
Xis used to fill the white space between the index word (on the left) and
Xthe index page(s) (on the right). The chosen character should be entered
Xin single quotes after the
X.I sx
Xcommand. For example, setting ".sx '%'" will cause the fill character
Xto be a percent sign. Once the index page has started printing, there
Xis no way to alter the character so be sure to set it BEFORE you issue
Xthe
X.I px
Xcommand. The default character to fill is a period.
//go.sysin dd *
made=TRUE
if [ $made = TRUE ]; then
/bin/chmod 664 nro.txt
	/bin/echo -n '	'; /bin/ls -ld nro.txt
fi
/bin/echo 'Extracting makefile'
sed 's/^X//' <<'//go.sysin dd *' >makefile
XCC= cc
XDEST= .
XCFLAGS= -w -O
XLFLAGS= -n -s
X
XOBJS =	nro.o nrocmd.o nrotxt.o nroindex.o
X
X
Xnro:	$(OBJS)
X	$(CC) $(LFLAGS) $(OBJS) -o $(DEST)/nro
X
X$(OBJS): nro.h
//go.sysin dd *
made=TRUE
if [ $made = TRUE ]; then
/bin/chmod 664 makefile
	/bin/echo -n '	'; /bin/ls -ld makefile
fi
/bin/echo 'Extracting nro.h'
sed 's/^X//' <<'//go.sysin dd *' >nro.h
X/*
X *	Parameter file for NRO word processor
X *
X *	Stephen L. Browning
X *	5723 North Parker Avenue
X *	Indianapolis, Indiana 46220
X *
X *	Modified and enhanced by:
X *		Ron Light
X *		6016 Croftway Ct.
X *		Ft. Worth, Tx. 76131
X */
X
X
X/* some or all of this may be unnecessary for you */
X
X#define	EOS	'\0'
X#define	TRUE	-1
X#define	FALSE	0
X#define	OK	0
X
X
X/* end of possible bogus hacks */
X
X#define	MACRO	 0	/* macro definition			*/
X#define	BP	 1	/* begin page				*/
X#define	BR	 2	/* break				*/
X#define	CE	 3	/* center				*/
X#define	FI	 4	/* fill					*/
X#define	FO	 5	/* footer				*/
X#define	HE	 6	/* header				*/
X#define	IN	 7	/* indent				*/
X#define	LS	 8	/* line spacing				*/
X#define	NF	 9	/* no fill				*/
X#define	PL	10	/* page length				*/
X#define	RM	11	/* right margin				*/
X#define	SP	12	/* line space				*/
X#define	TI	13	/* temp indent				*/
X#define	UL	14	/* underline				*/
X#define	JU	15	/* justify				*/
X#define	NJ	16	/* no justify				*/
X#define	M1	17	/* top margin				*/
X#define	M2	18	/* second top margin			*/
X#define	M3	19	/* first bottom margin			*/
X#define	M4	20	/* bottom-most margin			*/
X#define	NE	21	/* need n lines				*/
X#define	PC	22	/* page number character		*/
X#define	CC	23	/* control character			*/
X#define	PO	24	/* page offset				*/
X#define	BO	25	/* bold face				*/
X#define	EH	26	/* header for even numbered pages	*/
X#define	OH	27	/* header for odd numbered pages	*/
X#define	EF	28	/* footer for even numbered pages	*/
X#define	OF	29	/* footer for odd numbered pages	*/
X#define	SO	30	/* source file				*/
X#define	CU	31	/* continuous underline			*/
X#define	DE	32	/* define macro				*/
X#define	EN	33	/* end macro definition			*/
X#define	NR	34	/* set number register			*/
X#define	TL	35	/* temporiary title			*/
X#define	PI	36	/* put in indent field			*/
X#define	AR	37	/* want aribic numbers			*/
X#define	CR	38	/* want upper case roman numerials	*/
X#define	LR	39	/* want lower case roman numerials	*/
X#define	DA	40	/* get current date			*/
X#define	PN	41	/* reset page number			*/
X#define	AI	42	/* auto register increment/decrement	*/
X#define	DV	43	/* set divert text mode			*/
X#define	ED	44	/* end divert text mode			*/
X#define	RV	45	/* recall diverted text			*/
X#define	LI	46	/* literial output			*/
X#define	IX	47	/* index this word into index page	*/
X#define	PX	48	/* print the index page			*/
X#define	SX	49	/* change the index fill char '.'	*/
X#define	AX	50	/* set auto index mode			*/
X#define	EX	51	/* add to index, don't output as text	*/
X#define	CB	52	/* continuous bold			*/
X#define	OP	53	/* page offset odd pages		*/
X#define	EP	54	/* page offset even pages		*/
X#define	AU	55	/* manual register increment		*/
X#define	ST	56	/* stop processor			*/
X
X#define	UNKNOWN	-1
X
X/*
X *	MAXLINE is set to a value slightly larger
X *	than twice the longest expected input line.
X *	Because of the way underlining is handled, the
X *	input line which is to be underlined, can almost
X *	triple in length.  Unlike normal underlining and
X *	boldfacing, continuous underlining affects all
X *	characters in the buffer, and represents the
X *	worst case condition.  If the distance between
X *	the left margin and the right margin is greater
X *	than about 82 characters, and continuous underlining
X *	is in effect, there is a high probability of buffer
X *	overflow.
X */
X
X#define	MAXLINE (82*2)
X#define	PAGELEN  66
X#define	PAGEWIDTH 75
X#define	HUGE	256
X#define	LEFT	0		/* indecies into header margin limit arrays */
X#define	RIGHT	1
X#define	NFILES	4		/* nesting depth for input files */
X#define	LNAME	60		/* max length for one word */
X
X/*
X *	The following parameters may be defined in stdio.h
X */
X
X#define	YES	1
X#define	NO	0
X#define	ERR	-1
X
X/*
X *	The parameter values selected for macro definitions
X *	are somewhat arbitrary.  MACBUF is the storage area
X *	for both macro names and definitions.  Since macro
X *	processing is handled by pushing back the expansion
X *	into the input buffer, the longest possible expansion
X *	would be MAXLINE characters.  Allowing for argument
X *	expansion, MXMLEN was chosen slightly less than MAXLINE.
X *	It is assumed that most macro definitions will not
X *	exceed 20 characters, hence MXMDEF of 100.
X */
X
X#define	MXMDEF	50		/* maximum no. of macro definitions */
X#define	MNLEN	4		/* maximum length of macro name */
X
X#ifdef MICRO
X#define	MACBUF	2000		/* macro definition buffer */
X#define	MXMLEN	2000		/* maximum length of each macro definition */
X#define	PUSHBUF	500		/* depth of push back buffer */
X#else
X#define	MACBUF	20000		/* macro definition buffer */
X#define	MXMLEN	20000		/* maximum length of each macro definition */
X#define	PUSHBUF	20000		/* depth of push back buffer */
X#endif
X
Xstruct macros
X{
X	char	*mnames[MXMDEF];	/* table of pointers to macro names */
X	int	lastp;		/* index to last mname	*/
X	char	*emb;		/* next char avail in macro defn buffer */
X	char	*mb;		/* table of macro definitions */
X	char	*ppb;		/* pointer into push back buffer */
X	char	*pbb;		/* push back buffer */
X};
X
X
X/* control parameters for nro */
X
Xstruct docctl
X{
X	int	fill;	/* fill if YES, init = YES			*/
X	int	lsval;	/* current line spacing, init = 1		*/
X	int	inval;	/* current indent, >= 0, init = 0		*/
X	int	rmval;	/* current right margin, init = 75		*/
X	int	tmval;	/* true current right margin			*/
X	int	tival;	/* current temp indent, init = 0		*/
X	int	ceval;	/* number of lines to center, init = 0		*/
X	int	ulval;	/* number of lines to underline, init = 0 	*/
X	int	cuval;	/* # lines to continuously underline, init = 0	*/
X	int	juval;	/* justify if YES, init = YES			*/
X	int	boval;	/* number of lines to bold face, init = 0 	*/
X	int	cbold;	/* want continuous bold				*/
X	char	pgchr;	/* page number character, init = '#'    	*/
X	char	cmdchr;	/* command character, init = '.'		*/
X	int	prflg;	/* print on or off, init = TRUE			*/
X	int	sprdir;	/* direction for spread(), init = 0		*/
X	int	flevel;	/* nesting depth for source cmd, init = 0	*/
X	int	nr[26];	/* number registers				*/
X	int	roman;	/* flag shows we're in roman numerial mode	*/
X	int	rlower;	/* flag show we want lower case roman no's.	*/
X	int	rauto;	/* flag/value for auto register inc/dec		*/
X	int	mauto;	/* flag/value for manual register inc/dec	*/
X	int	divert;	/* flag for diverted text output		*/
X	int	divlin;	/* number of lines in diverted text buffer	*/
X	int	divsav; /* spare counter in case divert is too big	*/
X	int	literal; /* output as literal, no traps, translations	*/
X	int	indexx;	/* index mode is on				*/
X	int	aindex;	/* auto index mode is on			*/
X	char	ichr;	/* character used for index page fill		*/
X};
X
X
X/* output buffer control parameters */
X
Xstruct cout
X{
X	int	outp;	/* next avail char position in outbuf, init = 0 */
X	int	outw;	/* width of text currently in buffer	*/
X	int	outwds;	/* number of words in buffer, init = 0	*/
X	int	lpr;	/* output to printer, init = FALSE	*/
X	char	outbuf[MAXLINE];	/* output of filled text	*/
X};
X
X/* page control parameters for nro */
X
Xstruct page
X{
X	int	curpag;	/* current output page number, init =0	*/
X	int	newpag;	/* next output page number, init = 1	*/
X	int	lineno;	/* next line to be printed, init = 0	*/
X	int	plval;	/* page length in lines, init = 66	*/
X	int	m1val;	/* margin before and including header	*/
X	int	m2val;	/* margin after header			*/
X	int	m3val;	/* margin after last text line		*/
X	int	m4val;	/* bottom margin, including footer	*/
X	int	bottom;	/* last live line on page
X			   = plval - m3val - m4val */
X	int	offset;	/* page offset from left, init = 0	*/
X	int	eooset;	/* even/odd offset			*/
X	int	eofset;	/* even page offset			*/
X	int	oofset;	/* odd page offset			*/
X	int	tofset; /* page offset from left, init = 0	*/
X	int	frstpg;	/* first page to print, init = 0	*/
X	int	lastpg;	/* last page to print, init = 30000	*/
X	int	ehlim[2];	/* left/right margins for headers/footers */
X	int	ohlim[2];	/* init = 0 and PAGEWIDTH	*/
X	int	eflim[2];
X	int	oflim[2];
X	int	tlim[2];
X	char	*ehead;		/* top of page title, init = '\n'     */
X	char	*ohead;
X	char	*efoot;		/* bottom of page title, init = '\n'    */
X	char	*ofoot;
X	char	*thead;		/* temp title */
X};
X
Xstruct file
X{
X	FILE		*fle;
X	unsigned char	fname[100];
X	unsigned int	fline;
X};
X
X
X
X
Xstruct	comm
X{
X	unsigned char	*c1;
X	unsigned int	c2;
X};
X
X
X/*	symbol table structure	*/
X
Xstruct sym
X{
X	unsigned char	*name;
X	unsigned int	flag;
X	struct ref	*nxtref;
X	struct sym	*nxtsym;
X};
X
X#define	SYM	struct sym
X#define	SYMNUL	(SYM *)0
X#define	SYMSIZ	sizeof (SYM)
X
X
X/*	cross refference table structure	*/
Xstruct refx
X{
X	unsigned int	ipage;
X	struct	refx	*nextref;
X};
X
X#define	REF	struct refx
X#define	REFNUL	(REF *)0
X#define	REFSIZ	sizeof (REF)
X
X#define	AUTO	1
X#define	MANUAL	0
//go.sysin dd *
made=TRUE
if [ $made = TRUE ]; then
/bin/chmod 664 nro.h
	/bin/echo -n '	'; /bin/ls -ld nro.h
fi
--