utils.h 441 B

1234567891011121314151617
  1. #include <stdarg.h>
  2. #include <stdbool.h>
  3. #include <string.h>
  4. #define new_array(type, num) realloc_array((type *)0, (num))
  5. #define realloc_array(ptr, num) ((__typeof__(ptr))_realloc_array((ptr), sizeof((*ptr)), (num)))
  6. void *realloc_nofail(void *ptr, size_t size);
  7. void *_realloc_array(void *ptr, size_t size, size_t num);
  8. void * palloc(int size);
  9. char *aprintf(const char *fmt, ...);
  10. void strreplace(char * str, char src, char dest);