Subversion Repositories Tewi

Rev

Rev 43 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 nishi 1
/* $Id: tw_http.h 140 2024-09-23 11:31:18Z nishi $ */
2
 
3
#ifndef __TW_HTTP_H__
4
#define __TW_HTTP_H__
5
 
140 nishi 6
#ifdef __cplusplus
7
extern "C" {
8
#endif
9
 
20 nishi 10
#include <stdbool.h>
11
 
43 nishi 12
#include "../config.h"
13
 
16 nishi 14
struct tw_http_request {
15
	char* method;
16
	char* path;
20 nishi 17
	char* query;
16 nishi 18
	char* version;
19
	char** headers;
20
	char* body;
21
};
22
 
23
struct tw_http_response {
24
	char** headers;
20 nishi 25
	int status;
26
	bool _processed; /* Internal parameter */
16 nishi 27
};
28
 
29
#ifdef SOURCE
43 nishi 30
#ifndef NO_SSL
16 nishi 31
#include <openssl/ssl.h>
43 nishi 32
#endif
32 nishi 33
void tw_free_request(struct tw_http_request* req);
43 nishi 34
#ifndef NO_SSL
16 nishi 35
int tw_http_parse(SSL* ssl, int sock, struct tw_http_request* req);
43 nishi 36
#else
37
int tw_http_parse(void* ssl, int sock, struct tw_http_request* req);
16 nishi 38
#endif
43 nishi 39
#endif
16 nishi 40
 
140 nishi 41
#ifdef __cplusplus
42
}
16 nishi 43
#endif
140 nishi 44
 
45
#endif