Libslack
Appearance
Libslack is a library of general utilities designed to make UNIX/C programming a bit easier on the eye. It is a seemingly random collection of modules and functions. It was originally implemented as part of the "daemon" program (although some of the code dates back much further).
It's a small library with much functionality, accurately documented and thoroughly tested. Good library naming conventions are not rigorously observed on the principle that common operations should always be easy to write and code should always be easy to read.
Libslack comprises the following modules covering various topics[1]:
agent | - agent-oriented programming (file I/O stream events and scheduled timers) |
coproc | - co-processes using pipes or pseudo terminals |
daemon | - become a daemon process, pid files, prevent core files, revoke privileges, change user, parse configs |
err | - generic message/error/debug/verbose/alert messaging |
fio | - universal getline, fifos, file control, read/write timeouts, sub-second sleep |
hsort | - heap sort (by Stephen Russell) |
lim | - POSIX.1 limits convenience functions |
link | - singly- and doubly-linked lists with optional growable free lists |
list | - list data type (growable pointer array) with flexible locking |
locker | - abstract locking (with reader/writer lock implementation if missing) |
map | - map data type (hash table) with flexible locking |
mem | - memory helper functions, dynamic n-dimensional arrays, secure memory, memory pools |
msg | - generic message handling and syslog helper functions |
net | - networking: servers/clients (IPv4/IPv6/unix domain), multicast, reliable UDP, TOS, passing an open file descriptor to another process, receiving the credentials of the process on the other side of a Unix domain socket, send/expect for text protocols, pack/unpack for binary protocols |
prog | - program framework, flexible command line option handling, usage messages |
prop | - program properties files (key-value pairs) |
pseudo | - pseudo terminals (by Tatu Ylonen) |
sig | - ISO C compliant signal handling |
str | - string data type with flexible locking and C-string helper functions (tr, regex, regsub, fmt, split/join, soundex, trim/squeeze, quote/unquote, encode/decode, lc/lcfirst, uc/ucfirst, chop/chomp, bin/hex/oct, strcasecmp, strlcpy/strlcat, asprintf) |
Libslack is freely available under the GNU General Public License.
See also
[edit]References
[edit]- ^ "libslack". Libslack. Retrieved 28 December 2024.