Shared C Library

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()UnknownCurrents acts as putc()
_kernel_command_string()Complete
_kernel_exit()PartialTakes return code from parameter rather than _kernel_setreturncode()
_kernel_fpavailable()PlaceholderAlways returns 0
_kernel_init()Complete
_kernel_osbyte()CompleteSee OS_Byte itself for full details of compatibility.
_kernel_osrdch()CompleteJava command-line operates in line mode not character mode.
_kernel_swi()Complete
_main()PartialDoes not handle quoted arguments.
atexit()Complete
atoi()Complete
calloc()Complete
exit()Complete
fclose()Complete
feof()Complete
fflush()PartialCannot fflush(NULL)
fgetc()Complete
fgets()Complete
fopen()PartialModes "a" and "+" ignored.
fprintf()Complete
fputc()Complete
fputs()Complete
fread()Complete
free()PlaceholderCommented out code.
fscanf()PartialOnly %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()CompleteJava 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()PlaceholderDoes nothing.
signal()PlaceholderDoes nothing.
sprintf()Complete
srand()Complete
sscanf()PartialOnly %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