Renamed htreq to hthead and added functions for transfer of requests.
[ashd.git] / lib / req.h
1 #ifndef _LIB_HTREQ_H
2 #define _LIB_HTREQ_H
3
4 struct hthead {
5     char *method, *url, *ver, *msg;
6     int code;
7     char *rest;
8     char ***headers;
9     int noheaders;
10 };
11
12 struct hthead *mkreq(char *method, char *url, char *ver);
13 struct hthead *mkresp(int code, char *msg, char *ver);
14 void freehthead(struct hthead *head);
15 char *getheader(struct hthead *head, char *name);
16 void headpreheader(struct hthead *head, const char *name, const char *val);
17 void headappheader(struct hthead *head, const char *name, const char *val);
18 int sendreq(int sock, struct hthead *req);
19 int recvreq(int sock, struct hthead **reqp);
20
21 #endif