comparison src/core/ngx_config_file.h @ 40:d5d4f3bba6f0

nginx-0.0.1-2002-12-26-10:24:21 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 26 Dec 2002 07:24:21 +0000
parents 83fa61cd3d2f
children 59e7c7f30d49
comparison
equal deleted inserted replaced
39:83fa61cd3d2f 40:d5d4f3bba6f0
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_files.h> 6 #include <ngx_files.h>
7 #include <ngx_log.h> 7 #include <ngx_log.h>
8 #include <ngx_file.h> 8 #include <ngx_file.h>
9 #include <ngx_string.h>
9 #include <ngx_alloc.h> 10 #include <ngx_alloc.h>
10 #include <ngx_hunk.h> 11 #include <ngx_hunk.h>
11 #include <ngx_array.h> 12 #include <ngx_array.h>
13
12 14
13 #define NGX_CONF_NOARGS 1 15 #define NGX_CONF_NOARGS 1
14 #define NGX_CONF_TAKE1 2 16 #define NGX_CONF_TAKE1 2
15 #define NGX_CONF_TAKE2 4 17 #define NGX_CONF_TAKE2 4
16 18
17 #define NGX_CONF_ITERATE 0 19 #define NGX_CONF_ITERATE 0
18 20
19 #define NGX_CONF_UNSET -1 21 #define NGX_CONF_UNSET -1
20 22
21 23
22 #define NGX_BLOCK_DONE 1 24 #define NGX_CONF_BLOCK_DONE 1
23 #define NGX_FILE_DONE 2 25 #define NGX_CONF_FILE_DONE 2
26
27
28 typedef struct ngx_conf_s ngx_conf_t;
29
30
31 typedef struct {
32 ngx_str_t name;
33 char *(*set)(ngx_conf_t *cf);
34 int offset;
35 int zone;
36 int type;
37 } ngx_command_t;
38
39
40 typedef struct {
41 void *ctx;
42 ngx_command_t *commands;
43 int type;
44 int (*init_module)(ngx_pool_t *p);
45 } ngx_module_t;
24 46
25 47
26 typedef struct { 48 typedef struct {
27 ngx_file_t file; 49 ngx_file_t file;
28 ngx_hunk_t *hunk; 50 ngx_hunk_t *hunk;
29 int line; 51 int line;
30 } ngx_conf_file_t; 52 } ngx_conf_file_t;
31 53
32 typedef struct ngx_conf_s ngx_conf_t; 54
33 struct ngx_conf_s { 55 struct ngx_conf_s {
34 char *name; 56 char *name;
35 ngx_array_t *args; 57 ngx_array_t *args;
36 58
37 ngx_pool_t *pool; 59 ngx_pool_t *pool;
38 ngx_conf_file_t *conf_file; 60 ngx_conf_file_t *conf_file;
39 ngx_log_t *log; 61 ngx_log_t *log;
40 62
63 ngx_module_t *modules;
64
41 void *ctx; 65 void *ctx;
42 int (*handler)(ngx_conf_t *cf); 66 int (*handler)(ngx_conf_t *cf);
43 }; 67 };
44 68
45 69
46 70 int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
47 typedef struct {
48 char *name;
49 char *(*set)();
50 int offset;
51 int zone;
52 int type;
53 char *description;
54 } ngx_command_t;
55 71
56 72
57 int ngx_conf_read_token(ngx_conf_t *cf); 73 char *ngx_conf_set_size_slot(ngx_conf_t *cf);
58
59
60 char *ngx_conf_set_size_slot(char *conf, int offset, char *value);
61 char *ngx_conf_set_time_slot(char *conf, int offset, char *value);
62 74
63 75
64 #endif _NGX_HTTP_CONFIG_FILE_H_INCLUDED_ 76 #endif _NGX_HTTP_CONFIG_FILE_H_INCLUDED_