limb 0.2.0

2024-01-09

buffer_puthex(3)
limb manual
buffer_puthex(3)

NAME

buffer_puthex - write byte array content as hexadecimal dump into buffer

SYNOPSIS

#include <limb/buffer.h>
ssize_t buffer_puthex(buffer *buf, const void *data, size_t dlen, int options)

DESCRIPTION

The buffer_puthex() function will write the content of byte array pointed to by data of length dlen into the buffer buf as an hexadecimal dump, i.e. every byte's value will be written out in 2-character hexadecimal form.

Additionally, it is possible to specify some flags in options to affect the output, adding spaces and/or newlines. Refer to hexall_fmt(3) for more.

RETURN VALUE

The buffer_puthex() function returns the number of bytes written into buf on success. Otherwise, it returns -1 and sets errno to indicate the error.

ERRORS

The buffer_puthex() function may fail and set errno for any of the errors specified for buffer_put(3).

limb 0.1.0
2023-07-24
buffer_puthex(3)