Chapter 21. ABLE C Library

The C language does not have core support for simple operations such as input/output or string handling. This is instead provided by a “standard C library”, the ABLE implementation of this standard is referred to as the ABLE C Library (or just the C library).

The ABLE C library is a collection of headers and binary library components which provide not only the ISO “standard C library” but also additional elements for some POSIX functions. The library is not however completely conformant to a specific standard.

The ABLE implementations of some of this functionality may be limited or missing. These limits or omissions are primarily due to the limited environment which a bootloader can reasonably be expected to provide. The ABLE C library documentation packages contain a set of files describing each provided function in detail.

Table 21.1. ISO headers provided in ABLE C library

assert.hContains the assert macro, used to assist with detecting logical errors and other types of bug in debugging versions of a program.
ctype.hContains functions used to classify characters by their types or to convert between upper and lower case in a way that is independent of the used character set.
errno.hFor testing error codes reported by library functions.
float.hContains defined constants specifying the implementation-specific properties of the floating-point library.
inttypes.hFor precise conversion between integer types.
limits.hContains defined constants specifying the implementation-specific properties of the integer types.
locale.hFor setlocale() and related constants. This is used to choose an appropriate locale.
math.hFor computing common mathematical functions
setjmp.hDeclares the macros setjmp and longjmp, which are used for non-local exits
signal.hFor controlling various exceptional conditions
stdarg.hFor accessing a varying number of arguments passed to functions.
stdbool.hFor a boolean data type.
stdint.hFor defining various integer types.
stdio.hProvides the core input and output capabilities of the C language.
stdlib.hFor performing a variety of operations, including conversion, pseudo-random numbers, memory allocation, process control, environment, signalling, searching, and sorting.
string.hFor manipulating several kinds of strings.
time.hFor converting between various time and date formats.
wchar.hFor manipulating strings using wide characters. Support within ABLE is extremely limited.
wctype.hFor classifying wide characters.

ABLE also supports a variety of non standard additional interfaces. These include a GNU compatible getopt implementation, a simple readline implementation and a basic TCP/IP sockets interface.

Table 21.2. Additional headers available in ABLE libc

alloca.hThe alloca function allows memory to be allocated from the stack.
fcntl.hRoutines to manipulate file descriptors.
libintl.hInternationalisation support for text strings, this is a stub and only supports the ASCII english representation.
netdb.hDefinitions and structures for using DNS nam eresolution.
poll.hDefinitions and structures for the poll call.
strings.hBSD style string manipulation.
dirent.hDirectory entry manipulation.
getopt.hProvide access to the long format getopt calls.
regex.hFunctions and sructures for regular expression handling.
err.hNon standard BSD error display routines, implementations may be incomplete.
iconv.hcharacter set conversions, limited support for ASCII, UTF-8, ISO88591 and CP437 character sets.
malloc.hDynamic memory allocation and manipulation routines.
unistd.hAccess to UNIX® standard routines.

Additional packages provide a set of “core” libraries which include zlib for compression support, libpng for png image support and libjpeg for using jpeg images.