#include <nginx.h>
#include <ngx_config.h>
+
#include <ngx_string.h>
#include <ngx_errno.h>
#include <ngx_time.h>
#include <ngx_server.h>
#include <ngx_connection.h>
#include <ngx_listen.h>
+#include <ngx_conf_file.h>
/* STUB */
#include <ngx_http.h>
ngx_create_array(ngx_pool, 10, sizeof(ngx_str_t)), 1);
conf.pool = ngx_pool;
conf.log = &ngx_log;
+ conf.type = NGX_CORE_MODULE_TYPE;
conf_file.len = sizeof("nginx.conf") - 1;
conf_file.data = "nginx.conf";
#include <ngx_config.h>
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
static int argument_number[] = {
name = (ngx_str_t *) cf->args->elts;
for (i = 0; ngx_modules[i]; i++) {
- if (cf->type != ngx_modules[i]->type) {
+ if (ngx_modules[i]->type != NULL
+ && ngx_modules[i]->type != cf->type)
+ {
continue;
}
if (name->len == cmd->name.len
&& ngx_strcmp(name->data, cmd->name.data) == 0)
{
+
ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
+
cmd->set(cf, cmd, NULL);
}
-#ifndef _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
-#define _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
+#ifndef _NGX_HTTP_CONF_FILE_H_INCLUDED_
+#define _NGX_HTTP_CONF_FILE_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_array.h>
-#define NGX_CONF_NOARGS 1
-#define NGX_CONF_TAKE1 2
-#define NGX_CONF_TAKE2 4
+#define NGX_CONF_NOARGS 1
+#define NGX_CONF_TAKE1 2
+#define NGX_CONF_TAKE2 4
+#define NGX_CONF_ARGS_NUMBER 0x0ffff
+#define NGX_CONF_ANY 0x10000
+#define NGX_CONF_BLOCK 0x20000
-#define NGX_CONF_ANY 0x10000
-#define NGX_CONF_BLOCK 0x20000
-#define NGX_CONF_UNSET -1
+#define NGX_CONF_UNSET -1
+#define NGX_CONF_ERROR (char *) -1
+
#define NGX_CONF_BLOCK_DONE 1
#define NGX_CONF_FILE_DONE 2
-#define NGX_CONF_ERROR (char *) -1
+#define NGX_CORE_MODULE_TYPE 0x45524f43 /* "CORE" */
+
typedef struct ngx_conf_s ngx_conf_t;
extern ngx_module_t *ngx_modules[];
-#endif _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
+#endif _NGX_HTTP_CONF_FILE_H_INCLUDED_
#include <ngx_config.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
extern ngx_module_t ngx_http_header_filter_module;
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_errno.h>
#include <ngx_string.h>
#include <ngx_files.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_index_handler.h>
#include <ngx_config.h>
+
#include <ngx_types.h>
#include <ngx_string.h>
#include <ngx_table.h>
#include <ngx_hunk.h>
#include <ngx_files.h>
#include <ngx_connection.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
#define NGX_HTTP_VERSION_10 1000
+/* TODO:
+ ngx_http_conf_ctx_t ctx; on stack or in pool ? */
+
+
#include <ngx_config.h>
+
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_core.h>
#include <ngx_http_config.h>
ngx_module_t ngx_http_module = {
NULL, /* module context */
ngx_http_commands, /* module directives */
- 0, /* module type */
+ NGX_CORE_MODULE_TYPE, /* module type */
NULL /* init module */
};
+
static ngx_command_t ngx_http_core_commands[] = {
{ngx_string("server"),
{
int i;
ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx;
+ ngx_http_conf_ctx_t ctx;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) {
ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module),
NGX_CONF_ERROR);
- ctx->srv_conf = NULL;
- ctx->loc_conf = null_loc_conf;
- ctx->locations = NULL;
+ ctx.srv_conf = NULL;
+ ctx.loc_conf = null_loc_conf;
+ ctx.locations = NULL;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) {
}
}
- cf->ctx = ctx;
+ cf->ctx = &ctx;
cf->type = NGX_HTTP_MODULE_TYPE;
return ngx_conf_parse(cf, NULL);
}
#include <ngx_config.h>
+
#include <ngx_core.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_core.h>
#include <ngx_http_config.h>
#include <nginx.h>
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_string.h>
#include <ngx_table.h>
#include <ngx_hunk.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_write_filter.h>
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_files.h>
#include <ngx_string.h>
#include <ngx_hunk.h>
-#include <ngx_config_file.h>
+#include <ngx_conf_file.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_output_filter.h>
#include <ngx_hunk.h>
+#include <ngx_conf_file.h>
#include <ngx_http.h>
#include <ngx_config.h>
+
#include <ngx_core.h>
#include <ngx_hunk.h>
+#include <ngx_conf_file.h>
+
#include <ngx_event_write.h>
+
#include <ngx_http.h>
#include <ngx_http_config.h>
#include <ngx_http_write_filter.h>