
// File LIBHDR

// Version: D2.3

// BCPL library header for the DEC VAX-11 under VMS

// Copyright R.D. Eager   University of Kent   MCMLXXXVIII


GLOBAL $(
start		: 1	// rt	* entry point
getmessage	: 2	// fn	* return message for error code [code -> message]
process_id	: 3	// v	* numeric process ID
stop		: 4	// rt	* terminates execution [status]
faostring	: 5	// fn	* formats string using VMS service [string1, string2, arglist -> string2]
profile		: 6	// v	* controls output of profile counting
globalsize	: 7	// v	* number of globals
stackbase       : 8     // v    * byte address of base of stack (FP of START)
close		: 9	// rt	* closes down all I/O []

findinput	:10	// fn	* creates inout stream [D -> S, E]
findoutput	:11	// fn	* creates output stream [D -> S, E]
findappend      :12     // fn   * creates or appends to output [D -> S, E]
settrim		:13	// fn	* controls trimming of trailing spaces [(CIS) -> E]
selectinput	:14	// fn	* selects input stream as current [S -> 0, E]
selectoutput	:15	// fn	* selects output stream as current [S -> 0, E]
sysin		:16	// v	* default input stream pointer (SYS$INPUT)
sysout		:17	// v	* default output stream pointer (SYS$OUTPUT)
endread		:18	// fn	* terminates current input stream; unsets selection [-> 0, E]
endwrite	:19	// fn	* terminates current output stream; unsets selection [-> 0, E]
journal		:20	// v	* error output stream pointer (SYS$ERROR)

rdch		:22	// fn	* reads a character from current input [(CIS) -> CH, E]
wrch		:23	// fn	* writes a character to current output
input		:24	// fn	* returns currently selected input stream pointer [(CIS) -> S, E]
output		:25	// fn	* returns currently selected output stream pointer [(COS) -> S, E]
rewind		:26	// fn	* repositions currently selected input to start [(CIS) -> S, E]
endtoinput	:27	// fn	* closes currently selected output; reopens for input [(COS) -> S,E]
prompt		:28	// rt	* sets current input prompt [prompt]
unrdch		:29	// rt	* 'unreads' last character from current input stream [(CIS)]

interactive	:30	// v	* 'true' if running from a terminal, else 'false'
param		:31	// v	* parameter passed by DCL as a BCPL string
username	:32	// v	* username as a BCPL string
terminal	:33	// v	* terminal name as a BCPL string
result2		:34	// v	* auxiliary result code
date		:35	// fn	* returns date as string [vec 2 -> addressofvec]
timeofday	:36	// fn	* returns time as string [vec 2 -> addressofvec]
lplines		:37	// fn	* returns number of lines on a printer page [-> nooflines]
getconad        :38     // fn   * maps file into virtual memory [S -> byteaddress]
muldiv		:39	// fn	* performs scaled arithmetic [a,b,c -> a*b/c]

renamefile	:40	// fn	* renames a file [oldname, newname -> 0, E]
deletefile	:41	// fn	* deletes a file [name -> 0, E]
seek		:42	// fn	* positions a file [(CIS) -> 0, E]
spawn_process	:43	// fn	* spawn subprocess to execute DCL command [command,flags -> 0, E]
docommand	:46	// rt	* stops run and executes command [command]
opendirect	:47	// fn	* opens a direct access file [D -> S, E]
readdirect	:48	// fn	* reads a 512 byte record [ S, block, buffer -> E ]
writedirect	:49	// fn	* writes a 512 byte record [ S, block, buffer -> E ]
closedirect     :50     // fn   * closes a direct access file [S -> 0, E]

level		:51	// fn	* returns frame pointer for use by 'longjump'
longjump	:52	// rt	* causes non-local jump
aptovec		:53	// fn	* applies function to vector [fn,vecsize -> fnresult]
packstring	:56	// fn	* packs up string from vector [vec,string -> offset of last word used]
unpackstring	:57	// rt	* unpacks string into vector [string,vec]
getbyte         :58	// fn	* takes 2 arguments, 's' and 'n'; yields character 'n' of string 's'
putbyte         :59	// rt	* takes 3 arguments, 's', 'n' and 'ch'; replaces 'n'th character of string 's' with 'ch'

getvec		:62	// fn	* allocates off-stack vector space [size -> address, 0]
freevec		:63	// rt	* returns space claimed by 'getvec' [address -> 0, E]
getvecquantum   :64     // v    * minimum size allocated by 'getvec'
readrec         :65     // fn   * reads record from stream
writerec        :66     // fn   * writes record to stream [s -> 0,E]
newpage		:67	// rt	* prints a formfeed on current output
writeo		:68	// rt	* same as writeoct(number,11)
writeh		:69	// rt	* same as writehex(number,8)

newline		:70	// rt	* prints a newline on current output
writen		:71	// rt	* writes a decimal number (minimum width)
writed		:72	// rt	* takes 2 arguments, 'n' and 'd'; writes 'n' as a decimal number, width 'd'
writehex	:73	// rt	* similar to 'writed', but writes a hexadecimal number
writeoct	:74	// rt	* similar to 'writed', but writes an octal number
writes		:75	// rt	* writes a string
writef		:76	// rt	* general purpose format driven output routine
readn		:77	// fn	* reads a decimal number [ -> number]
terminator	:78	// v	* terminating character from 'readn' or 'readnumber'
readnumber	:79	// fn	* reads a number in given radix [radix -> number]

translate	:80	// rt	* performs table translation function [byteaddressofstring,length,table]
move		:81	// rt	* moves bytes in store [length,byteaddressofsource,byteaddressofdestination]
catchattention	:82	// fn	* arranges to catch control-C interrupts [onoff -> 0, E]
attentionpending:83	// v	* TRUE iff control-C has been typed
probe           :84     // fn   * validates addresses [addr,len,mode -> truthvalue]

backtrace	:90	// rt	* gives trace of last few function entries
postmortem	:91	// rt	* unwinds the BCPL stack and prints it
mapglobals	:92	// rt	* prints contents of global vector within specified limits
mapstore	:93	// rt	* prints routine names, addresses and profile counts
abort		:94	// rt	* calls G90, G91, G92, G93, G95, G96
userpostmortem	:95	// rt	* user-supplied postmortem routine
mapstatics	:96	// rt	* prints values of STATIC variables
contingency	:99	// rt	* handles exceptions
$)

MANIFEST $(   // System manifest constants
endstreamch	= -1
bytesperword	= 4
bitsperword     = 32
maxint		= 2147483647
minint		= -2147483648
maxstrlength	= 255
firstfreeglobal	= 100
$)

// End of file LIBHDR.


