Commit | Line | Data |
---|---|---|
33733396 FT |
1 | #ifndef _LIB_HTREQ_H |
2 | #define _LIB_HTREQ_H | |
3 | ||
41213112 FT |
4 | struct hthead { |
5 | char *method, *url, *ver, *msg; | |
6 | int code; | |
7 | char *rest; | |
33733396 FT |
8 | char ***headers; |
9 | int noheaders; | |
10 | }; | |
11 | ||
41213112 FT |
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); | |
33733396 FT |
20 | |
21 | #endif |