limb 0.2.0

2024-01-09

sa_patrim_put(3)
limb manual
sa_patrim_put(3)

NAME

sa_patrim_put - encode data in PATRIM format into an stralloc

SYNOPSIS

#include <limb/samisc.h>
int sa_patrim_put(stralloc *sa, u64 id, u64 u, const char *data)

DESCRIPTION

The sa_patrim_put() function will encode into the given stralloc sa the specified id in patrim(5) format.

If it represents an (unsigned) integer, u must be its value, and data is ignored.

If it represents a blob/byte array, u must be its size, and data point to said data (of length u).

RETURN VALUE

The sa_patrim_put() function returns 1 on success and 0 on failure, i.e. failure to allocate memory within the given sa.

limb 0.1.0
2023-07-24
sa_patrim_put(3)