12 buf_double(char* buf, int size)
14 buf = realloc(buf, 2*size);
24 new_header(char* buf, struct hlist* end)
29 new = xmalloc(sizeof(struct hlist));
37 new->value = xstrdup("");
40 new->value = xstrdup(p+1);
42 new->name = xstrdup(buf);
51 struct hlist* start = NULL, *end = NULL;
53 int i = 0; /* current position */
56 buf = xmalloc(BUFSIZE);
59 while ((c = getchar()) != EOF){
63 if (i >= curbufsize-2){
64 buf = buf_double(buf, curbufsize);
72 if ((c = getchar())!=' ' && c!='\t'){
76 end = new_header(buf, end);
90 print_headers(struct hlist* h)
95 printf("%s:%s",p->name,p->value);
101 do_action(struct action* a)
103 puts("--do action--");
112 puts("with email\n");
113 print_headers(a->e.headers);
114 puts("\n--Muhehehechlemst!--\n");