[njs] Modules: renaming ngx_js_conf_t to ngx_js_loc_conf_t.

Dmitry Volyntsev xeioex at nginx.com
Thu Jun 8 00:14:27 UTC 2023


details:   https://hg.nginx.org/njs/rev/2daeeea1a05a
branches:  
changeset: 2151:2daeeea1a05a
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Jun 06 21:31:39 2023 -0700
description:
Modules: renaming ngx_js_conf_t to ngx_js_loc_conf_t.

diffstat:

 nginx/ngx_http_js_module.c   |   8 ++++----
 nginx/ngx_js.c               |  39 ++++++++++++++++++++-------------------
 nginx/ngx_js.h               |  28 ++++++++++++++--------------
 nginx/ngx_stream_js_module.c |   8 ++++----
 4 files changed, 42 insertions(+), 41 deletions(-)

diffs (276 lines):

diff -r 92678163754a -r 2daeeea1a05a nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Mon Jun 05 18:21:07 2023 -0700
+++ b/nginx/ngx_http_js_module.c	Tue Jun 06 21:31:39 2023 -0700
@@ -13,7 +13,7 @@
 
 
 typedef struct {
-    NGX_JS_COMMON_CONF;
+    NGX_JS_COMMON_LOC_CONF;
 
     ngx_str_t              content;
     ngx_str_t              header_filter;
@@ -254,7 +254,7 @@ static char *ngx_http_js_content(ngx_con
 static char *ngx_http_js_body_filter_set(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 static ngx_int_t ngx_http_js_init_conf_vm(ngx_conf_t *cf,
-    ngx_js_conf_t *conf);
+    ngx_js_loc_conf_t *conf);
 static void *ngx_http_js_create_loc_conf(ngx_conf_t *cf);
 static char *ngx_http_js_merge_loc_conf(ngx_conf_t *cf, void *parent,
     void *child);
@@ -4104,7 +4104,7 @@ ngx_http_js_handle_event(ngx_http_reques
 
 
 static ngx_int_t
-ngx_http_js_externals_init(ngx_conf_t *cf, ngx_js_conf_t *conf_in)
+ngx_http_js_externals_init(ngx_conf_t *cf, ngx_js_loc_conf_t *conf_in)
 {
     ngx_http_js_loc_conf_t        *conf = (ngx_http_js_loc_conf_t *) conf_in;
 
@@ -4122,7 +4122,7 @@ ngx_http_js_externals_init(ngx_conf_t *c
 
 
 static ngx_int_t
-ngx_http_js_init_conf_vm(ngx_conf_t *cf, ngx_js_conf_t *conf)
+ngx_http_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
 {
     njs_vm_opt_t  options;
 
diff -r 92678163754a -r 2daeeea1a05a nginx/ngx_js.c
--- a/nginx/ngx_js.c	Mon Jun 05 18:21:07 2023 -0700
+++ b/nginx/ngx_js.c	Tue Jun 06 21:31:39 2023 -0700
@@ -548,7 +548,7 @@ ngx_js_logger(njs_vm_t *vm, njs_external
 char *
 ngx_js_import(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
-    ngx_js_conf_t *jscf = conf;
+    ngx_js_loc_conf_t *jscf = conf;
 
     u_char               *p, *end, c;
     ngx_int_t             from;
@@ -654,7 +654,7 @@ ngx_js_import(ngx_conf_t *cf, ngx_comman
 char *
 ngx_js_preload_object(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
-    ngx_js_conf_t    *jscf = conf;
+    ngx_js_loc_conf_t    *jscf = conf;
 
     u_char               *p, *end, c;
     ngx_int_t             from;
@@ -758,7 +758,7 @@ ngx_js_preload_object(ngx_conf_t *cf, ng
 
 
 ngx_int_t
-ngx_js_init_preload_vm(ngx_conf_t *cf, ngx_js_conf_t *conf)
+ngx_js_init_preload_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
 {
     u_char               *p, *start;
     size_t                size;
@@ -854,9 +854,9 @@ error:
 
 
 ngx_int_t
-ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_conf_t *conf,
-    ngx_js_conf_t *prev,
-    ngx_int_t (*init_vm) (ngx_conf_t *cf, ngx_js_conf_t *conf))
+ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
+    ngx_js_loc_conf_t *prev,
+    ngx_int_t (*init_vm) (ngx_conf_t *cf, ngx_js_loc_conf_t *conf))
 {
     ngx_str_t            *path, *s;
     ngx_uint_t            i;
@@ -864,7 +864,7 @@ ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_c
     ngx_js_named_path_t  *import, *pi, *pij, *preload;
 
     if (prev->imports != NGX_CONF_UNSET_PTR && prev->vm == NULL) {
-        if (init_vm(cf, (ngx_js_conf_t *) prev) != NGX_OK) {
+        if (init_vm(cf, (ngx_js_loc_conf_t *) prev) != NGX_OK) {
             return NGX_ERROR;
         }
     }
@@ -999,14 +999,14 @@ ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_c
         return NGX_OK;
     }
 
-    return init_vm(cf, (ngx_js_conf_t *) conf);
+    return init_vm(cf, (ngx_js_loc_conf_t *) conf);
 }
 
 
 ngx_int_t
-ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_js_conf_t *conf,
+ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
     njs_vm_opt_t *options,
-    ngx_int_t (*externals_init)(ngx_conf_t *cf, ngx_js_conf_t *conf))
+    ngx_int_t (*externals_init)(ngx_conf_t *cf, ngx_js_loc_conf_t *conf))
 {
     size_t                size;
     u_char               *start, *end, *p;
@@ -1023,7 +1023,7 @@ ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_
     static const njs_str_t file_name_key = njs_str("fileName");
 
     if (conf->preload_objects != NGX_CONF_UNSET_PTR) {
-       if (ngx_js_init_preload_vm(cf, (ngx_js_conf_t *)conf) != NGX_OK) {
+       if (ngx_js_init_preload_vm(cf, (ngx_js_loc_conf_t *)conf) != NGX_OK) {
            return NGX_ERROR;
        }
     }
@@ -1171,7 +1171,7 @@ ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_
 static void
 ngx_js_cleanup_vm(void *data)
 {
-    ngx_js_conf_t  *jscf = data;
+    ngx_js_loc_conf_t  *jscf = data;
 
     njs_vm_destroy(jscf->vm);
 
@@ -1181,10 +1181,10 @@ ngx_js_cleanup_vm(void *data)
 }
 
 
-ngx_js_conf_t *
+ngx_js_loc_conf_t *
 ngx_js_create_conf(ngx_conf_t *cf, size_t size)
 {
-    ngx_js_conf_t  *conf;
+    ngx_js_loc_conf_t  *conf;
 
     conf = ngx_pcalloc(cf->pool, size);
     if (conf == NULL) {
@@ -1206,7 +1206,7 @@ ngx_js_create_conf(ngx_conf_t *cf, size_
 #if defined(NGX_HTTP_SSL) || defined(NGX_STREAM_SSL)
 
 static char *
-ngx_js_set_ssl(ngx_conf_t *cf, ngx_js_conf_t *conf)
+ngx_js_set_ssl(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
 {
     ngx_ssl_t           *ssl;
     ngx_pool_cleanup_t  *cln;
@@ -1251,17 +1251,18 @@ ngx_js_set_ssl(ngx_conf_t *cf, ngx_js_co
 
 char *
 ngx_js_merge_conf(ngx_conf_t *cf, void *parent, void *child,
-  ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_conf_t *conf))
+  ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_loc_conf_t *conf))
 {
-    ngx_js_conf_t *prev = parent;
-    ngx_js_conf_t *conf = child;
+    ngx_js_loc_conf_t *prev = parent;
+    ngx_js_loc_conf_t *conf = child;
 
     ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
     ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, 16384);
     ngx_conf_merge_size_value(conf->max_response_body_size,
                               prev->max_response_body_size, 1048576);
 
-    if (ngx_js_merge_vm(cf, (ngx_js_conf_t *) conf, (ngx_js_conf_t *) prev,
+    if (ngx_js_merge_vm(cf, (ngx_js_loc_conf_t *) conf,
+                        (ngx_js_loc_conf_t *) prev,
                         init_vm)
         != NGX_OK)
     {
diff -r 92678163754a -r 2daeeea1a05a nginx/ngx_js.h
--- a/nginx/ngx_js.h	Mon Jun 05 18:21:07 2023 -0700
+++ b/nginx/ngx_js.h	Tue Jun 06 21:31:39 2023 -0700
@@ -50,7 +50,7 @@ typedef struct {
 } ngx_js_named_path_t;
 
 
-#define _NGX_JS_COMMON_CONF                                                   \
+#define _NGX_JS_COMMON_LOC_CONF                                               \
     njs_vm_t              *vm;                                                \
     ngx_array_t           *imports;                                           \
     ngx_array_t           *paths;                                             \
@@ -64,8 +64,8 @@ typedef struct {
 
 
 #if defined(NGX_HTTP_SSL) || defined(NGX_STREAM_SSL)
-#define NGX_JS_COMMON_CONF                                                    \
-    _NGX_JS_COMMON_CONF;                                                      \
+#define NGX_JS_COMMON_LOC_CONF                                                \
+    _NGX_JS_COMMON_LOC_CONF;                                                  \
                                                                               \
     ngx_ssl_t             *ssl;                                               \
     ngx_str_t              ssl_ciphers;                                       \
@@ -75,13 +75,13 @@ typedef struct {
     ngx_str_t              ssl_trusted_certificate
 
 #else
-#define NGX_JS_COMMON_CONF _NGX_JS_COMMON_CONF
+#define NGX_JS_COMMON_LOC_CONF _NGX_JS_COMMON_LOC_CONF
 #endif
 
 
 typedef struct {
-    NGX_JS_COMMON_CONF;
-} ngx_js_conf_t;
+    NGX_JS_COMMON_LOC_CONF;
+} ngx_js_loc_conf_t;
 
 
 #define ngx_external_connection(vm, e)                                        \
@@ -124,16 +124,16 @@ void ngx_js_logger(njs_vm_t *vm, njs_ext
     njs_log_level_t level, const u_char *start, size_t length);
 char * ngx_js_import(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 char * ngx_js_preload_object(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-ngx_int_t ngx_js_init_preload_vm(ngx_conf_t *cf, ngx_js_conf_t *conf);
-ngx_int_t ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_conf_t *conf,
-    ngx_js_conf_t *prev,
-    ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_conf_t *conf));
-ngx_int_t ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_js_conf_t *conf,
+ngx_int_t ngx_js_init_preload_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf);
+ngx_int_t ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
+    ngx_js_loc_conf_t *prev,
+    ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_loc_conf_t *conf));
+ngx_int_t ngx_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
     njs_vm_opt_t *options,
-    ngx_int_t (*externals_init)(ngx_conf_t *cf, ngx_js_conf_t *conf));
-ngx_js_conf_t *ngx_js_create_conf(ngx_conf_t *cf, size_t size);
+    ngx_int_t (*externals_init)(ngx_conf_t *cf, ngx_js_loc_conf_t *conf));
+ngx_js_loc_conf_t *ngx_js_create_conf(ngx_conf_t *cf, size_t size);
 char * ngx_js_merge_conf(ngx_conf_t *cf, void *parent, void *child,
-   ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_conf_t *conf));
+   ngx_int_t (*init_vm)(ngx_conf_t *cf, ngx_js_loc_conf_t *conf));
 
 njs_int_t ngx_js_ext_string(njs_vm_t *vm, njs_object_prop_t *prop,
     njs_value_t *value, njs_value_t *setval, njs_value_t *retval);
diff -r 92678163754a -r 2daeeea1a05a nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c	Mon Jun 05 18:21:07 2023 -0700
+++ b/nginx/ngx_stream_js_module.c	Tue Jun 06 21:31:39 2023 -0700
@@ -13,7 +13,7 @@
 
 
 typedef struct {
-    NGX_JS_COMMON_CONF;
+    NGX_JS_COMMON_LOC_CONF;
 
     ngx_str_t              access;
     ngx_str_t              preread;
@@ -119,7 +119,7 @@ static char *ngx_stream_js_set(ngx_conf_
 static char *ngx_stream_js_var(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 static ngx_int_t ngx_stream_js_init_conf_vm(ngx_conf_t *cf,
-    ngx_js_conf_t *conf);
+    ngx_js_loc_conf_t *conf);
 static void *ngx_stream_js_create_srv_conf(ngx_conf_t *cf);
 static char *ngx_stream_js_merge_srv_conf(ngx_conf_t *cf, void *parent,
     void *child);
@@ -1670,7 +1670,7 @@ ngx_stream_js_handle_event(ngx_stream_se
 
 
 static ngx_int_t
-ngx_stream_js_externals_init(ngx_conf_t *cf, ngx_js_conf_t *conf_in)
+ngx_stream_js_externals_init(ngx_conf_t *cf, ngx_js_loc_conf_t *conf_in)
 {
     ngx_stream_js_srv_conf_t  *conf = (ngx_stream_js_srv_conf_t *) conf_in;
 
@@ -1697,7 +1697,7 @@ ngx_stream_js_externals_init(ngx_conf_t 
 
 
 static ngx_int_t
-ngx_stream_js_init_conf_vm(ngx_conf_t *cf, ngx_js_conf_t *conf)
+ngx_stream_js_init_conf_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf)
 {
     njs_vm_opt_t  options;
 


More information about the nginx-devel mailing list