1 |
#ifndef FREEHTTPD_HTTP_ERROR_H |
2 |
#define FREEHTTPD_HTTP_ERROR_H |
3 |
|
4 |
#include "response.h" |
5 |
#include <stddef.h> |
6 |
|
7 |
#define FREEHTTPD_ERRDOC_INITIALIZER { 0, NULL, 0 } |
8 |
|
9 |
typedef struct freehttpd_errdoc |
10 |
{ |
11 |
freehttpd_status_t status; |
12 |
const char *document; |
13 |
size_t document_length; |
14 |
bool auto_free; |
15 |
} freehttpd_errdoc_t; |
16 |
|
17 |
typedef struct freehttpd_errdoc_tbl |
18 |
{ |
19 |
freehttpd_errdoc_t *errdocs; |
20 |
size_t errdocs_count; |
21 |
size_t errdocs_cap; |
22 |
} freehttpd_errdoc_tbl_t; |
23 |
|
24 |
const freehttpd_errdoc_t * |
25 |
freehttpd_error_document_get (freehttpd_errdoc_tbl_t *errdoc_tbl, |
26 |
freehttpd_status_t status); |
27 |
freehttpd_errdoc_t * |
28 |
freehttpd_error_document_set (freehttpd_errdoc_tbl_t *errdoc_tbl, |
29 |
freehttpd_status_t status, const char *document, |
30 |
size_t document_length); |
31 |
freehttpd_errdoc_tbl_t *freehttpd_error_document_tbl_init (void); |
32 |
void freehttpd_error_document_tbl_free (freehttpd_errdoc_tbl_t *errdoc_tbl); |
33 |
void |
34 |
freehttpd_error_document_load_defaults (freehttpd_errdoc_tbl_t *errdoc_tbl); |
35 |
|
36 |
#endif /* FREEHTTPD_HTTP_ERROR_H */ |