pub unsafe extern "C" fn ruby_snprintf(
str_: *mut c_char,
n: size_t,
fmt: *const c_char,
...
) -> c_intExpand description
Our own locale-insensitive version of snprintf(3). It can also be seen as
a routine identical to rb_sprintf, except it writes back to the passed
buffer instead of allocating a new Ruby object.
§@param[out] str Return buffer
@param[in] n Number of bytes of str.
@param[in] fmt A printf-like format specifier.
@param[in] … Variadic number of contents to format.
@return Number of bytes that would have been written to str, if n
was large enough. Comparing this to n can give you insights
that the buffer is too small or too big. Especially passing 0
to n gives you the exact number of bytes necessary to hold
the result string without writing anything to anywhere.
@post str holds up to n-1 bytes of formatted contents (and the
terminating NUL character.)
Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3