Binary Data

Binary data is managed using BIN. A BIN can be created using:

#include <c-craft/bin.h>

size_t len = 64;
unsigned char *data = sm_alloc(mem, len):

BIN bin = bin_create(mem, data, len);

Data can be retrieved from a BIN using:

unsigned char *data = bin_data(bin);
size_t len = bin_len(bin);

The only reason that BIN is useful is so that functions may return a complete definition of a block of binary data. Always unpack and work directly with the data and its length.