typedef struct { int strlen; } STRING; #define MINLEN 4096 #define STRTOCHAR(a) ((char *)(a) + sizeof(STRING)) #define STRTOCHARN(a, n) (*((char *)(a) + sizeof(STRING) + (n))) #define STRCURSIZE(a) (sizeof(STRING) + (a)->strlen + 1) #define STRLENGTH(a) ((a)->strlen) STRING *string_new(void); void string_cat(STRING **s, char *catstr, int len); void string_clear(STRING **s); void string_dropfront(STRING **s, int nchars); void string_catvprintf(STRING **s, int len, char *format, va_list ap); void string_catprintf(STRING **s, char *format, ...); void string_filterbadchars_telnet(STRING **s, int start); void string_filterbadchars_unix(STRING **s, int start);