User guide
3.3. GLOBAL FUNCTIONS 61
selectoutput(scb) CIN:y, POS:y, NAT:y
This r ou ti ne selects scb as the currently selected output stream. It aborts (with
code 187) if scb is not an output stream.
res := setbit(bitno, bitvec, state) CIN:y, POS:y, NAT:y
This function sets the speci fie d bit in bitvec t o 1 or 0 depending on whether state
is TRUE or FALSE, respectively. It returns a non-zero value if and only if the previous
setting of the bit was a one. See testbit below.
res := setflags(taskid, flags) CIN:n, POS:y, NAT:n
This Cintpos function sets the specified flags in the task control block of the specified
task. If successful it returns a non zero value with result2 set to the previous setting
of the flags field, otherwise it returns zero with result2 set to 101 indivating that
taskid was invalid. For more information about flags see testflags descri bed b e l ow.
oldse ed := setlogname(logname, logvalue) CIN:y, POS:y, NAT:y
This sets the value of logical variable logname to the logvalue. By convention
logvalue should be a string. The list of logical name-value pairs is held in the root
node.
oldse ed := setseed(newseed) CIN:y, POS:y, NAT:y
The c ur r ent seed can be set to newseed by the call setseed(newseed). This function
returns the previous seed val ue .
srchwk(tcb) CIN:n, POS:y, NAT:n
This function is the Cintpos scheduler which is normally only called from within
one of the klib library functions or from the interrupt service routine. Its argument
points to the highest pri or i ty task control block that could possibly run. It searches
down the priority chain from this p oi nt until it finds the highest priority runnable task.
After setting the globals tcb and taskid appropriately, it gives t hi s task control using
a call of sys(Sys
rti,...).
code := start(a1, a2, a3, a4) CIN:y, POS:y, NAT:y
This function is, by convention, the mai n function of a program. If it is called from
the command language interpreter (see section 4), its first argument is zero and i t s
result should be the command completion code; however, if it is the main function of
a module run by callseg, defined below, then it can take up to 4 arguments and its
result is up to the user. By convention, a command complet i on code of zero indicates
successful completion and large r numbers indicate errors of ever gre ate r severity
res := stepstream(scb, n) CIN:y, POS:y, NAT:y
This function advances the position of stream scb by n words, returning TRUE if
successful, and FALSE otherwise.
stop(code, reason) CIN:y, POS:y, NAT:y
This function is provided to stop the execution of the curr e nt command running
under control of the CLI. The arguments code and reason are placed in the CLI globals