docs/Writerside/topics/printf.h.md

changeset 1694
a2757c6427cc
parent 1424
563033aa998c
equal deleted inserted replaced
1693:c2d05cf1a062 1694:a2757c6427cc
51 51
52 cxmutstr cx_vasprintf_a(const CxAllocator *allocator, 52 cxmutstr cx_vasprintf_a(const CxAllocator *allocator,
53 const char *fmt, va_list ap); 53 const char *fmt, va_list ap);
54 ``` 54 ```
55 55
56 The `cx_asprintf()` and `cx_asprintf_a()` functions print the formatted output directly to a freshly allocated 56 The `cx_asprintf()` and `cx_asprintf_a()` functions print the formatted output directly to a freshly allocated string,
57 string which is then returned from the function. 57 which is then returned from the function.
58 On platforms (or when using allocators) where allocation can fail, 58 On platforms (or when using allocators) where allocation can fail,
59 the returned string may be empty and the `ptr` field set to `NULL`. 59 the returned string may be empty and the `ptr` field set to `NULL`.
60 60
61 The `cx_vasprintf()` and `cx_vasprintf_a()` functions are equivalent to `cx_asprintf()` and `cx_asprintf_a()`, 61 The `cx_vasprintf()` and `cx_vasprintf_a()` functions are equivalent to `cx_asprintf()` and `cx_asprintf_a()`,
62 except that instead of being called with a variable number of arguments, 62 except that instead of being called with a variable number of arguments,
120 120
121 ## Small Buffer Optimization 121 ## Small Buffer Optimization
122 122
123 All functions that allocate internal temporary memory use small buffer optimization to avoid a heap allocation 123 All functions that allocate internal temporary memory use small buffer optimization to avoid a heap allocation
124 if the expected string length is smaller than `cx_printf_sbo_size`. 124 if the expected string length is smaller than `cx_printf_sbo_size`.
125 This size cannot be changed at runtime, but modified by defining the `CX_PRINTF_SBO_SIZE` macro when [building](install.md#small-buffer-optimizations) the library. 125 This size cannot be changed at runtime but modified by defining the `CX_PRINTF_SBO_SIZE` macro when [building](install.md#small-buffer-optimizations) the library.
126 126
127 <seealso> 127 <seealso>
128 <category ref="apidoc"> 128 <category ref="apidoc">
129 <a href="https://ucx.sourceforge.io/api/printf_8h.html">printf.h</a> 129 <a href="https://ucx.sourceforge.io/api/printf_8h.html">printf.h</a>
130 </category> 130 </category>

mercurial