comparison src/core/ngx_conf_file.h @ 44:0e81ac0bb3e2

nginx-0.0.1-2003-01-09-08:36:00 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 09 Jan 2003 05:36:00 +0000
parents 53cd05892261
children f1ee46c036a4
comparison
equal deleted inserted replaced
43:53cd05892261 44:0e81ac0bb3e2
13 13
14 14
15 #define NGX_CONF_NOARGS 1 15 #define NGX_CONF_NOARGS 1
16 #define NGX_CONF_TAKE1 2 16 #define NGX_CONF_TAKE1 2
17 #define NGX_CONF_TAKE2 4 17 #define NGX_CONF_TAKE2 4
18 #define NGX_CONF_ARGS_NUMBER 0x0ffff 18 #define NGX_CONF_ARGS_NUMBER 0x00ffff
19 #define NGX_CONF_ANY 0x10000 19 #define NGX_CONF_ANY 0x010000
20 #define NGX_CONF_BLOCK 0x20000 20 #define NGX_CONF_BLOCK 0x020000
21 21
22 22
23 #define NGX_CONF_UNSET -1 23 #define NGX_CONF_UNSET -1
24 24
25 25
26 #define NGX_CONF_ERROR (char *) -1 26 #define NGX_CONF_OK NULL
27 #define NGX_CONF_ERROR (void *) -1
27 28
28 #define NGX_CONF_BLOCK_DONE 1 29 #define NGX_CONF_BLOCK_DONE 1
29 #define NGX_CONF_FILE_DONE 2 30 #define NGX_CONF_FILE_DONE 2
30 31
31 32
44 int offset; 45 int offset;
45 }; 46 };
46 47
47 48
48 typedef struct { 49 typedef struct {
50 int index;
49 void *ctx; 51 void *ctx;
50 ngx_command_t *commands; 52 ngx_command_t *commands;
51 int type; 53 int type;
52 int (*init_module)(ngx_pool_t *p); 54 int (*init_module)(ngx_pool_t *p);
53 } ngx_module_t; 55 } ngx_module_t;
68 ngx_conf_file_t *conf_file; 70 ngx_conf_file_t *conf_file;
69 ngx_log_t *log; 71 ngx_log_t *log;
70 72
71 void *ctx; 73 void *ctx;
72 int type; 74 int type;
73 int (*handler)(ngx_conf_t *cf); 75 char *(*handler)(ngx_conf_t *cf);
74 }; 76 };
75 77
76 78
77 int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename); 79 #define ngx_conf_merge(conf, prev, default) \
80 if (conf == NGX_CONF_UNSET) { \
81 conf = (prev == NGX_CONF_UNSET) ? default : prev; \
82 }
78 83
79 84
85
86 char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
87
88
89 char *ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
80 char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf); 90 char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
81 char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf); 91 char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
82 92
83 93
84 extern ngx_module_t *ngx_modules[]; 94 extern ngx_module_t *ngx_modules[];