THE CLIB FUNCTIONS
==================

This file lists all the calls provided by the kernel and C library parts
of CLib. The calls are listed in numerical order of offset. This offset is
relative to the start of the job table for the particular library chunk,
starting at 0. As each table entry is four bytes long, the offset should be
multiplied by four before adding it to the table start address to give the
address to call.

The C library calls are merely listed without giving further details. This
is because the function and parameters can be found in the C user guide 
(which is available separately) or any ANSI C reference book (except those
calls intended for internal use only). Remember that calls returning
non-simple types take an additional first parameter which is a pointer to
storage for the result.

It should be noted that many of the calls, especially those in the kernel,
are intended to be used by other higher level calls, or by other parts of
the library. These calls would not normally be used by a client program.



1) Kernel functions
===================
All the kernel functions except the first are detailed in the C user guide.
Therefore these are merely listed, while _kernel_init is documented in full.

0      _kernel_init
-------------------
Initialises the kernel and any number of language libraries as described
by the language description blocks. This call does not obey the APCS and
does not return. Instead, control passes to the routine returned by one
of the languages initialised.

Entry: R0 -> Kernel init block
               +0 Image base
               +4 Pointer to start of language description blocks
               +8 Pointer to end of language description blocks
       R1 -> Base of root stack chunk (returned in R1 from LibInit SWI)
       R2 -> Top of root stack chunk (returned in R2 from LibInit SWI)
       R3 =  0 for application, 1 for relocatable module
       R4 -> End of workspace

Exit: Does not return


1      _kernel_exit
2      _kernel_setreturncode
3      _kernel_exittraphandler
4      _kernel_unwind
5      _kernel_procname
6      _kernel_language
7      _kernel_command_string
8      _kernel_hostos
9      _kernel_swi
10     _kernel_osbyte
11     _kernel_osrdch
12     _kernel_oswrch
13     _kernel_osbget
14     _kernel_osbput
15     _kernel_osgbpb
16     _kernel_osword
17     _kernel_osfind
18     _kernel_osfile
19     _kernel_osargs
20     _kernel_oscli
21     _kernel_last_oserror
22     _kernel_system
23     _kernel_getenv
24     _kernel_setenv
25     _kernel_register_allocs
26     _kernel_alloc
27     _kernel_stkovf_split_0frame
28     _kernel_stkovf_split
29     _kernel_stkovf_copyargs
30     _kernel_stkovf_copy0args
31     _kernel_udiv
32     _kernel_urem
33     _kernel_udiv10
34     _kernel_sdiv
35     _kernel_srem
36     _kernel_sdiv10
37     _kernel_fpavailable
38     _kernel_moduleinit
39     _kernel_irqs_on
40     _kernel_irqs_off
41     _kernel_irqs_disabled
42     _kernel_entermodule
43     _kernel_escape_seen
44     _kernel_current_stack_chunk
45     _kernel_swi_c
46     _kernel_register_slotextend
47     _kernel_raise_error



2) C Library functions
======================
Calls not marked with a * are standard ANSI C funtions and are widely
documented. Some of the other calls are needed for the initialisation
process as shown in the example program. 'x$stack_overflow' is used for
stack extension and is described in the APCS chapter of the PRM. The other
calls are intended for internal use only.

0 *    trapHandler
1 *    uncaughtTrapHandler
2 *    eventHandler
3 *    uncaughtEventHandler
4 *    x$stack_overflow
5 *    x$stack_overflow_1
6 *    x$udivide
7 *    x$uremainder
8 *    x$divide
9 *    x$divtest
10 *   x$remainder
11 *   x$multiply
12 *   _rd1chk
13 *   _rd2chk
14 *   _rd4chk
15 *   _wr1chk
16 *   _wr2chk
17 *   _wr4chk
18 *   _main
19 *   _exit
20 *   _clib_initialise
21 *   _backtrace
22 *   _count
23 *   _count1
24 *   _stfp
25 *   _ldfp
26 *   _printf
27 *   _fprintf
28 *   _sprintf
29     clock
30     difftime
31     mktime
32     time
33     asctime
34     ctime
35     gmtime
36     localtime
37     strftime
38     memcpy
39     memmove
40     strcpy
41     strncpy
42     strcat
43     strncat
44     memcmp
45     strcmp
46     strncmp
47     memchr
48     strchr
49     strcspn
50     strpbrk
51     strrchr
52     strspn
53     strstr
54     strtok
55     memset
56     strerror
57     strlen
58     atof
59     atoi
60     atol
61     strtod
62     strtol
63     strtoul
64     rand
65     srand
66     calloc
67     free
68     malloc
69     realloc
70     abort
71     atexit
72     exit
73     getenv
74     system
75     bsearch
76     qsort
77     abs
78     div
79     labs
80     ldiv
81     remove
82     rename
83     tmpfile
84 *   _old_tmpnam
85     fclose
86     fflush
87     fopen
88     freopen
89     setbuf
90     setvbuf
91     printf
92     fprintf
93     sprintf
94     scanf
95     fscanf
96     sscanf
97     vprintf
98     vfprintf
99     vsprintf
100 *  _vprintf
101    fgetc
102    fgets
103    fputc
104    fputs
105 *  __filbuf
106    getc
107    getchar
108    gets
109 *  __flsbuf
110    putc
111    putchar
112    puts
113    ungetc
114    fread
115    fwrite
116    fgetpos
117    fseek
118    fsetpos
119    ftell
120    rewind
121    clearerr
122    feof
123    ferror
124    perror
125 *  __ignore_signal_handler
126 *  __error_signal_marker
127 *  __default_signal_handler
128    signal
129    raise
130    setjmp
131    longjmp
132    acos
133    asin
134    atan
135    atan2
136    cos
137    sin
138    tan
139    cosh
140    sinh
141    tanh
142    exp
143    frexp
144    ldexp
145    log
146    log10
147    modf
148    pow
149    sqrt
150    ceil
151    fabs
152    floor
153    fmod
154    setlocale
155    isalnum
156    isalph
157    iscntrl
158    isdigit
159    isgraph
160    islower
161    isprint
162    ispunct
163    isspace
164    isupper
165    isxdigit
166    tolower
167    toupper
168 *  __assert
169 *  _memcpy
170 *  _memset
171    localeconv
172    mblen
173    mbtowc
174    wctomb
175    mbstowcs
176    wcstombs
177    strxfrm
178    strcoll
179 *  _clib_finalisemodule
180 *  _clib_version
181 *  finalise
182    tmpnam
