/*  This header is provided from the one supplied by Cambridge.
      It includes exactly the same declarations as that given by
      Cambridge, but is laid out a line at a time for ease of
      context searching.  There is an additional list given in
      alphabetic order, to help find functions easily.

      The following names are used as parameters and return values in
      the descriptions of the globals:

     B        - a logical (TRUE or FALSE)

     CH       - a character

     D        - a stream descriptor, returned by a FIND.... routine
                and used by most I/O routines

     DD       - a DDname or DDname(membername) text string

     DDNAME   - a DDname text string

     F        - a function/routine entry point BCPL address

     FILE     - a direct access (block) dataset descriptor

     L        - a label

     MEMBER   - a membername text string

     N        - an integer value (occasionally a general value)

     P        - a level indicator (returned by LEVEL)

     S        - a text string

     V        - a vector
  */

GLOBAL $(LIBHDR

  START :             1   //  START(PARM.G)
  SETPM :             2   //  SETPM(PROCDEPTH,POINTERWIDTH,POINTERDEPTH)
  ABORT :             3   //  ABORT(CODE,ADDRESS,OLDSTACK,DATA)
  BACKTRACE :         4   //  BACKTRACE()
  ERRORMESSAGE :      5   //  ERRORMESSAGE(FAULT,FORMAT,ROUTINE,DDNAME)

  SAVEAREA :          6   //  BCPL address of user save area
  UNLOADALL :         7   //  UNLOADALL()
                          //  needs $LOAD$
  LOADFORT :          8   //  ENTRY := LOADFORT(MEMBER,DDNAME)
                          //  needs $LOAD$
  UNLOAD :            9   //  B := UNLOAD(MEMBER)
                          //  needs $LOAD$
  LOAD :             10   //  CODE := LOAD(MEMBER,DDNAME)
                          //  needs $LOAD$

  SELECTINPUT :      11   //  SELECTINPUT(D)
  SELECTOUTPUT :     12   //  SELECTOUTPUT(D)
  RDCH :             13   //  CH := RDCH()
  WRCH :             14   //  WRCH(CH)
  UNRDCH :           15   //  UNRDCH()

  INPUT :            16   //  D := INPUT()
  OUTPUT :           17   //  D := OUTPUT()
  INCONTROL :        18   //  INCONTROL(B)
  OUTCONTROL :       19   //  OUTCONTROL(B)
  TRIMINPUT :        20   //  TRIMINPUT(B)

  SETWINDOW :        21   //  SETWINDOW(N)
  BINARYINPUT :      22   //  BINARYINPUT(B)
  READREC :          23   //  N := READREC(V)
  WRITEREC :         24   //  WRITEVEC(V,N)
  WRITESEG :         25   //  WRITESEG(V,N)

  SKIPREC :          26   //  SKIPREC()
  TIMEOFDAY :        27   //  S := TIMEOFDAY()
  TIME :             28   //  N := TIME()
  DATE :             29   //  S := DATE()
  STOP :             30   //  STOP(N)

  LEVEL :            31   //  P := LEVEL()
  LONGJUMP :         32   //  LONGJUMP(P,L)
  /* global 33 not named - but do not use */
  BINWRCH :          34   //  BINWRCH(CH)
  REWIND :           35   //  B := REWIND()

  FINDLOG :          36   //  D := FINDLOG()
  WRITETOLOG :       37   //  WRITETOLOG(S)
  FINDTPUT :         38   //  D := FINDTPUT()
                          //  needs $TPUT$
  FINDPARM :         39   //  D := FINDPARM()
  APTOVEC :          40   //  RESULT := APTOVEC(F,N)

  FINDOUTPUT :       41   //  D := FINDOUTPUT(DD)
  FINDINPUT :        42   //  D := FINDINPUT(DD)
  FINDLIBRARY :      43   //  D := FINDLIBRARY(DDNAME)
  INPUTMEMBER :      44   //  D := INPUTMEMBER(DDNAME,MEMBER)
  PARMS :            45   //  BCPL address of PARM string still left

  ENDREAD :          46   //  B := ENDREAD()
  ENDWRITE :         47   //  B := ENDWRITE()
  CLOSELIBRARY :     48   //  CLOSELIBRARY(DDNAME)
  OUTPUTMEMBER :     49   //  D := OUTPUTMEMBER(DDNAME,MEMBER)
  /* global 50 not named - but do not use */

  ENDTOINPUT :       51   //  B := ENDTOINPUT()
  LOADPOINT :        52   //  BCPL address of first word of program
  ENDPOINT :         53   //  BCPL address of last word of program
  STACKBASE :        54   //  Base of stack pointer
  STACKEND :         55   //  End of stack pointer

  STACKHWM :         56   //  P := STACKHWM()
  SYSTEM :           57   //  String "OS" or "CMS": "OS" at RL
  INPROGRAM :        58   //  B := INPROGRAM(L)
  VALIDPOINTER :     59   //  B := VALIDPOINTER(V)
  WRITES :           60   //  WRITES(S)

  COMPAREBLOCK :     61   //  ?  ***  not supplied yet  ***
  WRITEN :           62   //  WRITEN(N)
  NEWLINE :          63   //  NEWLINE()
  NEWPAGE :          64   //  NEWPAGE()
  WRITEO :           65   //  WRITEO(N)

  PACKSTRING :       66   //  N := PACKSTRING(V,S)
  UNPACKSTRING :     67   //  UNPACKSTRING(S,V)
  WRITED :           68   //  WRITED(N,WIDTH)
  WRITEARG :         69   //  WRITEARG(N)
  READN :            70   //  N := READN()

  TERMINATOR :       71   //  Terminator character of READN
  LOADPAGE :         72   //  ?
  TURNPAGE :         73   //  ?
  WRITEX :           74   //  WRITEX(N)
  WRITEHEX :         75   //  WRITEHEX(N,WIDTH)

  WRITEF :           76   //  WRITEF(FORMAT,A,B,C,...)
  WRITEOCT :         77   //  WRITEOCT(N,WIDTH)
  MAPSTORE :         78   //  MAPSTORE()
  USERPOSTMORTEM :   79   //  USERPOSTMORTEM(CODE)
  CALLIFORT :        80   //  RESULT := CALLIFORT(ENTRY,4*@A,4*@B...)

  CALLRFORT :        81   //  RESULT := CALLRFORT(ENTRY,4*@A,4*@B...)
  SETBREAK :         82   //  SETBREAK(B)
                          //  needs $TPUT$
  ISBREAK :          83   //  B := ISBREAK()
                          //  needs $TPUT$
  ERRORRESET :       84   //  B := ERRORRESET()
  GETBYTE :          85   //  CH := GETBYTE(S,N)

  PUTBYTE :          86   //  PUTBYTE(S,N,CH)
  GETVEC :           87   //  V := GETVEC(N)
  FREEVEC :          88   //  FREEVEC(V)
  RANDOM :           89   //  N := RANDOM(N)
  MULDIV :           90   //  D := MULDIV(A,B,C)

  RESULT2 :          91   //  Secondary result of CALLIFORT etc..
  BLOCKSIZE :        92   //  BYTES := BLOCKSIZE(FILE)
                          //  needs $BLOCK$
  CREATEBLOCKFILE :  93   //  FILE := CREATEBLOCKFILE(DDNAME,BYTESIZE)
                          //  needs $BLOCK$
  OPENBLOCKFILE :    94   //  FILE := OPENBLOCKFILE(DDNAME)
                          //  needs $BLOCK$
  CLOSEBLOCKFILE :   95   //  CLOSEBLOCKFILE(DDNAME)
                          //  needs $BLOCK$

  READBLOCK :        96   //  B := READBLOCK(FILE,N,V)
                          //  needs $BLOCK$
  WRITEBLOCK :       97   //  B := WRITEBLOCK(FILE,N,V)
                          //  needs $BLOCK$
  WRNEXTBLOCK :      98   //  CODE := WRNEXTBLOCK(FILE,V)
                          //  needs $BLOCK$
  MOVEBLOCK :        99   //  MOVEBLOCK(V1,I1,V2,I2,N)
                          //  needs $BLOCK$

 $)LIBHDR

MANIFEST $(LIBHDR

  ENDSTREAMCH    = -1     //  End of stream character
  BYTESPERWORD   =  4     //  IBM 360/370 dependent
  TICKSPERSECOND = 38400  //  Possibly 370/165 dependent

 $)LIBHDR