Mercurial > hg > nginx
comparison src/core/ngx_module.h @ 6378:0f203a2af17c
Dynamic modules: moved module-related stuff to separate files.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Feb 2016 18:30:21 +0300 |
parents | |
children | 85dea406e18f |
comparison
equal
deleted
inserted
replaced
6377:11e019750adc | 6378:0f203a2af17c |
---|---|
1 | |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 * Copyright (C) Maxim Dounin | |
5 * Copyright (C) Nginx, Inc. | |
6 */ | |
7 | |
8 | |
9 #ifndef _NGX_MODULE_H_INCLUDED_ | |
10 #define _NGX_MODULE_H_INCLUDED_ | |
11 | |
12 | |
13 #include <ngx_config.h> | |
14 #include <ngx_core.h> | |
15 | |
16 | |
17 #define NGX_MODULE_V1 0, 0, 0, 0, 0, 0, 1 | |
18 #define NGX_MODULE_V1_PADDING 0, 0, 0, 0, 0, 0, 0, 0 | |
19 | |
20 | |
21 struct ngx_module_s { | |
22 ngx_uint_t ctx_index; | |
23 ngx_uint_t index; | |
24 | |
25 ngx_uint_t spare0; | |
26 ngx_uint_t spare1; | |
27 ngx_uint_t spare2; | |
28 ngx_uint_t spare3; | |
29 | |
30 ngx_uint_t version; | |
31 | |
32 void *ctx; | |
33 ngx_command_t *commands; | |
34 ngx_uint_t type; | |
35 | |
36 ngx_int_t (*init_master)(ngx_log_t *log); | |
37 | |
38 ngx_int_t (*init_module)(ngx_cycle_t *cycle); | |
39 | |
40 ngx_int_t (*init_process)(ngx_cycle_t *cycle); | |
41 ngx_int_t (*init_thread)(ngx_cycle_t *cycle); | |
42 void (*exit_thread)(ngx_cycle_t *cycle); | |
43 void (*exit_process)(ngx_cycle_t *cycle); | |
44 | |
45 void (*exit_master)(ngx_cycle_t *cycle); | |
46 | |
47 uintptr_t spare_hook0; | |
48 uintptr_t spare_hook1; | |
49 uintptr_t spare_hook2; | |
50 uintptr_t spare_hook3; | |
51 uintptr_t spare_hook4; | |
52 uintptr_t spare_hook5; | |
53 uintptr_t spare_hook6; | |
54 uintptr_t spare_hook7; | |
55 }; | |
56 | |
57 | |
58 typedef struct { | |
59 ngx_str_t name; | |
60 void *(*create_conf)(ngx_cycle_t *cycle); | |
61 char *(*init_conf)(ngx_cycle_t *cycle, void *conf); | |
62 } ngx_core_module_t; | |
63 | |
64 | |
65 ngx_int_t ngx_preinit_modules(); | |
66 ngx_int_t ngx_init_modules(ngx_cycle_t *cycle); | |
67 ngx_int_t ngx_count_modules(ngx_cycle_t *cycle, ngx_uint_t type); | |
68 | |
69 | |
70 extern ngx_module_t *ngx_modules[]; | |
71 extern ngx_uint_t ngx_max_module; | |
72 | |
73 | |
74 #endif /* _NGX_MODULE_H_INCLUDED_ */ |