11 static char* //TODO: rewrite
12 buf_double(char* buf, int size)
14 buf = realloc(buf, 2*size);
24 new_header(char* buf, struct list* h)
29 new = xmalloc(sizeof(struct hlist));
33 new->value = xstrdup("");
36 new->value = xstrdup(p+1);
38 new->name = xstrdup(buf);
40 list_add_last(h, &new->car);
46 struct list* l = xmalloc(sizeof(struct list));
48 int i = 0; /* current position */
52 buf = xmalloc(BUFSIZE);
55 while ((c = getchar()) != EOF){
59 if (i >= curbufsize-2){
60 buf = buf_double(buf, curbufsize);
68 if ((c = getchar())!=' ' && c!='\t'){
84 print_headers(struct list* l)
89 printf("%s:%s",p->name,p->value);
93 do_action(struct action* a)
95 puts("--do action--");
104 puts("with email\n");
105 print_headers(a->e.headers);
106 puts("\n--Muhehehechlemst!--\n");