]> git.ozlabs.org Git - ccan/blob - tools/_infotojson/utils.h
libccan.a: simple way to use all of ccan.
[ccan] / tools / _infotojson / utils.h
1 #include <stdarg.h>
2 #include <stdbool.h>
3 #include <string.h>
4
5
6 #define new_array(type, num) realloc_array((type *)0, (num))
7 #define realloc_array(ptr, num) ((__typeof__(ptr))_realloc_array((ptr), sizeof((*ptr)), (num)))
8
9 void *realloc_nofail(void *ptr, size_t size);
10
11 void *_realloc_array(void *ptr, size_t size, size_t num);
12
13 void * palloc(int size);
14
15 char *aprintf(const char *fmt, ...);
16
17 void strreplace(char * str, char src, char dest);