Welcome! Log In Create A New Profile

Advanced

[njs] Moving all common headers into njs_main.h.

Dmitry Volyntsev
August 02, 2019 05:34AM
details: https://hg.nginx.org/njs/rev/835b3e817b93
branches:
changeset: 1095:835b3e817b93
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Aug 02 12:12:36 2019 +0300
description:
Moving all common headers into njs_main.h.

diffstat:

src/njs_arr.c | 9 ++-------
src/njs_array.c | 3 +--
src/njs_boolean.c | 1 +
src/njs_builtin.c | 10 +---------
src/njs_crypto.c | 7 +------
src/njs_date.c | 5 +----
src/njs_disassembler.c | 1 +
src/njs_diyfp.c | 5 ++---
src/njs_djb_hash.c | 7 ++-----
src/njs_dtoa.c | 9 ++-------
src/njs_error.c | 3 +--
src/njs_event.c | 2 +-
src/njs_extern.c | 2 +-
src/njs_file.c | 7 +------
src/njs_fs.c | 6 +-----
src/njs_function.c | 2 +-
src/njs_generator.c | 2 +-
src/njs_json.c | 5 +----
src/njs_lexer.c | 2 +-
src/njs_lexer_keyword.c | 2 +-
src/njs_lvlhsh.c | 8 ++------
src/njs_main.h | 23 ++++++++++++++++++++++-
src/njs_malloc.c | 10 +---------
src/njs_math.c | 2 +-
src/njs_md5.c | 7 +------
src/njs_module.c | 9 +--------
src/njs_mp.c | 13 ++-----------
src/njs_murmur_hash.c | 6 ++----
src/njs_number.c | 4 +---
src/njs_object.c | 2 +-
src/njs_parser.c | 3 +--
src/njs_parser_expression.c | 2 +-
src/njs_parser_terminal.c | 3 +--
src/njs_pcre.c | 9 ++-------
src/njs_queue.c | 6 ++----
src/njs_random.c | 8 +-------
src/njs_rbtree.c | 6 ++----
src/njs_regexp.c | 5 +----
src/njs_sha1.c | 7 +------
src/njs_sha2.c | 7 +------
src/njs_shell.c | 10 ----------
src/njs_sprintf.c | 15 ++++-----------
src/njs_string.c | 4 +---
src/njs_strtod.c | 5 +----
src/njs_time.c | 8 ++------
src/njs_timer.c | 3 +--
src/njs_trace.c | 8 ++------
src/njs_unix.h | 18 +++++++++++++++++-
src/njs_utf8.c | 6 ++----
src/njs_value.c | 2 +-
src/njs_variable.c | 2 +-
src/njs_vm.c | 3 +--
src/njs_vmcode.c | 3 +--
53 files changed, 105 insertions(+), 212 deletions(-)

diffs (944 lines):

diff -r 81b272f75471 -r 835b3e817b93 src/njs_arr.c
--- a/src/njs_arr.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_arr.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,13 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_mp.h>
-#include <njs_arr.h>
-#include <njs_str.h>
-#include <string.h>
+
+#include <njs_main.h>


njs_arr_t *
diff -r 81b272f75471 -r 835b3e817b93 src/njs_array.c
--- a/src/njs_array.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_array.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>
-#include <stdint.h>


static njs_int_t njs_array_prototype_slice_copy(njs_vm_t *vm,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_boolean.c
--- a/src/njs_boolean.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_boolean.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,6 +4,7 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>


diff -r 81b272f75471 -r 835b3e817b93 src/njs_builtin.c
--- a/src/njs_builtin.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_builtin.c Fri Aug 02 12:12:36 2019 +0300
@@ -5,16 +5,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <njs_date.h>
-#include <njs_timer.h>
-#include <njs_math.h>
-#include <njs_json.h>
-#include <njs_module.h>
-#include <njs_fs.h>
-#include <njs_crypto.h>
-#include <string.h>


typedef struct {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_crypto.c
--- a/src/njs_crypto.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_crypto.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,13 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_md5.h>
-#include <njs_sha1.h>
-#include <njs_sha2.h>
-#include <njs_crypto.h>
-#include <string.h>
-#include <math.h>


typedef void (*njs_hash_init)(void *ctx);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_date.c
--- a/src/njs_date.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_date.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,11 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_date.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_disassembler.c
--- a/src/njs_disassembler.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_disassembler.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,6 +4,7 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>


diff -r 81b272f75471 -r 835b3e817b93 src/njs_diyfp.c
--- a/src/njs_diyfp.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_diyfp.c Fri Aug 02 12:12:36 2019 +0300
@@ -8,9 +8,8 @@
* and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
+
+#include <njs_main.h>
#include <njs_diyfp.h>


diff -r 81b272f75471 -r 835b3e817b93 src/njs_djb_hash.c
--- a/src/njs_djb_hash.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_djb_hash.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,11 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_djb_hash.h>
+
+#include <njs_main.h>


uint32_t
diff -r 81b272f75471 -r 835b3e817b93 src/njs_dtoa.c
--- a/src/njs_dtoa.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_dtoa.c Fri Aug 02 12:12:36 2019 +0300
@@ -33,16 +33,11 @@
* THE SOFTWARE.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
+
+#include <njs_main.h>
#include <njs_diyfp.h>
#include <njs_dtoa.h>

-#include <math.h>
-#include <string.h>
-

njs_inline void
njs_grisu2_round(char *start, size_t len, uint64_t delta, uint64_t rest,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_error.c
--- a/src/njs_error.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_error.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>
-#include <math.h>


static const njs_value_t njs_error_message_string = njs_string("message");
diff -r 81b272f75471 -r 835b3e817b93 src/njs_event.c
--- a/src/njs_event.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_event.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


static njs_int_t njs_event_hash_test(njs_lvlhsh_query_t *lhq, void *data);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_extern.c
--- a/src/njs_extern.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_extern.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


typedef struct njs_extern_part_s njs_extern_part_t;
diff -r 81b272f75471 -r 835b3e817b93 src/njs_file.c
--- a/src/njs_file.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_file.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,13 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_file.h>

-#include <string.h>
+#include <njs_main.h>


void
diff -r 81b272f75471 -r 835b3e817b93 src/njs_fs.c
--- a/src/njs_fs.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_fs.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,12 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_fs.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>


typedef struct {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_function.c
--- a/src/njs_function.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_function.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


static njs_function_t *njs_function_copy(njs_vm_t *vm,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_generator.c
--- a/src/njs_generator.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_generator.c Fri Aug 02 12:12:36 2019 +0300
@@ -5,8 +5,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


typedef struct njs_generator_patch_s njs_generator_patch_t;
diff -r 81b272f75471 -r 835b3e817b93 src/njs_json.c
--- a/src/njs_json.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_json.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,11 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_json.h>
-#include <njs_date.h>
-#include <njs_regexp.h>
-#include <string.h>


typedef struct {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_lexer.c
--- a/src/njs_lexer.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_lexer.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


typedef struct njs_lexer_multi_s njs_lexer_multi_t;
diff -r 81b272f75471 -r 835b3e817b93 src/njs_lexer_keyword.c
--- a/src/njs_lexer_keyword.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_lexer_keyword.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


static const njs_keyword_t njs_keywords[] = {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_lvlhsh.c
--- a/src/njs_lvlhsh.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_lvlhsh.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,12 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_lvlhsh.h>
-#include <string.h>
+
+#include <njs_main.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_main.h
--- a/src/njs_main.h Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_main.h Fri Aug 02 12:12:36 2019 +0300
@@ -18,6 +18,7 @@
#include <njs_dtoa.h>
#include <njs_strtod.h>
#include <njs_djb_hash.h>
+#include <njs_murmur_hash.h>
#include <njs_trace.h>
#include <njs_queue.h>
#include <njs_lvlhsh.h>
@@ -25,27 +26,47 @@
#include <njs_time.h>
#include <njs_file.h>
#include <njs_malloc.h>
+#include <njs_rbtree.h>
#include <njs_mp.h>
#include <njs_arr.h>
#include <njs_sprintf.h>

+#include <njs_md5.h>
+#include <njs_sha1.h>
+#include <njs_sha2.h>
+
#include <njs.h>
#include <njs_value.h>
+
#include <njs_vm.h>
#include <njs_vmcode.h>
#include <njs_variable.h>
#include <njs_lexer.h>
#include <njs_parser.h>
#include <njs_generator.h>
-#include <njs_function.h>
+
#include <njs_boolean.h>
#include <njs_number.h>
#include <njs_string.h>
#include <njs_object.h>
#include <njs_object_hash.h>
#include <njs_array.h>
+#include <njs_function.h>
#include <njs_error.h>
+#include <njs_regexp.h>
+#include <njs_regexp_pattern.h>
+#include <njs_date.h>

+#include <njs_math.h>
+#include <njs_json.h>
+
+#include <njs_timer.h>
+#include <njs_module.h>
+
+#include <njs_fs.h>
+#include <njs_crypto.h>
+
+#include <njs_builtin.h>
#include <njs_event.h>
#include <njs_extern.h>
#include <njs_module.h>
diff -r 81b272f75471 -r 835b3e817b93 src/njs_malloc.c
--- a/src/njs_malloc.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_malloc.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,13 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_malloc.h>

-#include <string.h>
+#include <njs_main.h>


void *
@@ -47,9 +42,6 @@ njs_memalign(size_t alignment, size_t si
return p;
}

- // STUB
- //njs_errno_set(err);
-
return NULL;
}

diff -r 81b272f75471 -r 835b3e817b93 src/njs_math.c
--- a/src/njs_math.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_math.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <math.h>


static njs_int_t
diff -r 81b272f75471 -r 835b3e817b93 src/njs_md5.c
--- a/src/njs_md5.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_md5.c Fri Aug 02 12:12:36 2019 +0300
@@ -6,12 +6,7 @@
*/


-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_md5.h>
-#include <njs_str.h>
-#include <string.h>
+#include <njs_main.h>


static const u_char *njs_md5_body(njs_md5_t *ctx, const u_char *data,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_module.c
--- a/src/njs_module.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_module.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,15 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_module.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/param.h>


typedef struct {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_mp.c
--- a/src/njs_mp.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_mp.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,17 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_sprintf.h>
-#include <njs_malloc.h>
-#include <njs_queue.h>
-#include <njs_rbtree.h>
-#include <njs_mp.h>
-#include <string.h>
-#include <stdint.h>
+
+#include <njs_main.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_murmur_hash.c
--- a/src/njs_murmur_hash.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_murmur_hash.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* released to the public domain.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_murmur_hash.h>
+
+#include <njs_main.h>


uint32_t
diff -r 81b272f75471 -r 835b3e817b93 src/njs_number.c
--- a/src/njs_number.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_number.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <math.h>
-#include <string.h>
-#include <float.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_object.c
--- a/src/njs_object.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_object.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


static njs_int_t njs_object_hash_test(njs_lvlhsh_query_t *lhq, void *data);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_parser.c
--- a/src/njs_parser.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_parser.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <string.h>


static njs_int_t njs_parser_scope_begin(njs_vm_t *vm, njs_parser_t *parser,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_parser_expression.c
--- a/src/njs_parser_expression.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_parser_expression.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


typedef struct {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_parser_terminal.c
--- a/src/njs_parser_terminal.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_parser_terminal.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <string.h>


static njs_parser_node_t *njs_parser_reference(njs_vm_t *vm,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_pcre.c
--- a/src/njs_pcre.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_pcre.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,14 +4,9 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_trace.h>
-#include <njs_str.h>
-#include <njs_regex.h>
+
+#include <njs_main.h>
#include <njs_pcre.h>
-#include <string.h>


static void *njs_pcre_malloc(size_t size);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_queue.c
--- a/src/njs_queue.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_queue.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_queue.h>
+
+#include <njs_main.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_random.c
--- a/src/njs_random.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_random.c Fri Aug 02 12:12:36 2019 +0300
@@ -5,13 +5,7 @@
*/


-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_random.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <unistd.h>
+#include <njs_main.h>
#if (NJS_HAVE_GETRANDOM)
#include <sys/random.h>
#elif (NJS_HAVE_LINUX_SYS_GETRANDOM)
diff -r 81b272f75471 -r 835b3e817b93 src/njs_rbtree.c
--- a/src/njs_rbtree.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_rbtree.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_rbtree.h>
+
+#include <njs_main.h>


/*
diff -r 81b272f75471 -r 835b3e817b93 src/njs_regexp.c
--- a/src/njs_regexp.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_regexp.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,11 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <njs_regexp_pattern.h>
-
-#include <string.h>


struct njs_regexp_group_s {
diff -r 81b272f75471 -r 835b3e817b93 src/njs_sha1.c
--- a/src/njs_sha1.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_sha1.c Fri Aug 02 12:12:36 2019 +0300
@@ -7,12 +7,7 @@
*/


-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_sha1.h>
-#include <njs_str.h>
-#include <string.h>
+#include <njs_main.h>


static const u_char *njs_sha1_body(njs_sha1_t *ctx, const u_char *data,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_sha2.c
--- a/src/njs_sha2.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_sha2.c Fri Aug 02 12:12:36 2019 +0300
@@ -7,12 +7,7 @@
*/


-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_sha2.h>
-#include <njs_str.h>
-#include <string.h>
+#include <njs_main.h>


static const u_char *njs_sha2_body(njs_sha2_t *ctx, const u_char *data,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_shell.c
--- a/src/njs_shell.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_shell.c Fri Aug 02 12:12:36 2019 +0300
@@ -6,17 +6,7 @@


#include <njs_main.h>
-#include <njs_builtin.h>
-#include <time.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/param.h>
#include <locale.h>
-
-#include <stdio.h>
#if (NJS_HAVE_EDITLINE)
#include <editline/readline.h>
#elif (NJS_HAVE_EDIT_READLINE)
diff -r 81b272f75471 -r 835b3e817b93 src/njs_sprintf.c
--- a/src/njs_sprintf.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_sprintf.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,15 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_str.h>
-#include <njs_sprintf.h>

-#include <math.h>
-#include <float.h>
-#include <string.h>
+#include <njs_main.h>


/*
@@ -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, c
}
}

- 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 *


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 -r 81b272f75471 -r 835b3e817b93 src/njs_string.c
--- a/src/njs_string.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_string.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <njs_regexp_pattern.h>
-#include <string.h>


#define NJS_TRIM_START 1
diff -r 81b272f75471 -r 835b3e817b93 src/njs_strtod.c
--- a/src/njs_strtod.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_strtod.c Fri Aug 02 12:12:36 2019 +0300
@@ -7,11 +7,8 @@
* that can be found in the LICENSE file.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
+#include <njs_main.h>
#include <njs_diyfp.h>
-#include <njs_strtod.h>

/*
* Max double: 1.7976931348623157 x 10^308
diff -r 81b272f75471 -r 835b3e817b93 src/njs_time.c
--- a/src/njs_time.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_time.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,13 +4,9 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_time.h>

-#include <time.h>
-#include <sys/time.h>
+#include <njs_main.h>
+

uint64_t
njs_time(void)
diff -r 81b272f75471 -r 835b3e817b93 src/njs_timer.c
--- a/src/njs_timer.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_timer.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_timer.h>
-#include <string.h>


static njs_int_t
diff -r 81b272f75471 -r 835b3e817b93 src/njs_trace.c
--- a/src/njs_trace.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_trace.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,12 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_malloc.h>
-#include <njs_sprintf.h>
-#include <njs_trace.h>
+
+#include <njs_main.h>


static u_char *
diff -r 81b272f75471 -r 835b3e817b93 src/njs_unix.h
--- a/src/njs_unix.h Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_unix.h Fri Aug 02 12:12:36 2019 +0300
@@ -8,7 +8,6 @@
#ifndef _NJS_UNIX_H_INCLUDED_
#define _NJS_UNIX_H_INCLUDED_

-#include <unistd.h>
#define njs_pagesize() getpagesize()

#if (NJS_LINUX)
@@ -23,4 +22,21 @@

#endif /* NJS_LINUX */

+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h> /* offsetof() */
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+#include <time.h>
+#include <fcntl.h>
+
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+
+#include <unistd.h>
+
#endif /* _NJS_UNIX_H_INCLUDED_ */
diff -r 81b272f75471 -r 835b3e817b93 src/njs_utf8.c
--- a/src/njs_utf8.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_utf8.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,10 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

-#include <njs_auto_config.h>
-#include <njs_types.h>
-#include <njs_clang.h>
-#include <njs_utf8.h>
+
+#include <njs_main.h>

/*
* The njs_unicode_lower_case.h and njs_unicode_upper_case.h files are
diff -r 81b272f75471 -r 835b3e817b93 src/njs_value.c
--- a/src/njs_value.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_value.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,8 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


const njs_value_t njs_value_null = njs_value(NJS_NULL, 0, 0.0);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_variable.c
--- a/src/njs_variable.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_variable.c Fri Aug 02 12:12:36 2019 +0300
@@ -5,8 +5,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <string.h>


static njs_variable_t *njs_variable_scope_add(njs_vm_t *vm,
diff -r 81b272f75471 -r 835b3e817b93 src/njs_vm.c
--- a/src/njs_vm.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_vm.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <string.h>


static njs_int_t njs_vm_init(njs_vm_t *vm);
diff -r 81b272f75471 -r 835b3e817b93 src/njs_vmcode.c
--- a/src/njs_vmcode.c Fri Aug 02 12:12:35 2019 +0300
+++ b/src/njs_vmcode.c Fri Aug 02 12:12:36 2019 +0300
@@ -4,9 +4,8 @@
* Copyright (C) NGINX, Inc.
*/

+
#include <njs_main.h>
-#include <njs_regexp.h>
-#include <string.h>


struct njs_property_next_s {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Moving all common headers into njs_main.h.

Dmitry Volyntsev 235 August 02, 2019 05:34AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 247
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready