From: Dmitry Volyntsev Date: Fri, 2 Aug 2019 09:12:36 +0000 (+0300) Subject: Moving all common headers into njs_main.h. X-Git-Tag: 0.3.4~32 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=173c463597c83b043d6245fb7084248023dd594b;p=njs.git Moving all common headers into njs_main.h. --- diff --git a/src/njs_arr.c b/src/njs_arr.c index 3a55c9df..bdcfe11c 100644 --- a/src/njs_arr.c +++ b/src/njs_arr.c @@ -4,13 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include -#include + +#include njs_arr_t * diff --git a/src/njs_array.c b/src/njs_array.c index d1bfb172..cbdd6e00 100644 --- a/src/njs_array.c +++ b/src/njs_array.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static njs_int_t njs_array_prototype_slice_copy(njs_vm_t *vm, diff --git a/src/njs_boolean.c b/src/njs_boolean.c index 40f0bd7d..a4de1d48 100644 --- a/src/njs_boolean.c +++ b/src/njs_boolean.c @@ -4,6 +4,7 @@ * Copyright (C) NGINX, Inc. */ + #include diff --git a/src/njs_builtin.c b/src/njs_builtin.c index a4bc5e49..c04cf372 100644 --- a/src/njs_builtin.c +++ b/src/njs_builtin.c @@ -5,16 +5,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include typedef struct { diff --git a/src/njs_crypto.c b/src/njs_crypto.c index 9aa19ca0..afef1ff2 100644 --- a/src/njs_crypto.c +++ b/src/njs_crypto.c @@ -4,13 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include -#include -#include typedef void (*njs_hash_init)(void *ctx); diff --git a/src/njs_date.c b/src/njs_date.c index b2adef17..ea6508c8 100644 --- a/src/njs_date.c +++ b/src/njs_date.c @@ -4,11 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include /* diff --git a/src/njs_disassembler.c b/src/njs_disassembler.c index 6dda9a7a..57742598 100644 --- a/src/njs_disassembler.c +++ b/src/njs_disassembler.c @@ -4,6 +4,7 @@ * Copyright (C) NGINX, Inc. */ + #include diff --git a/src/njs_diyfp.c b/src/njs_diyfp.c index 676b6f85..37ed6906 100644 --- a/src/njs_diyfp.c +++ b/src/njs_diyfp.c @@ -8,9 +8,8 @@ * and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243. */ -#include -#include -#include + +#include #include diff --git a/src/njs_djb_hash.c b/src/njs_djb_hash.c index 51d6b74d..e7f7167f 100644 --- a/src/njs_djb_hash.c +++ b/src/njs_djb_hash.c @@ -4,11 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include + +#include uint32_t diff --git a/src/njs_dtoa.c b/src/njs_dtoa.c index 1c3d4453..70149063 100644 --- a/src/njs_dtoa.c +++ b/src/njs_dtoa.c @@ -33,16 +33,11 @@ * THE SOFTWARE. */ -#include -#include -#include -#include + +#include #include #include -#include -#include - njs_inline void njs_grisu2_round(char *start, size_t len, uint64_t delta, uint64_t rest, diff --git a/src/njs_error.c b/src/njs_error.c index 6d3b1419..97f8c0c7 100644 --- a/src/njs_error.c +++ b/src/njs_error.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static const njs_value_t njs_error_message_string = njs_string("message"); diff --git a/src/njs_event.c b/src/njs_event.c index a78c5099..011a666d 100644 --- a/src/njs_event.c +++ b/src/njs_event.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static njs_int_t njs_event_hash_test(njs_lvlhsh_query_t *lhq, void *data); diff --git a/src/njs_extern.c b/src/njs_extern.c index 9e835512..73b952bb 100644 --- a/src/njs_extern.c +++ b/src/njs_extern.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include typedef struct njs_extern_part_s njs_extern_part_t; diff --git a/src/njs_file.c b/src/njs_file.c index e71adb17..210d85de 100644 --- a/src/njs_file.c +++ b/src/njs_file.c @@ -4,13 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include +#include void diff --git a/src/njs_fs.c b/src/njs_fs.c index 6858da02..21b38932 100644 --- a/src/njs_fs.c +++ b/src/njs_fs.c @@ -4,12 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include -#include typedef struct { diff --git a/src/njs_function.c b/src/njs_function.c index 2d0d363e..d0dd394d 100644 --- a/src/njs_function.c +++ b/src/njs_function.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static njs_function_t *njs_function_copy(njs_vm_t *vm, diff --git a/src/njs_generator.c b/src/njs_generator.c index 57dd56cb..7967a14a 100644 --- a/src/njs_generator.c +++ b/src/njs_generator.c @@ -5,8 +5,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include typedef struct njs_generator_patch_s njs_generator_patch_t; diff --git a/src/njs_json.c b/src/njs_json.c index 2219c272..b20b7ba9 100644 --- a/src/njs_json.c +++ b/src/njs_json.c @@ -4,11 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include typedef struct { diff --git a/src/njs_lexer.c b/src/njs_lexer.c index 7e9b0839..76b840e5 100644 --- a/src/njs_lexer.c +++ b/src/njs_lexer.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include typedef struct njs_lexer_multi_s njs_lexer_multi_t; diff --git a/src/njs_lexer_keyword.c b/src/njs_lexer_keyword.c index b5c556c2..c4287112 100644 --- a/src/njs_lexer_keyword.c +++ b/src/njs_lexer_keyword.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static const njs_keyword_t njs_keywords[] = { diff --git a/src/njs_lvlhsh.c b/src/njs_lvlhsh.c index a864b6f8..8443a08c 100644 --- a/src/njs_lvlhsh.c +++ b/src/njs_lvlhsh.c @@ -4,12 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include + +#include /* diff --git a/src/njs_main.h b/src/njs_main.h index c5fdc820..b8041ce1 100644 --- a/src/njs_main.h +++ b/src/njs_main.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -25,27 +26,47 @@ #include #include #include +#include #include #include #include +#include +#include +#include + #include #include + #include #include #include #include #include #include -#include + #include #include #include #include #include #include +#include #include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include #include #include #include diff --git a/src/njs_malloc.c b/src/njs_malloc.c index a3042db3..85a09afd 100644 --- a/src/njs_malloc.c +++ b/src/njs_malloc.c @@ -4,13 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include +#include void * @@ -47,9 +42,6 @@ njs_memalign(size_t alignment, size_t size) return p; } - // STUB - //njs_errno_set(err); - return NULL; } diff --git a/src/njs_math.c b/src/njs_math.c index 55aad406..b58ba6e6 100644 --- a/src/njs_math.c +++ b/src/njs_math.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static njs_int_t diff --git a/src/njs_md5.c b/src/njs_md5.c index d21358ea..4c455b30 100644 --- a/src/njs_md5.c +++ b/src/njs_md5.c @@ -6,12 +6,7 @@ */ -#include -#include -#include -#include -#include -#include +#include static const u_char *njs_md5_body(njs_md5_t *ctx, const u_char *data, diff --git a/src/njs_module.c b/src/njs_module.c index bd6d9084..552770a3 100644 --- a/src/njs_module.c +++ b/src/njs_module.c @@ -4,15 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include -#include -#include -#include -#include -#include typedef struct { diff --git a/src/njs_mp.c b/src/njs_mp.c index 7124c6f6..987f052b 100644 --- a/src/njs_mp.c +++ b/src/njs_mp.c @@ -4,17 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include /* diff --git a/src/njs_murmur_hash.c b/src/njs_murmur_hash.c index 336f2b75..f5ee0079 100644 --- a/src/njs_murmur_hash.c +++ b/src/njs_murmur_hash.c @@ -4,10 +4,8 @@ * released to the public domain. */ -#include -#include -#include -#include + +#include uint32_t diff --git a/src/njs_number.c b/src/njs_number.c index 3e2cb6bc..260e668c 100644 --- a/src/njs_number.c +++ b/src/njs_number.c @@ -4,10 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include /* diff --git a/src/njs_object.c b/src/njs_object.c index 7561160b..420f9e63 100644 --- a/src/njs_object.c +++ b/src/njs_object.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static njs_int_t njs_object_hash_test(njs_lvlhsh_query_t *lhq, void *data); diff --git a/src/njs_parser.c b/src/njs_parser.c index 118c7af9..bc701b04 100644 --- a/src/njs_parser.c +++ b/src/njs_parser.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static njs_int_t njs_parser_scope_begin(njs_vm_t *vm, njs_parser_t *parser, diff --git a/src/njs_parser_expression.c b/src/njs_parser_expression.c index b09d3e6b..52851758 100644 --- a/src/njs_parser_expression.c +++ b/src/njs_parser_expression.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include typedef struct { diff --git a/src/njs_parser_terminal.c b/src/njs_parser_terminal.c index bdfc4959..a8d002f2 100644 --- a/src/njs_parser_terminal.c +++ b/src/njs_parser_terminal.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static njs_parser_node_t *njs_parser_reference(njs_vm_t *vm, diff --git a/src/njs_pcre.c b/src/njs_pcre.c index b320d21d..92cc5e15 100644 --- a/src/njs_pcre.c +++ b/src/njs_pcre.c @@ -4,14 +4,9 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include + +#include #include -#include static void *njs_pcre_malloc(size_t size); diff --git a/src/njs_queue.c b/src/njs_queue.c index c2ae412d..fb32316c 100644 --- a/src/njs_queue.c +++ b/src/njs_queue.c @@ -4,10 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include + +#include /* diff --git a/src/njs_random.c b/src/njs_random.c index cbfd07b2..0494f52e 100644 --- a/src/njs_random.c +++ b/src/njs_random.c @@ -5,13 +5,7 @@ */ -#include -#include -#include -#include -#include -#include -#include +#include #if (NJS_HAVE_GETRANDOM) #include #elif (NJS_HAVE_LINUX_SYS_GETRANDOM) diff --git a/src/njs_rbtree.c b/src/njs_rbtree.c index c856121e..f7d8bf16 100644 --- a/src/njs_rbtree.c +++ b/src/njs_rbtree.c @@ -4,10 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include + +#include /* diff --git a/src/njs_regexp.c b/src/njs_regexp.c index 3697a631..1f49db8e 100644 --- a/src/njs_regexp.c +++ b/src/njs_regexp.c @@ -4,11 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include +#include struct njs_regexp_group_s { diff --git a/src/njs_sha1.c b/src/njs_sha1.c index 79abb603..fdadec2b 100644 --- a/src/njs_sha1.c +++ b/src/njs_sha1.c @@ -7,12 +7,7 @@ */ -#include -#include -#include -#include -#include -#include +#include static const u_char *njs_sha1_body(njs_sha1_t *ctx, const u_char *data, diff --git a/src/njs_sha2.c b/src/njs_sha2.c index 7b1bf93d..6beba260 100644 --- a/src/njs_sha2.c +++ b/src/njs_sha2.c @@ -7,12 +7,7 @@ */ -#include -#include -#include -#include -#include -#include +#include static const u_char *njs_sha2_body(njs_sha2_t *ctx, const u_char *data, diff --git a/src/njs_shell.c b/src/njs_shell.c index f70ec284..c28e3394 100644 --- a/src/njs_shell.c +++ b/src/njs_shell.c @@ -6,17 +6,7 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include #include - -#include #if (NJS_HAVE_EDITLINE) #include #elif (NJS_HAVE_EDIT_READLINE) diff --git a/src/njs_sprintf.c b/src/njs_sprintf.c index ca7ef528..1f7358e8 100644 --- a/src/njs_sprintf.c +++ b/src/njs_sprintf.c @@ -4,15 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include /* @@ -80,7 +73,7 @@ typedef struct { static u_char *njs_integer(njs_sprintf_t *spf, u_char *buf, uint64_t ui64); -static u_char *njs_number(njs_sprintf_t *spf, u_char *buf, double n); +static u_char *njs_float(njs_sprintf_t *spf, u_char *buf, double n); /* A right way of "f == 0.0". */ @@ -340,7 +333,7 @@ njs_vsprintf(u_char *buf, u_char *end, const char *fmt, va_list args) } } - buf = njs_number(&spf, buf, i); + buf = njs_float(&spf, buf, i); if (spf.frac_width > 0) { @@ -546,7 +539,7 @@ njs_integer(njs_sprintf_t *spf, u_char *buf, uint64_t ui64) static u_char * -njs_number(njs_sprintf_t *spf, u_char *buf, double n) +njs_float(njs_sprintf_t *spf, u_char *buf, double n) { u_char *p, *end; size_t length; diff --git a/src/njs_string.c b/src/njs_string.c index 053d4407..e1bd5013 100644 --- a/src/njs_string.c +++ b/src/njs_string.c @@ -4,10 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include -#include #define NJS_TRIM_START 1 diff --git a/src/njs_strtod.c b/src/njs_strtod.c index 9fd8cbf1..898cebe4 100644 --- a/src/njs_strtod.c +++ b/src/njs_strtod.c @@ -7,11 +7,8 @@ * that can be found in the LICENSE file. */ -#include -#include -#include +#include #include -#include /* * Max double: 1.7976931348623157 x 10^308 diff --git a/src/njs_time.c b/src/njs_time.c index cdca7e89..68733c73 100644 --- a/src/njs_time.c +++ b/src/njs_time.c @@ -4,13 +4,9 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include +#include + uint64_t njs_time(void) diff --git a/src/njs_timer.c b/src/njs_timer.c index 148ab9d2..96bb99de 100644 --- a/src/njs_timer.c +++ b/src/njs_timer.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static njs_int_t diff --git a/src/njs_trace.c b/src/njs_trace.c index 9b8c19cc..8f418860 100644 --- a/src/njs_trace.c +++ b/src/njs_trace.c @@ -4,12 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include -#include -#include + +#include static u_char * diff --git a/src/njs_unix.h b/src/njs_unix.h index 9a833e15..442cf8b6 100644 --- a/src/njs_unix.h +++ b/src/njs_unix.h @@ -8,7 +8,6 @@ #ifndef _NJS_UNIX_H_INCLUDED_ #define _NJS_UNIX_H_INCLUDED_ -#include #define njs_pagesize() getpagesize() #if (NJS_LINUX) @@ -23,4 +22,21 @@ #endif /* NJS_LINUX */ +#include +#include +#include /* offsetof() */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + #endif /* _NJS_UNIX_H_INCLUDED_ */ diff --git a/src/njs_utf8.c b/src/njs_utf8.c index bb697fe3..51baa490 100644 --- a/src/njs_utf8.c +++ b/src/njs_utf8.c @@ -4,10 +4,8 @@ * Copyright (C) NGINX, Inc. */ -#include -#include -#include -#include + +#include /* * The njs_unicode_lower_case.h and njs_unicode_upper_case.h files are diff --git a/src/njs_value.c b/src/njs_value.c index 6d300235..371ea9d3 100644 --- a/src/njs_value.c +++ b/src/njs_value.c @@ -4,8 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include const njs_value_t njs_value_null = njs_value(NJS_NULL, 0, 0.0); diff --git a/src/njs_variable.c b/src/njs_variable.c index 1de62599..392a6672 100644 --- a/src/njs_variable.c +++ b/src/njs_variable.c @@ -5,8 +5,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include static njs_variable_t *njs_variable_scope_add(njs_vm_t *vm, diff --git a/src/njs_vm.c b/src/njs_vm.c index e923f5b2..158a1124 100644 --- a/src/njs_vm.c +++ b/src/njs_vm.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include static njs_int_t njs_vm_init(njs_vm_t *vm); diff --git a/src/njs_vmcode.c b/src/njs_vmcode.c index 8c655ed4..782cae85 100644 --- a/src/njs_vmcode.c +++ b/src/njs_vmcode.c @@ -4,9 +4,8 @@ * Copyright (C) NGINX, Inc. */ + #include -#include -#include struct njs_property_next_s {