equal
deleted
inserted
replaced
11 * Returned buffer must be free()d |
11 * Returned buffer must be free()d |
12 */ |
12 */ |
13 char *flib_asprintf(const char *fmt, ...); |
13 char *flib_asprintf(const char *fmt, ...); |
14 |
14 |
15 /** |
15 /** |
16 * Exactly as flib_asprintf, but accepts va_args. |
16 * Exactly as flib_asprintf, but accepts a va_list. |
17 */ |
17 */ |
18 char *flib_vasprintf(const char *fmt, va_list args); |
18 char *flib_vasprintf(const char *fmt, va_list args); |
19 |
19 |
20 /** |
20 /** |
21 * Return a duplicate of the provided string, or NULL if an error |
21 * Return a duplicate of the provided string, or NULL if an error |
31 * |
31 * |
32 * Returned buffer must be free()d |
32 * Returned buffer must be free()d |
33 */ |
33 */ |
34 void *flib_bufdupnull(const void *buf, size_t size); |
34 void *flib_bufdupnull(const void *buf, size_t size); |
35 |
35 |
|
36 /** |
|
37 * Simple malloc wrapper that automatically logs an error if no memory |
|
38 * is available. Otherwise behaves exactly like malloc. |
|
39 */ |
|
40 void *flib_malloc(size_t size); |
|
41 |
|
42 /** |
|
43 * Simple calloc wrapper that automatically logs an error if no memory |
|
44 * is available. Otherwise behaves exactly like calloc. |
|
45 */ |
|
46 void *flib_calloc(size_t count, size_t elementsize); |
|
47 |
36 #endif |
48 #endif |