Fixed a bug in stdredir.
[ashd.git] / lib / req.h
CommitLineData
33733396
FT
1#ifndef _LIB_HTREQ_H
2#define _LIB_HTREQ_H
3
5fc1bf9f
FT
4#include <stdio.h>
5
41213112
FT
6struct hthead {
7 char *method, *url, *ver, *msg;
8 int code;
9 char *rest;
33733396
FT
10 char ***headers;
11 int noheaders;
12};
13
41213112
FT
14struct hthead *mkreq(char *method, char *url, char *ver);
15struct hthead *mkresp(int code, char *msg, char *ver);
16void freehthead(struct hthead *head);
17char *getheader(struct hthead *head, char *name);
18void headpreheader(struct hthead *head, const char *name, const char *val);
19void headappheader(struct hthead *head, const char *name, const char *val);
af34331c 20int sendreq(int sock, struct hthead *req, int fd);
41213112 21int recvreq(int sock, struct hthead **reqp);
9e9eca79 22void replrest(struct hthead *head, char *rest);
5fc1bf9f
FT
23int parseheaders(struct hthead *head, FILE *in);
24int writeresp(FILE *out, struct hthead *resp);
33733396
FT
25
26#endif