root/cherokee/trunk/cherokee/config_entry.h

Revision 2193, 3.0 kB (checked in by alo, 2 months ago)

--

Line 
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* Cherokee
4  *
5  * Authors:
6  *      Alvaro Lopez Ortega <alvaro@alobbs.com>
7  *
8  * Copyright (C) 2001-2008 Alvaro Lopez Ortega
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of version 2 of the GNU General Public
12  * License as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  */
24
25 #if !defined (CHEROKEE_INSIDE_CHEROKEE_H) && !defined (CHEROKEE_COMPILATION)
26 # error "Only <cherokee/cherokee.h> can be included directly, this file may disappear or change contents."
27 #endif
28
29 #ifndef CHEROKEE_CONFIG_ENTRY_H
30 #define CHEROKEE_CONFIG_ENTRY_H
31
32 #include "common.h"
33
34 #include <time.h>
35
36 #include "avl.h"
37 #include "handler.h"
38 #include "http.h"
39 #include "validator.h"
40
41 #define CHEROKEE_CONFIG_PRIORITY_NONE    0
42 #define CHEROKEE_CONFIG_PRIORITY_DEFAULT 1
43
44 typedef enum {
45         cherokee_expiration_none,
46         cherokee_expiration_epoch,
47         cherokee_expiration_max,
48         cherokee_expiration_time
49 } cherokee_expiration_t;
50
51 typedef struct {
52         /* Properties
53          */
54         cherokee_buffer_t          *document_root;
55         cherokee_boolean_t          only_secure;
56         void                       *access;
57
58         /* Handler
59          */
60         handler_func_new_t          handler_new_func;
61         cherokee_http_method_t      handler_methods;
62         cherokee_module_props_t    *handler_properties;
63
64         /* Validator
65          */
66         validator_func_new_t        validator_new_func;
67         cherokee_module_props_t    *validator_properties;
68
69         cherokee_buffer_t          *auth_realm;
70         cherokee_http_auth_t        authentication;
71         cherokee_avl_t             *users;
72
73         /* Headers
74          */
75         cherokee_expiration_t       expiration;
76         time_t                      expiration_time;
77
78         /* Encoding
79          */
80         cherokee_avl_t             *encoders;
81
82 } cherokee_config_entry_t;
83
84 #define CONF_ENTRY(x) ((cherokee_config_entry_t *)(x))
85
86
87 ret_t cherokee_config_entry_new      (cherokee_config_entry_t **entry);
88 ret_t cherokee_config_entry_free     (cherokee_config_entry_t  *entry);
89 ret_t cherokee_config_entry_init     (cherokee_config_entry_t  *entry);
90 ret_t cherokee_config_entry_mrproper (cherokee_config_entry_t  *entry);
91
92 ret_t cherokee_config_entry_add_encoder (cherokee_config_entry_t *entry, cherokee_buffer_t *name, cherokee_plugin_info_t *plugin_info);
93 ret_t cherokee_config_entry_set_handler (cherokee_config_entry_t *entry, cherokee_plugin_info_handler_t *plugin_info);
94 ret_t cherokee_config_entry_complete    (cherokee_config_entry_t *entry, cherokee_config_entry_t *source);
95
96 ret_t cherokee_config_entry_print       (cherokee_config_entry_t *entry);
97
98 #endif /* CHEROKEE_CONFIG_ENTRY_H */
Note: See TracBrowser for help on using the browser.