OSLib is a highly optimized interface library for the Application Programmers' Interface (API) for the Acorn series of 32 bit RISC OS computers. It is a useful tool for application program writers for this platform. It is of no use for any other platform.
OSLib provides a complete coverage of the RISC OS API (the so-called SWIs) as a set of C/C++, ARM assembler and Vala headers, together with a thin veneer library.
- Often, memory access is completely avoided
- Type safe
- Every argument can be type checked by the compiler
- A SWI is called by the "obvious" syntax
- Register safe
- Hides (often idiosyncratic) register allocation
- Every SWI is covered
- Language independent
- Although the headers are specific to C and assembler, the library is not - any APCS conformant language can call it
OSLib also provides names for all the data structures and reason codes used by the API. Code that uses it is superior to similar code using _kernel_swi() or _swix(), both in terms of the compile time type checking that is available, and the size and speed of the code generated.
OSLib provides a very convenient interface to the RISC OS programmer, since all the facilities of the C compiler are available to catch errors and generate good code. It is very small, and code written using it is smaller and faster than code written using other means.
Whilst not strictly part of OSLib, which specialises in providing an interface to the RISC OS API, the OSLib development team also maintain a higher-level C library, providing an easier to use interface, via OSLib, to the more arcane parts of RISC OS, and deals with Events, Messages, Tasks, Exceptions, and Errors. This is distributed on the same basis and under the same licence conditions as OSLib itself.