#ifndef HEADER_H #define HEADER_H #define HEADER_LIST_INSERT(x, a, b) { \ if (x == NULL) \ x = xmalloc(sizeof(struct HTTP_HEADER_LIST)); \ else { \ while (x->next != NULL) x = x->next; \ x->next = xmalloc(sizeof(struct HTTP_HEADER_LIST)); \ x = x->next; \ } \ x->next = NULL; \ x->type =xstrdup(a); \ x->value = xstrdup(b); \ }; #define HEADER_LL_NEW(x) { \ if (x == NULL) \ x = xmalloc(sizeof(struct HEADER_LIST_LIST)); \ else { \ while (x->next != NULL) x = x->next; \ x->next = xmalloc(sizeof(struct HEADER_LIST_LIST)); \ x = x->next; \ } \ x->te = NULL; \ x->ve = NULL; \ x->he = NULL; \ x->type = NULL; \ x->value = NULL; \ x->next = NULL; \ }; #define HEADER_LL_INSERT(x, a, b, c) { \ if (a != NULL && x->te == NULL) { \ x->te = reg_compile(a, REGFLAGS | REG_NOSUB); \ x->type = xstrdup(a); \ } \ if (b != NULL && x->ve == NULL) { \ x->ve = reg_compile(b, REGFLAGS | REG_NOSUB); \ x->value = xstrdup(b); \ } \ if (c != NULL && x->he == NULL) { \ x->he = reg_compile(c, REGFLAGS | REG_NOSUB); \ x->host = xstrdup(c); \ } \ }; #endif /* HEADER_H */