Function gnunet_sys::GNUNET_STRINGS_buffer_fill[][src]

pub unsafe extern "C" fn GNUNET_STRINGS_buffer_fill(
    buffer: *mut c_char,
    size: usize,
    count: c_uint,
     ...
) -> usize

Fill a buffer of the given size with count 0-terminated strings (given as varargs). If “buffer” is NULL, only compute the amount of space required (sum of “strlen(arg)+1”).

Unlike using “snprintf” with “%s”, this function will add 0-terminators after each string. The “GNUNET_string_buffer_tokenize” function can be used to parse the buffer back into individual strings.

@param buffer the buffer to fill with strings, can be NULL in which case only the necessary amount of space will be calculated @param size number of bytes available in buffer @param count number of strings that follow @param … count 0-terminated strings to copy to buffer @return number of bytes written to the buffer (or number of bytes that would have been written)