The Shared C Library (SharedCLibrary Module) is the mechanism by which RISC OS natively implements standard ANSI C function calls. Other mechanisms, most notably UnixLib, also provide a full implementation of ANSI C (together with many POSIX calls) but the SharedCLibrary module is built into ROM and, unlike UnixLib, is shared between applications.
The Module provides a handful of SWI calls to obtain the set of entry points for all ANSI functions and a number of RISC OS-specific functions. In normal usage on a RISC OS machine, the SWI calls populate a section of the application code with a list of ARM branch instructions. The application then branches to the branch instruction (in a known place within its own code). The branch instruction, which the SharedCLibrary stored at that location, redirects the processor to code within the Module itself. More information on initialisation is available.
This page contains a list of calls and their current implementation status in ROBE. Unlisted calls have not been implemented at all.
Please submit any additions or corrections to robe@tapina.com
Function | Status | Details |
---|---|---|
__flsbuf() | Unknown | Currents acts as putc() |
_kernel_command_string() | Complete | |
_kernel_exit() | Partial | Takes return code from parameter rather than _kernel_setreturncode() |
_kernel_fpavailable() | Placeholder | Always returns 0 |
_kernel_init() | Complete | |
_kernel_osbyte() | Complete | See OS_Byte itself for full details of compatibility. |
_kernel_osrdch() | Complete | Java command-line operates in line mode not character mode. |
_kernel_swi() | Complete | |
_main() | Partial | Does not handle quoted arguments. |
atexit() | Complete | |
atoi() | Complete | |
calloc() | Complete | |
exit() | Complete | |
fclose() | Complete | |
feof() | Complete | |
fflush() | Partial | Cannot fflush(NULL) |
fgetc() | Complete | |
fgets() | Complete | |
fopen() | Partial | Modes "a" and "+" ignored. |
fprintf() | Complete | |
fputc() | Complete | |
fputs() | Complete | |
fread() | Complete | |
free() | Placeholder | Commented out code. |
fscanf() | Partial | Only %s is supported. |
fseek() | Complete | |
ftell() | Complete | |
fwrite() | Complete | |
getc() | Complete | |
getenv() | Complete | |
malloc() | Complete | |
memchr() | Complete | |
memcmp() | Complete | |
memcpy() | Complete | |
memmove() | Complete | |
memset() | Complete | |
os_get() | Complete | Java command-line operates in line mode not character mode. |
os_swi() | Complete | |
os_swix() | Complete | |
printf() | Complete | |
putc() | Complete | |
putchar() | Complete | |
puts() | Complete | |
qsort() | Complete | |
rand() | Complete | |
realloc() | Complete | |
remove() | Complete | |
rewind() | Complete | |
setjmp() | Placeholder | Does nothing. |
signal() | Placeholder | Does nothing. |
sprintf() | Complete | |
srand() | Complete | |
sscanf() | Partial | Only %s is supported. |
strcat() | Complete | |
strchr() | Complete | |
strcmp() | Complete | |
strcpy() | Complete | |
strlen() | Complete | |
strncat() | Complete | |
strncmp() | Complete | |
strncpy() | Complete | |
tmpnam() | Complete | |
vsprintf() | Complete | |
xdremainder() | Complete | |
xduremainder() | Complete |