Mercurial > hg > nginx-quic
comparison src/core/ngx_conf_file.c @ 336:ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 18 May 2004 15:29:08 +0000 |
parents | d71c87d11b16 |
children | 4feff829a849 |
comparison
equal
deleted
inserted
replaced
335:d4241d7787fe | 336:ca9a7f8c86da |
---|---|
1 | 1 |
2 #include <ngx_config.h> | 2 #include <ngx_config.h> |
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 | 4 |
5 | 5 |
6 /* Ten fixed arguments */ | 6 static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
7 | |
8 | |
9 static ngx_command_t ngx_conf_commands[] = { | |
10 | |
11 { ngx_string("include"), | |
12 NGX_ANY_CONF|NGX_CONF_TAKE1, | |
13 ngx_conf_include, | |
14 0, | |
15 0, | |
16 NULL }, | |
17 | |
18 ngx_null_command | |
19 }; | |
20 | |
21 | |
22 ngx_module_t ngx_conf_module = { | |
23 NGX_MODULE, | |
24 NULL, /* module context */ | |
25 ngx_conf_commands, /* module directives */ | |
26 NGX_CONF_MODULE, /* module type */ | |
27 NULL, /* init module */ | |
28 NULL /* init child */ | |
29 }; | |
30 | |
31 | |
32 | |
33 /* The ten fixed arguments */ | |
7 | 34 |
8 static int argument_number[] = { | 35 static int argument_number[] = { |
9 NGX_CONF_NOARGS, | 36 NGX_CONF_NOARGS, |
10 NGX_CONF_TAKE1, | 37 NGX_CONF_TAKE1, |
11 NGX_CONF_TAKE2, | 38 NGX_CONF_TAKE2, |
511 } | 538 } |
512 } | 539 } |
513 } | 540 } |
514 | 541 |
515 | 542 |
543 static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
544 { | |
545 ngx_str_t *value, file; | |
546 | |
547 value = cf->args->elts; | |
548 | |
549 file.len = cf->cycle->root.len + value[1].len; | |
550 if (!(file.data = ngx_palloc(cf->pool, file.len + 1))) { | |
551 return NGX_CONF_ERROR; | |
552 } | |
553 | |
554 ngx_cpystrn(ngx_cpymem(file.data, cf->cycle->root.data, | |
555 cf->cycle->root.len), | |
556 value[1].data, value[1].len + 1); | |
557 | |
558 ngx_log_error(NGX_LOG_INFO, cf->log, 0, "include %s", file.data); | |
559 | |
560 return ngx_conf_parse(cf, &file); | |
561 } | |
562 | |
563 | |
516 ngx_open_file_t *ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) | 564 ngx_open_file_t *ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) |
517 { | 565 { |
518 ngx_uint_t i; | 566 ngx_uint_t i; |
519 ngx_open_file_t *file; | 567 ngx_open_file_t *file; |
520 | 568 |