User guide

Chapter 3
The Library
This manual describes three var i ants of the BCPL system. The simplest is in-
voked by the shell command cintsys and provides a single t h r eaded command
language interpreter. The system invoked by cintpos provides a mul t i -t hreaded
system where the in d i vi d u a l threads (called tasks) are ru n in parallel and are
pre-emptible. A third version is available for some architectures and provides a
single threaded version in which the BCPL source is compiled into native machine
code. Although this version is faster, it is more machine dependent, has fewer
debugging aid s and will only run a single command.
The libraries of these three systems have much in common and so are all
described t oget her. The description of all constants, variables and fun ct i ons have
a right justified l i n e such as the following
CIN:y, POS:y, NAT:n
where CIN:, POS: and NAT: denote t he single threaded, multi-threaded and native
code versions, respectively, and the letters y and n stand for yes and no, showing
whether the corresponding constant, variable or function is available on that
version of the system.
The resident library functions, var i ab l es and manifest constants are declared
in the standard library header file g/libhdr.h. Most of the functions are defin ed
in BCPL in eit h er sysb/blib.b or sysb/dlib.b, but three function s (sys, chgco
and muldiv) are in the hand written Cintcode file cin/syscin/syslib. Most
functions relat i n g to the multi-thr ead e d version are defined in klib.b.
The following three sections describe the manifest con st a nts, variables and
functions (in alphabetical order) provided by the standard library.
3.1 Manifest constant s
B2Wsh CIN:y, POS:y, NAT:y
This constant hol ds the shift required to convert a BCPL pointer into a byte address.
33