libskarnet
skalibs
Software
www.skarnet.org
The stddjb library interface
libstddjb is the base, and the most important part, of skalibs.
It is a set of general-purpose C functions wrapping some
system calls, hiding some Unix portability problems, providing some
basic low-level buffering functions and string handling, and generally
offering a nice API to Unix programming - in many ways nicer and safer
than the "standard" Unix APIs like stdio.h.
It is mostly based on some excellent code written and placed into the
public domain by D. J. Bernstein.
Compiling
- The libstddjb functions are available under the skalibs/stddjb.h
header, which includes a lot of lower-level headers. If you know what
lower-level headers to use, you might speed up your compilation process by
including them directly.
Programming
The following headers are automatically generated at compile-time, when the
headers subsystem is made. The skalibs/stddjb.h file also
includes them.
- skalibs/uint16.h: operations with 16-bit unsigned integers
- skalibs/uint32.h: operations with 32-bit unsigned integers
- skalibs/uint64.h: operations with 64-bit unsigned integers
- skalibs/types.h: portable helpers for common Unix types: size_t,
uid_t, gid_t, pid_t, time_t, dev_t and ino_t.
- skalibs/error.h: portable macros for errno management
- skalibs/setgroups.h: stub for the setgroups() function, for systems that do not define it
- skalibs/ip46.h: IPv4/IPv6 abstraction layer
Additionally, stddjb.h also includes the following headers, which
are not associated with any code and are mostly self-explanatory:
- skalibs/gccattributes.h: wrappers around a few GCC-specific optimizations
- skalibs/diuint.h: for associative arrays of unsigned integers
- skalibs/diuint32.h: for associative arrays of 32-bit unsigned integers
- skalibs/disize.h: for associative arrays of size_t
- skalibs/environ.h: declaration of the environ variable
- skalibs/nsig.h: the number of system signals, for systems that do not define it
- skalibs/nonposix.h: feature test macros for non-POSIX-compliant systems