7 char *dupcat(char *s1, ...);
9 struct bufchain_granule;
10 typedef struct bufchain_tag {
11 struct bufchain_granule *head, *tail;
12 int buffersize; /* current amount of buffered data */
15 void bufchain_init(bufchain *ch);
16 void bufchain_clear(bufchain *ch);
17 int bufchain_size(bufchain *ch);
18 void bufchain_add(bufchain *ch, void *data, int len);
19 void bufchain_prefix(bufchain *ch, void **data, int *len);
20 void bufchain_consume(bufchain *ch, int len);
23 * Debugging functions.
25 * Output goes to debug.log
27 * debug(()) (note the double brackets) is like printf().
29 * dmemdump() and dmemdumpl() both do memory dumps. The difference
30 * is that dmemdumpl() is more suited for when where the memory is is
31 * important (say because you'll be recording pointer values later
32 * on). dmemdump() is more concise.
36 void dprintf(char *fmt, ...);
37 void debug_memdump(void *buf, int len, int L);
38 #define debug(x) (dprintf x)
39 #define dmemdump(buf,len) debug_memdump (buf, len, 0);
40 #define dmemdumpl(buf,len) debug_memdump (buf, len, 1);
43 #define dmemdump(buf,len)
44 #define dmemdumpl(buf,len)
49 #define lenof(x) ( (sizeof((x))) / (sizeof(*(x))))