Internal Document
Caution: These functions are not intended to used by the library’s user, so the interface may be changed without announcement.
Here is an incomplete list of internal functions. Not every function will be documented.
sxg_buffer internals
You can use these functions by adding #include <libsxg/internal/sxg_buffer.h>
.
You should not use these functions unless you know what you are doing.
bool sxg_write_cbor_header(size_t length, sxg_buffer_t* target)
Appends the CBOR header for a byte string (exposed for test).
Arguments
length
: Length of the byte string whose header to write.target
: Buffer to be modified.
Returns
Returns true
on success.
On fail, target
will not be changed.
bool sxg_write_bytes_cbor(const uint8_t* bytes, size_t length, sxg_buffer_t* target)
Appends a byte string encoded in CBOR. Returns true
on success.
Arguments
bytes
: Pointer to binary array data to write.length
: Length of binary array data to write.target
: Buffer to be modified.
Returns
Returns true
on success.
On fail, target
may be changed(only the header may be written).