8 #define min(x, y) ((x)<(y)?(x):(y))
10 void die(const char *msg
, ...);
11 void pdie(const char *msg
);
13 /* if buf == NULL, a fresh buffer is allocated */
14 char *escape_char(char c
, char *buf
, bool str
);
15 /* unescaped character will be in position 0 and the rest from position 1 on */
16 char *unescape_char(char *c
);
17 /* Remove the last and first character from the string */
18 char *trimquotes(char *c
);
19 void pindent(int indent
, FILE *out
);
21 void safe_fprintf(FILE *out
, const char *msg
, ...);
22 void *safe_malloc(size_t size
);
23 void *safe_strdup(const char *c
);
24 FILE *safe_fopen(const char *path
, const char *mode
);
25 void safe_fclose(FILE *file
);