Skip to content

Commit 107cca9

Browse files
authored
🚑 Reorder include (#92)
#93
1 parent dddaa4a commit 107cca9

File tree

6 files changed

+29
-20
lines changed

6 files changed

+29
-20
lines changed

inc/ngx_http_waf_module_check.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#define NGX_HTTP_WAF_MODLULE_CHECK_H
99

1010

11-
#include <uthash.h>
12-
#include <math.h>
1311
#include <ngx_config.h>
1412
#include <ngx_core.h>
1513
#include <ngx_http.h>
1614
#include <ngx_regex.h>
1715
#include <ngx_inet.h>
16+
#include <uthash.h>
17+
#include <math.h>
1818
#include <ngx_http_waf_module_macro.h>
1919
#include <ngx_http_waf_module_type.h>
2020
#include <ngx_http_waf_module_util.h>

inc/ngx_http_waf_module_config.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* @brief 读取 nginx.conf 内的配置以及规则文件。
44
*/
55

6-
#include <stdio.h>
7-
86
#ifndef __STDC_WANT_LIB_EXT1__
97
#define __STDC_WANT_LIB_EXT1__ 1
108
#endif
@@ -13,10 +11,16 @@
1311
#ifndef NGX_HTTP_WAF_MODULE_CONFIG_H
1412
#define NGX_HTTP_WAF_MODULE_CONFIG_H
1513

16-
#include <string.h>
14+
#include <ngx_config.h>
15+
#include <ngx_core.h>
16+
#include <ngx_http.h>
17+
#include <ngx_regex.h>
18+
#include <ngx_inet.h>
1719
#include <utarray.h>
18-
#include <ngx_http_waf_module_macro.h>
20+
#include <stdio.h>
21+
#include <string.h>
1922
#include <ngx_http_waf_module_type.h>
23+
#include <ngx_http_waf_module_macro.h>
2024
#include <ngx_http_waf_module_var.h>
2125
#include <ngx_http_waf_module_util.h>
2226
#include <ngx_http_waf_module_ip_trie.h>

inc/ngx_http_waf_module_core.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
#define NGX_HTTP_WAF_MODULE_CORE_H
88

99

10-
#include <stdio.h>
11-
#include <uthash.h>
12-
#include <time.h>
13-
#include <math.h>
1410
#include <ngx_config.h>
1511
#include <ngx_core.h>
1612
#include <ngx_http.h>
1713
#include <ngx_regex.h>
1814
#include <ngx_inet.h>
15+
#include <uthash.h>
16+
#include <stdio.h>
17+
#include <time.h>
18+
#include <math.h>
1919
#include <ngx_http_waf_module_macro.h>
2020
#include <ngx_http_waf_module_type.h>
2121
#include <ngx_http_waf_module_check.h>

inc/ngx_http_waf_module_type.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
#ifndef NGX_HTTP_WAF_MODULE_TYPE_H
88
#define NGX_HTTP_WAF_MODULE_TYPE_H
99

10-
#include <uthash.h>
11-
#include <utarray.h>
12-
#include <utlist.h>
1310
#include <ngx_config.h>
1411
#include <ngx_core.h>
1512
#include <ngx_http.h>
1613
#include <ngx_regex.h>
1714
#include <ngx_inet.h>
1815
#include <ngx_thread.h>
1916
#include <ngx_thread_pool.h>
20-
#include <ngx_http_waf_module_macro.h>
17+
#include <uthash.h>
18+
#include <utarray.h>
19+
#include <utlist.h>
2120
#include <sodium.h>
2221
#include <modsecurity/modsecurity.h>
2322
#include <modsecurity/transaction.h>
23+
#include <ngx_http_waf_module_macro.h>
2424

2525
#if defined(MODSECURITY_CHECK_VERSION)
2626
#if MODSECURITY_VERSION_NUM >= 304010
@@ -445,4 +445,4 @@ typedef struct ipv6_s {
445445
} ipv6_t;
446446
#endif
447447

448-
#endif // !NGX_HTTP_WAF_MODULE_TYPE_H
448+
#endif // !NGX_HTTP_WAF_MODULE_TYPE_H

inc/ngx_http_waf_module_util.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
#ifndef NGX_HTTP_WAF_MODULE_UTIL_H
77
#define NGX_HTTP_WAF_MODULE_UTIL_H
88

9+
#include <ngx_config.h>
10+
#include <ngx_core.h>
11+
#include <ngx_http.h>
12+
#include <ngx_regex.h>
13+
#include <ngx_inet.h>
914
#include <utarray.h>
10-
#include <ngx_http_waf_module_macro.h>
11-
#include <ngx_http_waf_module_type.h>
1215
#include <sodium.h>
1316
#include <curl/curl.h>
17+
#include <ngx_http_waf_module_type.h>
18+
#include <ngx_http_waf_module_macro.h>
1419

1520
/**
1621
* @defgroup util 工具代码
@@ -211,4 +216,4 @@ void ngx_http_waf_utarray_ngx_str_dtor(void* elt);
211216
*/
212217

213218

214-
#endif
219+
#endif

inc/ngx_http_waf_module_var.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __NGX_HTTP_WAF_VAR_H__
22
#define __NGX_HTTP_WAF_VAR_H__
33

4-
#include <ngx_http_waf_module_macro.h>
54
#include <ngx_http_waf_module_type.h>
5+
#include <ngx_http_waf_module_macro.h>
66
#include <ngx_http_waf_module_util.h>
77

88

@@ -12,4 +12,4 @@
1212
ngx_int_t ngx_http_waf_install_add_var(ngx_conf_t* cf);
1313

1414

15-
#endif
15+
#endif

0 commit comments

Comments
 (0)