/[osn-commons]/trunk/freehttpd/request.h
ViewVC logotype

Annotation of /trunk/freehttpd/request.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (hide annotations)
Mon Aug 12 16:55:32 2024 UTC (7 months, 2 weeks ago) by rakinar2
File MIME type: text/x-c
File size: 1573 byte(s)
feat(freehttpd): better error handling
1 rakinar2 44 #ifndef FREEHTTPD_REQUEST_H
2     #define FREEHTTPD_REQUEST_H
3    
4     #include "freehttpd.h"
5     #include <stdbool.h>
6     #include <stddef.h>
7    
8     typedef struct freehttpd_header
9     {
10     char *name;
11     char *value;
12 rakinar2 45 size_t name_length;
13     size_t value_length;
14 rakinar2 44 } freehttpd_header_t;
15    
16     typedef struct freehttpd_request
17     {
18     char *method;
19     size_t method_length;
20     char *uri;
21     size_t uri_length;
22 rakinar2 45 char *path;
23     size_t path_length;
24     char *query;
25     size_t query_length;
26 rakinar2 44 char *version;
27     size_t version_length;
28     freehttpd_header_t **headers;
29     size_t headers_count;
30     char *body;
31     size_t body_length;
32     } freehttpd_request_t;
33    
34     freehttpd_request_t *freehttpd_request_init (const char *method,
35     const char *uri,
36     const char *version);
37     void freehttpd_request_free (freehttpd_request_t *request);
38     freehttpd_request_t *freehttpd_request_parse (freehttpd_t *freehttpd,
39     int sockfd, ecode_t *error);
40    
41 rakinar2 45 freehttpd_header_t *freehttpd_header_init (const char *name, const char *value,
42     size_t name_length,
43     size_t value_length);
44 rakinar2 46 freehttpd_header_t freehttpd_header_init_stack (const char *name,
45     const char *value,
46     size_t name_length,
47     size_t value_length);
48 rakinar2 45 void freehttpd_header_free (freehttpd_header_t *header);
49    
50 rakinar2 44 #endif

team@onesoftnet.eu.org
ViewVC Help
Powered by ViewVC 1.1.26