axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
int axl_stream_printf_buffer ( char *  buffer,
int  buffer_size,
int *  real_size,
const char *  format,

Allows to perform a printf operation on the provided buffer (which must be allocated by the caller, and its size signaled by buffer_size).

bufferThe already allocated buffer to hold the result.
buffer_sizeThe size of the buffer provided.
real_sizeOptional reference where the real space required to hold the content will be placed. In cases where the content is enough small to hold in the buffer, this value will contain the same value as returned by the function. In the case the buffer provide can't hold all the content, the function will return at maximum (buffer_size - 1) bytes written, that is, all content that was possible to be included plus a trailing \0 to terminate the string, and, if defined real_size variable, it will contain the space that will be required.
formatThe printf like format to use to create the content to be placed at the buffer provided.
The amount of bytes written. The function will return at maximum buffer_size - 1 bytes written. Use real_size variable to check if the function was able to write all content (if real_size == value returned).

References axl_stream_vprintf_len().