7 struct list
{ void *el
; struct list
*tail
; };
8 struct list
*list_cons(void *el
, struct list
*tail
);
9 void list_free(struct list
*head
, void (*freefun
)(void *));
10 void **list_to_array(struct list
*list
, int *num
, bool reverse
);
11 int list_length(struct list
*head
);
13 void die(const char *msg
, ...);
14 void pdie(const char *msg
);
16 /* if buf == NULL, a fresh buffer is allocated */
17 char *escape_char(char c
, char *buf
, bool str
);
18 /* unescaped character will be in position 0 and the rest from position 1 on */
19 char *unescape_char(char *c
);
20 /* Remove the last and first character from the string */
21 char *trimquotes(char *c
);
22 void pindent(int indent
, FILE *out
);
24 void safe_fprintf(FILE *out
, const char *msg
, ...);
25 void *safe_malloc(size_t size
);
26 void *safe_strdup(const char *c
);