nginx-0.0.1-2002-12-26-19:26:23 import
diff --git a/src/core/nginx.c b/src/core/nginx.c
index bab1fa7..17a3d10 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -62,7 +62,6 @@
                   ngx_create_array(ngx_pool, 10, sizeof(ngx_str_t)), 1);
     conf.pool = ngx_pool;
     conf.log = &ngx_log;
-    conf.modules = ngx_http_modules;
 
     conf_file.len = sizeof("nginx.conf") - 1;
     conf_file.data = "nginx.conf";
diff --git a/src/core/ngx_config_file.c b/src/core/ngx_config_file.c
index b1582d1..79d7218 100644
--- a/src/core/ngx_config_file.c
+++ b/src/core/ngx_config_file.c
@@ -1,8 +1,6 @@
 
 #include <ngx_config.h>
-
 #include <ngx_core.h>
-
 #include <ngx_config_file.h>
 
 
@@ -13,14 +11,13 @@
 };
 
 static int ngx_conf_read_token(ngx_conf_t *cf);
-static ngx_command_t *ngx_conf_find_token(ngx_conf_t *cf,
-                                          ngx_http_module_t **modules);
 
 
 int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
 {
-    int               rc;
+    int               rc, i;
     char             *error;
+    ngx_str_t        *name;
     ngx_fd_t          fd;
     ngx_conf_file_t  *prev;
     ngx_command_t    *cmd;
@@ -75,7 +72,29 @@
             continue;
         }
 
-        cmd = ngx_conf_find_token(cf);
+        name = (ngx_str_t *) cf->args->elts;
+
+        for (i = 0; ngx_modules[i]; i++) {
+            if (cf->type != ngx_modules[i]->type) {
+                continue;
+            }
+
+            cmd = ngx_modules[i]->commands;
+            if (cmd == NULL) {
+                continue;
+            }
+
+            while (cmd->name.len) {
+                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);
+                }
+
+                cmd++;
+            }
+       }
 
 #if 0
         cmd = ngx_conf_find_token(cf);
@@ -368,59 +387,37 @@
 }
 
 
-static ngx_command_t *ngx_conf_find_token(ngx_conf_t *cf)
-{
-    int  i;
-    ngx_command_t  *cmd;
-
-    for (i = 0; cf->modules[i]; i++) {
-         cmd = cf->modules[i]->commands;
-         if (cmd == NULL) {
-             continue;
-         }
-
-         while (cmd->name) {
-
-ngx_log_debug(cf->log, "command '%s'" _ cmd->name);
-
-             cmd++;
-         }
-
-    }
-}
-
-
-char *ngx_conf_set_size_slot(ngx_conf_t *cf, char *conf)
+char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf)
 {
     int         size;
     ngx_str_t  *value;
 
     value = (ngx_str_t *) cf->args->elts;
 
-    size = atoi(value.data);
+    size = atoi(value[1].data);
     if (size < 0) {
         return "value must be greater or equal to zero";
     }
 
-    *(int *) (conf + cf->offset) = size;
+    *(int *) (conf + cmd->offset) = size;
 
     return NULL;
 }
 
 
-char *ngx_conf_set_time_slot(ngx_conf_t *cf, char *conf)
+char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf)
 {
     int         size;
     ngx_str_t  *value;
 
     value = (ngx_str_t *) cf->args->elts;
 
-    size = atoi(value.data);
+    size = atoi(value[1].data);
     if (size < 0) {
         return "value must be greater or equal to zero";
     }
 
-    *(int *) (conf + offset) = size;
+    *(int *) (conf + cmd->offset) = size;
 
     return NULL;
 }
diff --git a/src/core/ngx_config_file.h b/src/core/ngx_config_file.h
index a7eb47c..768dc66 100644
--- a/src/core/ngx_config_file.h
+++ b/src/core/ngx_config_file.h
@@ -16,7 +16,8 @@
 #define NGX_CONF_TAKE1     2
 #define NGX_CONF_TAKE2     4
 
-#define NGX_CONF_ITERATE   0
+#define NGX_CONF_ANY       0x10000
+#define NGX_CONF_BLOCK     0x20000
 
 #define NGX_CONF_UNSET    -1
 
@@ -28,13 +29,14 @@
 typedef struct ngx_conf_s  ngx_conf_t;
 
 
-typedef struct {
+typedef struct ngx_command_s  ngx_command_t;
+struct ngx_command_s {
     ngx_str_t  name;
-    char    *(*set)(ngx_conf_t *cf);
-    int        offset;
-    int        zone;
     int        type;
-} ngx_command_t;
+    char    *(*set)(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
+    int        conf;
+    int        offset;
+};
 
 
 typedef struct {
@@ -60,9 +62,8 @@
     ngx_conf_file_t  *conf_file;
     ngx_log_t        *log;
 
-    ngx_module_t     *modules;
-
     void             *ctx;
+    int               type;
     int             (*handler)(ngx_conf_t *cf);
 };
 
@@ -70,7 +71,11 @@
 int ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
 
 
-char *ngx_conf_set_size_slot(ngx_conf_t *cf);
+char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
+char *ngx_conf_set_time_slot(ngx_conf_t *cf, ngx_command_t *cmd, char *conf);
+
+
+extern ngx_module_t *ngx_modules[];
 
 
 #endif _NGX_HTTP_CONFIG_FILE_H_INCLUDED_
diff --git a/src/core/ngx_modules.c b/src/core/ngx_modules.c
index 5b814ba..4d43349 100644
--- a/src/core/ngx_modules.c
+++ b/src/core/ngx_modules.c
@@ -1,15 +1,19 @@
 
-#include <ngx_http.h>
+#include <ngx_config_file.h>
 
-extern ngx_http_module_t ngx_http_header_filter_module;
 
-extern ngx_http_module_t ngx_http_write_filter_module;
-extern ngx_http_module_t ngx_http_output_filter_module;
+extern ngx_module_t  ngx_http_header_filter_module;
 
-extern ngx_http_module_t ngx_http_core_module;
-extern ngx_http_module_t ngx_http_index_module;
+extern ngx_module_t  ngx_http_write_filter_module;
+extern ngx_module_t  ngx_http_output_filter_module;
 
-ngx_http_module_t *ngx_http_modules[] = {
+extern ngx_module_t  ngx_http_core_module;
+extern ngx_module_t  ngx_http_index_module;
+
+extern ngx_module_t  ngx_http_module;
+
+
+ngx_module_t *ngx_modules[] = {
 
     &ngx_http_header_filter_module,
 
@@ -19,5 +23,7 @@
     &ngx_http_index_module,
     &ngx_http_core_module,
 
+    &ngx_http_module,
+
     NULL
 };
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index 3e28abb..9ee3e5e 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -19,6 +19,7 @@
 #define ngx_memzero               ZeroMemory
 
 #define strcasecmp                stricmp
+#define ngx_strcmp                strcmp
 
 #define ngx_snprintf              _snprintf
 #define ngx_vsnprintf             _vsnprintf
@@ -27,6 +28,8 @@
 
 #define ngx_memzero               bzero
 
+#define ngx_strcmp                strcmp
+
 #define ngx_snprintf              snprintf
 #define ngx_vsnprintf             vsnprintf