#ifndef COOKIES_H #define COOKIES_H #define COOKIE_LL_NEW(x) { \ if (x == NULL) \ x = xmalloc(sizeof(struct COOKIE_LIST_LIST)); \ else { \ while (x->next != NULL) x = x->next; \ x->next = xmalloc(sizeof(struct COOKIE_LIST_LIST)); \ x = x->next; \ } \ x->he = NULL; \ x->host = NULL; \ x->direction = COOKIE_BOTH; \ x->next = NULL; \ }; #define COOKIE_LL_INSERT(x, a, b) { \ if (a != NULL) { \ if (!strcasecmp(a, "in")) \ x->direction = COOKIE_IN; \ else if (!strcasecmp(a, "out")) \ x->direction = COOKIE_OUT; \ else if (!strcasecmp(a, "both")) \ x->direction = COOKIE_BOTH; \ } \ if (b != NULL && x->he == NULL) { \ x->he = reg_compile(b, REGFLAGS | REG_NOSUB); \ x->host = xstrdup(b); \ } \ }; #endif /* COOKIES_H */