1BSTR_PRINTF(9) Basic C Library Functions BSTR_PRINTF(9)
2
3
4
6 bstr_printf - Format a string from binary arguments and place it in a
7 buffer
8
10 int bstr_printf(char * buf, size_t size, const char * fmt,
11 const u32 * bin_buf);
12
14 buf
15 The buffer to place the result into
16
17 size
18 The size of the buffer, including the trailing null space
19
20 fmt
21 The format string to use
22
23 bin_buf
24 Binary arguments for the format string
25
27 This function like C99 vsnprintf, but the difference is that vsnprintf
28 gets arguments from stack, and bstr_printf gets arguments from bin_buf
29 which is a binary buffer that generated by vbin_printf.
30
31 The format follows C99 vsnprintf, but has some extensions: see
32 vsnprintf comment for details.
33
34 The return value is the number of characters which would be generated
35 for the given input, excluding the trailing '\0', as per ISO C99. If
36 you want to have the exact number of characters written into buf as
37 return value (not including the trailing '\0'), use vscnprintf. If the
38 return is greater than or equal to size, the resulting string is
39 truncated.
40
42Kernel Hackers Manual 3.10 June 2019 BSTR_PRINTF(9)