Module: kamailio
Branch: master
Commit: e5c7b4ea8246f11815ab49fa0219ce2a7be3dd65
URL:
https://github.com/kamailio/kamailio/commit/e5c7b4ea8246f11815ab49fa0219ce2…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-12-12T14:59:53+01:00
ndb_mongodb: reformat exported structures
---
Modified: src/modules/ndb_mongodb/ndb_mongodb_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e5c7b4ea8246f11815ab49fa0219ce2…
Patch:
https://github.com/kamailio/kamailio/commit/e5c7b4ea8246f11815ab49fa0219ce2…
---
diff --git a/src/modules/ndb_mongodb/ndb_mongodb_mod.c
b/src/modules/ndb_mongodb/ndb_mongodb_mod.c
index a778a492f38..46cb8ec5045 100644
--- a/src/modules/ndb_mongodb/ndb_mongodb_mod.c
+++ b/src/modules/ndb_mongodb/ndb_mongodb_mod.c
@@ -60,44 +60,48 @@ static int pv_get_mongodb(
struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
static int pv_parse_mongodb_name(pv_spec_p sp, str *in);
+/* clang-format off */
static pv_export_t mod_pvs[] = {
- {{"mongodb", sizeof("mongodb") - 1}, PVT_OTHER, pv_get_mongodb, 0,
- pv_parse_mongodb_name, 0, 0, 0},
- {{0, 0}, 0, 0, 0, 0, 0, 0, 0}};
-
-
-static cmd_export_t cmds[] = {{"mongodb_find", (cmd_function)w_mongodb_find,
5,
- fixup_mongodb_cmd, 0, ANY_ROUTE},
- {"mongodb_find_one", (cmd_function)w_mongodb_find_one, 5,
- fixup_mongodb_cmd, 0, ANY_ROUTE},
- {"mongodb_cmd_simple", (cmd_function)w_mongodb_cmd_simple, 5,
- fixup_mongodb_cmd, 0, ANY_ROUTE},
- {"mongodb_cmd", (cmd_function)w_mongodb_cmd, 5, fixup_mongodb_cmd, 0,
- ANY_ROUTE},
- {"mongodb_free", (cmd_function)w_mongodb_free_reply, 1, fixup_spve_null,
- 0, ANY_ROUTE},
- {"mongodb_next", (cmd_function)w_mongodb_next_reply, 1, fixup_spve_null,
- 0, ANY_ROUTE},
- {"bind_ndb_mongodb", (cmd_function)bind_ndb_mongodb, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0}};
+ {{"mongodb", sizeof("mongodb") - 1}, PVT_OTHER, pv_get_mongodb, 0,
+ pv_parse_mongodb_name, 0, 0, 0},
+ {{0, 0}, 0, 0, 0, 0, 0, 0, 0}
+};
+
+static cmd_export_t cmds[] = {
+ {"mongodb_find", (cmd_function)w_mongodb_find, 5,
+ fixup_mongodb_cmd, 0, ANY_ROUTE},
+ {"mongodb_find_one", (cmd_function)w_mongodb_find_one, 5,
+ fixup_mongodb_cmd, 0, ANY_ROUTE},
+ {"mongodb_cmd_simple", (cmd_function)w_mongodb_cmd_simple, 5,
+ fixup_mongodb_cmd, 0, ANY_ROUTE},
+ {"mongodb_cmd", (cmd_function)w_mongodb_cmd, 5,
+ fixup_mongodb_cmd, 0, ANY_ROUTE},
+ {"mongodb_free", (cmd_function)w_mongodb_free_reply, 1,
+ fixup_spve_null, 0, ANY_ROUTE},
+ {"mongodb_next", (cmd_function)w_mongodb_next_reply, 1,
+ fixup_spve_null, 0, ANY_ROUTE},
+ {"bind_ndb_mongodb", (cmd_function)bind_ndb_mongodb, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0}
+};
static param_export_t params[] = {
- {"server", PARAM_STRING | PARAM_USE_FUNC, (void *)mongodb_srv_param},
- {0, 0, 0}};
+ {"server", PARAM_STRING | PARAM_USE_FUNC, (void *)mongodb_srv_param},
+ {0, 0, 0}
+};
struct module_exports exports = {
- "ndb_mongodb", /* module name */
- DEFAULT_DLFLAGS, /* dlopen flags */
- cmds, /*��exported��functions��*/
- params, /*��exported��params��*/
- 0, /*��exported��RPC��methods��*/
- mod_pvs, /* exported pseudo-variables */
- 0, /* response function */
- 0, /* module��initialization��function */
- child_init, /* per child init function */
- mod_destroy /* destroy function */
+ "ndb_mongodb", /* module name */
+ DEFAULT_DLFLAGS, /* dlopen flags */
+ cmds, /*��exported��functions��*/
+ params, /*��exported��params��*/
+ 0, /*��exported��RPC��methods��*/
+ mod_pvs, /* exported pseudo-variables */
+ 0, /* response function */
+ 0, /* module��initialization��function */
+ child_init, /* per child init function */
+ mod_destroy /* destroy function */
};
-
+/* clang-format on */
/* each child get a new connection to the database */
static int child_init(int rank)