1 //  External, global, and manifest declarations for RUNOFF on Multics.
  2 //  Last modified on 04/02/74 at 16:09:55 by R F Mabee.
  3 
  4 external            //  BCPL library routines used by RUNOFF.
  5      $(   Packstring = "bcpl_machine_code_$Packstring"
  6           Unpackstring = "bcpl_machine_code_$Unpackstring"
  7           Writech = "bcpl_machine_code_$Writech"
  8           WriteS = "bcpl_stream_io_$WriteS"
  9           WriteN = "bcpl_stream_io_$WriteN"
 10           ConvertNtoS = "bcpl_conversions_$ConvertNtoS"
 11           Newvec = "bcpl_filesys_lib_$Newvec"
 12           Freevec = "bcpl_filesys_lib_$Freevec"
 13           MinI = "bcpl_arithmetic_$MinI"
 14           MaxI = "bcpl_arithmetic_$MaxI"
 15           FormDate = "bcpl_conversions_$FormDate"
 16      $)
 17 
 18 
 19 external
 20 {
 21 
 22 //  All routines that form RUNOFF are listed below, even those that are
 23 //  not external.  This listing is thus a table of contents of RUNOFF.
 24 
 25 //        Adjust              = "runoff_mr3$Adjust"         //  Print a line, with right-adjustment.
 26           Blank               = "runoff_mr4$Blank"          //  Print n blanks.
 27           Break               = "runoff_mr3$Break"          //  Break text, printing buffers.
 28 //        Center              = "runoff_mr3$Center"         //  Print the current line, centered.
 29           Check_ref           = "runoff_mr9$Check_ref"      //  Handle reference to symbol in control line.
 30 //        Cleanup             = "runoff_driver$Cleanup"     //  Close files, etc.  Invoked by unwinder.
 31           ConsoleReadline     = "runoff_mr0$ConsoleReadline" // Accept next line from user_input.
 32           Control             = "runoff_mr2$Control"        //  Process a control line.
 33 //        DimAttach           = "runoff_dim$runoff_attach"  //  IOSIM attach entry point.
 34 //        DimChangemode       = "runoff_dim$runoff_changemode" //  Change internal modes.
 35 //        DimDetach           = "runoff_dim$runoff_detach"  //  Disconnect runoff DIM.
 36 //        DimOrder            = "runoff_dim$runoff_order"   //  Execute runoff command line for dim.
 37 //        DimWrite            = "runoff_dim$DimWrite"       //  Process chunk of text as runoff input.
 38           Eject               = "runoff_mr3$Eject"          //  Eject paper, printing footer.
 39 //        Equation            = "runoff_mr3$Equation"       //  Print an equation.
 40           ExecuteCommand      = "runoff_mr0$ExecuteCommand" //  Pass control line to command processor.
 41           FillTrTable         = "runoff_mr1$FillTrTable"    //  Set up a conversion table.
 42           FindInput           = "runoff_driver$FindInput"   //  Open new input stream for given name.
 43 //        FixTab              = "runoff_mr0$FixTab"         //  Calculate tab position and insert blanks.
 44           Foot_begin          = "runoff_mr6$Foot_begin"     //  Start processing footnote
 45           Foot_end            = "runoff_mr6$Foot_end"       //  Finish processing footnote.
 46           Freeheads           = "runoff_mr5$Freeheads"      //  Release a set of headers or footers.
 47 //        GetArg              = "runoff_driver$GetArg"      //  Arg fetching routine for Option.
 48           Gethead             = "runoff_mr5$Gethead"        //  Package header up in new vector.
 49 //        GetModeArg          = "runoff_dim$GetArgMode"     //  Arg fetching routine for Option for DIM.
 50           GetString           = "runoff_mr8$GetString"      //  Read and store string expression.
 51 //        GetSymbol           = "runoff_mr9$GetSymbol"      //  Find value and type of named symbol.
 52           InitializeSymbolTree = "runoff_mr9$InitializeSymbolTree"    //  Load up symbol table at start-up.
 53           InsertFile          = "runoff_mr4$InsertFile"     //  Process .if line.
 54 //        MakeN               = "runoff_mr8$MakeN"          //  Convert string to character constant (number).
 55           Need                = "runoff_mr4$Need"           //  Eject if not enough lines remain.
 56           NeedSS              = "runoff_mr4$NeedSS"         //  Need regardless of double-spacing.
 57           Newline             = "runoff_mr4$Newline"        //  Print n newline characters.
 58 //        Number              = "runoff_mr2$Number"         //  Scan a number from a control line.
 59           Nx_close            = "runoff_mr0$Nx_close"       //  Close current input stream.
 60           Nx_open             = "runoff_mr0$Nx_open"        //  Open a new stacked input stream.
 61           Nx_reset            = "runoff_mr0$Nx_reset"       //  Set read pointer back to beginning of current file.
 62 //        OldModes            = "runoff_dim$OldModes"       //  Create return mode string for changemode (dim).
 63 //        PrintErrorFile      = "runoff_driver$PrintErrorFile" // Dump buffered error messages on console.
 64           PrinterIndent       = "runoff_mr4$PrinterIndent"  //  Indent an extra twenty spaces for printer.
 65           PrintFootnotes      = "runoff_mr6$PrintFootnotes" //  To output the accumulated footnotes.
 66           Readline            = "runoff_mr0$Readline"       //  Read a line of input.
 67           Readhead            = "runoff_mr5$Readhead"       //  Read header into vector provided.
 68           ReadExp             = "runoff_mr8$ReadExp"        //  Evaluate an expression.
 69           ReadName            = "runoff_mr4$ReadName"       //  Scan name from control line, pack in vector.
 70           ReadNumber          = "runoff_mr8$ReadNumber"     //  Convert number from control line.
 71           ReadParam           = "runoff_mr8$ReadParam"      //  Evaluate a parameter expression.
 72           ReadString          = "runoff_mr8$ReadString"     //  Read a string.
 73           Report              = "runoff_mr0$Report"         //  Report an error in usage, etc.
 74           Roff                = "runoff_mr1$Roff"           //  The main program for RUNOFF.
 75           RoffProcess         = "runoff_mr0$RoffProcess"    //  Called for each input file.
 76 //        runoff_module       = "runoff_$runoff_module_"    //  Outer module transfer vector for dim.
 77 //        RunoffCommand       = "runoff_driver$runoff"      //  Command interface.
 78 //        Save                = "runoff_dim$Save"           //  Store global vector in SDB for dim.
 79           SetCharsw           = "runoff_mr0$SetCharsw"      //  Turn chars feature on or off.
 80 //        SetCtable           = "runoff_mr9$SetCtable"      //  Update translation table from .sr command.
 81           SetDevice           = "runoff_mr1$SetDevice"      //  Change tables for a new device.
 82           Sethead             = "runoff_mr5$Sethead"        //  Set up header or footer.
 83           SetLinesLeft        = "runoff_mr4$SetLinesLeft"   //  Repeat calculation of LinesLeft.
 84 //        SetModes            = "runoff_dim$SetModes"       //  Mode changing subroutine for DIM.
 85           SetPaging           = "runoff_mr1$SetPaging"      //  Turn no pagination feature on or off.
 86           SetSwitches         = "runoff_mr1$SetSwitches"    //  Initialize most of runoff.
 87 //        SetSymbol           = "runoff_mr9$SetSymbol"      //  Assign new value and type to named symbol.
 88 //        Set_param           = "runoff_mr2$Set_param"      //  Update variable, absolute or relatve.
 89           Set_ref             = "runoff_mr9$Set_ref"        //  Define or update symbol.
 90 //        Skip                = "runoff_mr8$Skip"           //  Skip over blanks in control line.
 91           Skiptolabel         = "runoff_mr4$Skiptolabel"    //  For .gb and .gf.
 92           Spacing             = "runoff_mr3$Spacing"        //  Process vertical spacing.
 93 //        StNum               = "runoff_dim$StNum"          //  Store number into mode string for OldModes.
 94 //        Store               = "runoff_mr7$Store"          //  Save character until line is complete (for "chars").
 95           StoreArabic         = "runoff_mr4$StoreArabic"    //  Convert number to string.
 96 //        StoreCtable         = "runoff_mr9$StoreCtable"    //  Convert translation table to string form.
 97           StoreDate           = "runoff_mr4$StoreDate"      //  Store current date in vector.
 98           StoreRoman          = "runoff_mr4$StoreRoman"     //  Store number as roman numeral.
 99           StoreString         = "runoff_mr0$StoreString"    //  Make copy of string in free storage.
100 //        StSwitch            = "runoff_dim$StSwitch"       //  Store switch mode into mode string.
101 //        SubscriptString     = "runoff_mr8$SubscriptString" // Evaluate substring expression.
102           Text                = "runoff_mr3$Text"           //  Process 1 line of input text.
103           Title               = "runoff_mr5$Title"          //  Print a header or a footer.
104 //        Tree_search         = "runoff_mr9$Tree_search"    //  Look named symbol up in symbol table.
105 //        TryToHyphenate      = "runoff_mr3$TryToHyphenate" //  Last word won't fit on line, break it if possible.
106           Typeout             = "runoff_mr0$Typeout"        //  Type rest of input line on console.
107 //        Unsave              = "runoff_dim$Unsave"         //  Restore globals from SDB for dim.
108           UpdateSymbol        = "runoff_mr9$UpdateSymbol"   //  Set named symbol to value from control line.
109           Use_ref             = "runoff_mr9$Use_ref"        //  Insert symbol value in place of symbol
110           Wait                = "runoff_mr0$Wait"           //  Wait for an interaction from the console.
111           Width               = "runoff_mr3$Width"          //  Return width of a character.
112           WrCh                = "runoff_mr7$WrCh"           //  "Chars" routine
113           WrChInit            = "runoff_mr7$WrChInit"       //  Initialize "chars" routine
114           WriteChar           = "runoff_mr4$WriteChar"      //  Write a character of output.
115 //        Wrline              = "runoff_ms7$Wrline"         //  Write stored line into chars file.
116 
117 }
118 
119 global              //  Scalars, switches, common vectors, etc. ...
120 {
121           Ad                  : 100     //  Adjust
122           Again               : 101     //  Input line in Rawchar must be reprocessed.
123           Ce                  : 102     //  Number of lines to center.
124           Char                : 103     //  Buffer for output characters.
125           CharsTable          : 104     //  Table of special characters for .chars output.
126           Charsw              : 105     //  Indication of unprintable characters.
127           ChStream            : 106     //  Output stream for "chars" option output
128           Conv                : 107     //  Character conversion.
129 
130           Device              : 110     //  Type of device output is to be formatted for.
131           DeviceTable         : 111     //  Conversions for this device.
132           Ef                  : 112     //  Even foot
133           Eh                  : 113     //  Even head.
134           Eq                  : 114     //  Equation line counter.
135           Eqcnt               : 115     //  Equation reference counter
136           ErrorfilePointer    : 116     //  Pointer to the temporary error file if any.
137           Errorstream         : 117     //  Output stream for diagnostics.
138 
139           ErrorTempID         : 120     //  ID number for temporary error message segment.
140           ExpError            : 121     //  Indicates badly formed expression.
141           ExtraMargin         : 122     //  Indent entire text this many spaces.
142           Fc                  : 123     //  No. of characters in Footbuf
143           Fd                  : 124     //  Remember if text is double spaced
144           Fi                  : 125     //  Fill switch.
145           FileName            : 126     //  Name of first input file.
146           Filesw              : 127     //  True if output is going to a file.
147 
148           Findent             : 130     //  Indenting in use before entering footnote.
149           Fl                  : 131     //  No. of lines in FootList
150           Flp                 : 132     //  Print line although page appears full
151           Foot                : 133     //  Footnote counter
152           Footbuf             : 134     //  Buffer to hold current footnote.
153           FootList            : 135     //  Working pointer into list of footnote lines.
154           FootListBase        : 136     //  Base of footnote list.
155           FootRef             : 137     //  Footnote reference string in footnote body.
156 
157           Fp                  : 140     //  First page to print.
158           Fr                  : 141     //  Footnote counter reset switch
159           From                : 142     //  -from argument.
160           Ft                  : 143     //  Footnote processing switch
161           Fth                 : 144     //  Vector for user-defined demarcation line
162           Fundent             : 145     //  Undenting in use before entering footnote.
163           Hyphenating         : 146     //  True if an attempt to break a word should be made.
164           In                  : 147     //  Indent to here.
165 
166           InputFileName       : 150     //  Name of current input file.
167           InputLines          : 151     //  Current line number in current source file.
168           InputStack          : 152     //  Stack of saved input streams.
169           JumpLine            : 153     //  Line number of .gb or .gf command during skip.
170           LinesLeft           : 154     //  Number of usable text lines left on this page.
171           LIno                : 155     //  Number of literal lines following.
172           Ll                  : 156     //  Line length.
173           Lp                  : 157     //  Last page to print.
174 
175           Ma1                 : 160     //  Space above header.
176           Ma2                 : 161     //  Space below header.
177           Ma3                 : 162     //  Space above foot.
178           Ma4                 : 163     //  Space below foot.
179           Ms                  : 164     //  Spacing between lines (ss = 1, ds = 2, etc.)
180           MultiplePagecount   : 165     //  Form feeds between pages to printer.
181           Nc                  : 166     //  Number of characters in Char.
182           NestingDepth        : 167     //  Index into stack of input files.
183 
184           Nl                  : 170     //  Last used line number.
185           NNp                 : 171     //  Next page number.
186           NoControl           : 172     //  True if control lines are to be ignored.
187           NoFill              : 173     //  True if fill mode is always off.
188           NoFtNo              : 174     //  True to suppress number on next footnote reference.
189           NoPaging            : 175     //  True if no pagination is desired.
190           Np                  : 176     //  Current page number.
191           Nr                  : 177     //  Number of characters in Rawchar.
192 
193           Nrx                 : 180     //  Count through input buffer.
194           OddPage             : 181     //  True if current page number is odd.
195           Of                  : 182     //  Odd foot.
196           Oh                  : 183     //  Odd head.
197           Output              : 184     //  Runoff's main text output stream.
198           PadLeft             : 185     //  True if padding is to start from left of line.
199           Parameter           : 186     //  Initial value of built-in symbol.
200           Passes              : 187     //  Number of passes left to make.
201 
202           Pi                  : 190     //  Space needed for a picture.
203           Pl                  : 191     //  Paper length.
204           Print               : 192     //  Whether or not to print.
205           Printersw           : 193     //  Output is intended for online printer.
206           PrintLineNumbers    : 194     //  True if source line numbers are to be printed in output.
207           Rawchar             : 195     //  Buffer for input line.
208           Roman               : 196     //  Roman numeral pagination.
209           SavedCc             : 197     //  Temporary used by WriteChar.
210 
211           Selsw               : 200     //  for selectric ball option
212           Spec_char           : 201     //  For symbol references.
213           Start               : 202     //  -start argument.
214           Stopsw              : 203     //  Stop between pages of output.
215           Temp                : 204     //  Vector to hold unprinted character
216           Tempc               : 205     //  No. of characters in Temp
217           TextRef             : 206     //  Footnote reference string in main text.
218           TimeNow             : 207     //  Clock reading when runoff is entered.
219 
220           To                  : 210     //  -to argument.
221           TrTable             : 211     //  Translation table for .tr.
222           TreeRoot            : 212     //  Base of symbol tree.
223           Un                  : 213     //  Undent to here.
224           Waitsw              : 214     //  From -wait option.
225 
226 //        300 to 309 are reserved for runoff_driver.
227 //        310 to 319 are reserved for runoff_dim.
228 //        320 to 329 are reserved for runoff_mr0.
229 //        330 to 339 are reserved for runoff_mr7.
230 }
231 
232 manifest
233 {
234           ByteBits  = 9       //  Bits per character, as packed by compiler.
235           Skip      = $8177   //  A character that will be ignored on output.
236           Maxline   = 400     //  Buffer lengths for input and output
237           Maxheads  = 20      //  No of header or footer lines.
238           MaxDepth  = 90      //  Nesting times 3 for .if.
239 
240           LL_       = 65      //  Default line length.
241           PL_       = 66      //  Default page length -- 11 inches, 6 lines/in.
242           MA1_      =  4      //  Default top margin above header
243           MA2_      =  2      //  Default top margin below header
244           MA3_      =  2      //  Default bottom margin above footer
245           MA4_      =  4      //  Default bottom margin below footer
246 }