12 new_header(char* buf, struct list* h)
17 new = xmalloc(sizeof(struct hlist));
21 new->value = xstrdup("");
24 new->value = xstrdup(p+1);
26 new->name = xstrdup(buf);
28 list_add_last(h, &new->car);
34 struct list* l = xmalloc(sizeof(struct list));
36 int i = 0; /* current position */
40 buf = xmalloc(BUFSIZE);
43 while ((c = getchar()) != EOF){
47 if (i >= curbufsize-2)
48 buf = xrealloc(buf, curbufsize *= 2);
54 if ((c = getchar()) != ' ' && c != '\t'){
75 int curbufsize = BUFSIZE;
77 buf = xmalloc(BUFSIZE);
78 while ((c = getchar()) != EOF){
81 if (i >= curbufsize - 1)
82 buf = xrealloc(buf, curbufsize *= 2);
91 print_headers(struct list* l)
96 printf("%s:%s",p->name,p->value);
100 do_action(struct action* a)
102 //just deliver e-mail, do not look at left side now
105 } else if (!strcmp(a->r,"pipe")){