Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / liblimb.3.md

% limb manual
% liblimb(3)
% limb 0.1.0
% 2023-07-24

# NAME

liblimb - lila's core library

# DESCRIPTION

A simple C library (based on [skalibs]) with common APIs used by all lila's
software.


[skalibs]: https://skarnet.org/software/skalibs

# HEADERS

The following headers are available :

## allreadwrite.h

The [allreadwrite.h](0) defines the needed functions to perform safe I/O
operations.

! INFO: Low-level API
! Note that you probably don't want/need to use the functions below, and should
! probably use a higher-level interface such as [buffer.h](0).

## autoopt.h

The [autoopt.h](0) defines functions to handle options automatically.

## base32.h

The [base32.h](0) defines the required functions perform base32 encoding/decoding.

## base64.h

The [base64.h](0) defines the required functions perform base64 encoding/decoding.

## base.h

The [base.h](0) defines the required functions perform base 16/32/64/128
encoding/decoding.

## blake3.h

The [blake3.h](0) defines the required function to compute the BLAKE3 hash of a
given block of data.

## buffer.h

The [buffer.h](0) defines required functions to performed buffered I/O operations.

## buffer-shldata.h

The [buffer-shldata.h](0) defines functions used to encrypt/decrypt data using
the "shielded data" protocol through the [buffer.h](0) interface.

Refer to [shldata](5) for more about shielded data protocol.

## bytestr.h

The [bytestr.h](0) defines functions to work with byte arrays and/or strings.
They work on data not necessarily NUL-terminated, hence the requirement for
length, and return indices/offset within the array instead of pointers, as with
standard library functions.

## ccpl.h

The [ccpl.h](0) defines the required function to encrypt/decrypt messages using
the ChaCha20-Poly1305 AEAD algorithm.

## cdb.h

The [cdb.h](0) defines the needed functions to access constant databases, known
as .cdb files.

## cdbmake.h

The [cdbmake.h](0) defines the needed functions to create constant databases,
known as .cdb files.

## chacha20.h

The [chacha20.h](0) defines the required function to encrypt/decrypt messages
using the ChaCha20 cipher.

## command.h

The [command.h](0) defines helpers to implement a command-based application.

## copa.h

The [copa.h](0) defines helper functions to parse configuration file.

## direntry.h

The [direntry.h](0) defines the needed functions to deal with directory streams.

## djbunix.h

The [djbunix.h](0) header offers alternative API to basic Unix concepts, dealing
with I/O operations, file descriptors, environment, child processes, and so on.

## esc.h

The [esc.h](0) defines functions to needed to escape/unescape data.

## exitcode.h

The [exitcode.h](0) defines some standardized exit codes aimed to provide
consistency amongst applications. They are based upon/taken from BSD's own
`sysexits.h`

## gccattributes.h

The [gccattributes.h](0) defines GCC macros to define objects' attributes.

## genalloc.h

The [genalloc.h](0) defines functions to work heap-allocated memory. It is
implemented on top of *stralloc* (See [stralloc.h](0) for more) providing an API
to store dynamic arrays of fixed-size objects.

## hasher.h

The [hasher.h](0) defines the required functions to compute message digests
through a generic interface.

## hasher_blake3.h

The [hasher_blake3.h](0) defines the hasher to compute the BLAKE3 of a given
message.

## hasher_sha1.h

The [hasher_sha1.h](0) defined the hasher to compute the SHA1 of a given
message.

## hasher_sha256.h

The [hasher_sha256.h](0) defined the hasher to compute the SHA256 of a given
message.

## hasher_sha512.h

The [hasher_sha512.h](0) defined the hasher to compute the SHA512 of a given
message.

## hasher_sha3_224.h

The [hasher_sha3_224.h](0) defined the hasher to compute the SHA3-224 of a given
message.

## hasher_sha3_256.h

The [hasher_sha3_256.h](0) defined the hasher to compute the SHA3-256 of a given
message.

## hasher_sha3_384.h

The [hasher_sha3_384.h](0) defined the hasher to compute the SHA3-384 of a given
message.

## hasher_sha3_512.h

The [hasher_sha3_512.h](0) defined the hasher to compute the SHA3-512 of a given
message.

## hex.h

The [hex.h](0) defines functions to needed to print/dump data in hexadecimal.

## hlookup.h

The [hlookup.h](0) defines the needed functions to compute fast lookup hashes.
Those hashes are aimed to be used in hash table lookups, *not* for cryptographic
purposes.

## hmac.h

The [hmac.h](0) defines the required functions to compute HMACs of messages.

## hmap.h

The [hmap.h](0) defines the needed functions to work with hash tables.

## int.h

The [int.h](0) defines some integers types.

## loadopt.h

The [loadopt.h](0) defines functions to parse options from command-line, and
optionally configuration file.

## memxor.h

The [memxor.h](0) defines the required functions to XOR memory areas.

## nextsplit.h

The [nextsplit.h](0) defines functions to determine the next split for
variable-length chunks in a data stream.

## obuffer.h

The [obuffer.h](0) defines required functions to write on output buffers.
An output buffer is simply a wrapper around a buffer (from [buffer.h](0)), with
a level to only receive data from the same level or lower. Refer to
[obuffer_level](3) for more.

Additionally it is possible to attach one output buffer to another, thusly
forming a /chain/. Whenever sending data to any buffer in the chain, it will be
sent to all output buffers in the chain. Refer to [obuffer_attach](3) for more.

## output.h

The [output.h](0) defines functions used to write messages/warnings to stdout or
stderr.

Most of the following are implemented as macros to [obuffer_putmsg](3), using
either *obuffer_1* or *obuffer_2*. Messages can also end up written to other
output buffers if they were attached. For more, refer to [obuffer.h](0).

## parseopt.h

The [parseopt.h](0) defines functions to parse command-line options.

## patrim.h

The [patrim.h](0) defines functions used to encode/decode data in [patrim](5)
format.

## pbkdf2.h

The [pbkdf2.h](0) defines the required functions to derive a key from a password
via PBKDF2.

## poly1305.h

The [poly1305.h](0) defines the required function to compute Poly1305-based MAC
of messages.

## posixplz.h

The [posixplz.h](0) defines functions that aren't but maybe should be in POSIX.

## random.h

The [random.h](0) defines the helper functions to gather pseudo-random data.

## readopt.h

The [readopt.h](0) defines the needed functions to read options from
configuration dirctories.

## samisc.h

The [samisc.h](0) defines some helper functions when working with *stralloc*.

## sha3.h

The [sha3.h](0) defines the required function to compute the SHA3 hash of a
given block of data.

## shldata.h

The [shldata.h](0) defines functions used to encrypt/decrypt data using the
"shielded data" protocol. Refer to [shldata](5) for more.

## shldata-rw.h

The [shldata-rw.h](0) defines helpers functions used to read/write shielded data
files, as per [shldata](5).

## siovec.h

The [siovec.h](0) defines the needed functions to manipulate vectors (i.e.
`struct iovec`) containing range of bytes in similar manner as byte arrays.

## stralloc.h

The [stralloc.h](0) defines functions to work heap-allocated memory.

## term.h

The [term.h](0) defines helper functions to interact with a terminal.

## u16.h

The [u16.h](0) defines functions allowing to work with 16bit unsigned integers.

## u32.h

The [u32.h](0) defines functions allowing to work with 32bit unsigned integers.

## u64.h

The [u64.h](0) defines functions allowing to work with 64bit unsigned integers.


<inc author.md>

# REPOSITORY

You can find the latest about *limb* from its official site at https://lila.oss/limb
Latest source code can be browsed online at https://lila.oss/code/limb ; or you can clone its
[git](1) repo from git://lila.oss/limb.git

<inc bugs.md>