ucx/utils.h

changeset 223
e18884bbad48
parent 222
e0f850709a5c
child 224
f9ba63fc6a80
equal deleted inserted replaced
222:e0f850709a5c 223:e18884bbad48
241 * @param ... additional arguments 241 * @param ... additional arguments
242 * @return a sstr_t containing the formatted string 242 * @return a sstr_t containing the formatted string
243 */ 243 */
244 sstr_t ucx_asprintf(UcxAllocator *allocator, const char *fmt, ...); 244 sstr_t ucx_asprintf(UcxAllocator *allocator, const char *fmt, ...);
245 245
246 /** Shortcut for ucx_asprintf() with default allocator. */
247 #define ucx_sprintf(fmt, ...) \
248 ucx_asprintf(ucx_default_allocator(), fmt, __VA_ARGS__)
249
250 /** 246 /**
251 * <code>va_list</code> version of ucx_asprintf(). 247 * <code>va_list</code> version of ucx_asprintf().
252 * 248 *
253 * @param allocator the UcxAllocator used for allocating the result sstr_t 249 * @param allocator the UcxAllocator used for allocating the result sstr_t
254 * @param fmt format string 250 * @param fmt format string
255 * @param ap argument list 251 * @param ap argument list
256 * @return a sstr_t containing the formatted string 252 * @return a sstr_t containing the formatted string
257 * @see ucx_asprintf() 253 * @see ucx_asprintf()
258 */ 254 */
259 sstr_t ucx_vasprintf(UcxAllocator *allocator, const char *fmt, va_list ap); 255 sstr_t ucx_vasprintf(UcxAllocator *allocator, const char *fmt, va_list ap);
256
257 /** Shortcut for ucx_asprintf() with default allocator. */
258 #define ucx_sprintf(...) \
259 ucx_asprintf(ucx_default_allocator(), __VA_ARGS__)
260 260
261 /** 261 /**
262 * A <code>printf()</code> like function which writes the output to an 262 * A <code>printf()</code> like function which writes the output to an
263 * UcxBuffer. 263 * UcxBuffer.
264 * 264 *

mercurial