comparison src/core/ngx_conf_file.c @ 311:11ff50a35d6d

nginx-0.0.3-2004-04-12-20:38:09 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 12 Apr 2004 16:38:09 +0000
parents 502b03d9d2a3
children d71c87d11b16
comparison
equal deleted inserted replaced
310:a9a9af2c7370 311:11ff50a35d6d
11 NGX_CONF_TAKE2, 11 NGX_CONF_TAKE2,
12 NGX_CONF_TAKE3, 12 NGX_CONF_TAKE3,
13 NGX_CONF_TAKE4, 13 NGX_CONF_TAKE4,
14 NGX_CONF_TAKE5, 14 NGX_CONF_TAKE5,
15 NGX_CONF_TAKE6, 15 NGX_CONF_TAKE6,
16 NGX_CONF_TAKE7, 16 NGX_CONF_TAKE7
17 NGX_CONF_TAKE8,
18 NGX_CONF_TAKE9,
19 }; 17 };
20 18
21 static int ngx_conf_read_token(ngx_conf_t *cf); 19 static int ngx_conf_read_token(ngx_conf_t *cf);
22 20
23 21
202 200
203 /* set up the directive's configuration context */ 201 /* set up the directive's configuration context */
204 202
205 conf = NULL; 203 conf = NULL;
206 204
207 if (cf->module_type == NGX_CORE_MODULE) { 205 if (cmd->type & NGX_DIRECT_CONF) {
206 conf = ((void **) cf->ctx)[ngx_modules[m]->index];
207
208 } else if (cmd->type & NGX_MAIN_CONF) {
208 conf = &(((void **) cf->ctx)[ngx_modules[m]->index]); 209 conf = &(((void **) cf->ctx)[ngx_modules[m]->index]);
209 210
210 } else if (cf->ctx) { 211 } else if (cf->ctx) {
211 confp = *(void **) ((char *) cf->ctx + cmd->conf); 212 confp = *(void **) ((char *) cf->ctx + cmd->conf);
212 213
562 ngx_log_error(level, cf->log, 0, "%s in %s:%d", 563 ngx_log_error(level, cf->log, 0, "%s in %s:%d",
563 errstr, cf->conf_file->file.name.data, cf->conf_file->line); 564 errstr, cf->conf_file->file.name.data, cf->conf_file->line);
564 } 565 }
565 566
566 567
567 char *ngx_conf_set_core_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd,
568 void *conf)
569 {
570 return ngx_conf_set_flag_slot(cf, cmd, *(void **)conf);
571 }
572
573
574 char *ngx_conf_set_core_num_slot(ngx_conf_t *cf, ngx_command_t *cmd,
575 void *conf)
576 {
577 return ngx_conf_set_num_slot(cf, cmd, *(void **)conf);
578 }
579
580
581 char *ngx_conf_set_core_str_slot(ngx_conf_t *cf, ngx_command_t *cmd,
582 void *conf)
583 {
584 return ngx_conf_set_str_slot(cf, cmd, *(void **)conf);
585 }
586
587
588 char *ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 568 char *ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
589 { 569 {
590 char *p = conf; 570 char *p = conf;
591 571
592 ngx_flag_t flag; 572 ngx_flag_t flag;