Module: kamailio
Branch: master
Commit: dce9c2a572ff1f1be1e4d97ff083a1c2f0fc773c
URL:
https://github.com/kamailio/kamailio/commit/dce9c2a572ff1f1be1e4d97ff083a1c…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-21T19:20:03+01:00
sqlops: reformat exported structures
---
Modified: src/modules/sqlops/sqlops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/dce9c2a572ff1f1be1e4d97ff083a1c…
Patch:
https://github.com/kamailio/kamailio/commit/dce9c2a572ff1f1be1e4d97ff083a1c…
---
diff --git a/src/modules/sqlops/sqlops.c b/src/modules/sqlops/sqlops.c
index 7db7303851f..fbf8c3e2b7c 100644
--- a/src/modules/sqlops/sqlops.c
+++ b/src/modules/sqlops/sqlops.c
@@ -81,53 +81,53 @@ int sqlops_log_buf_size = 128;
static int sqlops_connect_mode = 0;
+/* clang-format off */
static pv_export_t mod_pvs[] = {
- {{"dbr", sizeof("dbr") - 1}, PVT_OTHER, pv_get_dbr, 0,
- pv_parse_dbr_name, 0, 0, 0},
- {{"sqlrows", sizeof("sqlrows") - 1}, PVT_OTHER, pv_get_sqlrows, 0,
- pv_parse_con_name, 0, 0, 0},
- {{0, 0}, 0, 0, 0, 0, 0, 0, 0}};
-
-static cmd_export_t cmds[] = {{"sql_query", (cmd_function)sql_query, 3,
- fixup_sql_query, 0, ANY_ROUTE},
- {"sql_query", (cmd_function)sql_query2, 2, fixup_sql_query, 0,
- ANY_ROUTE},
- {"sql_query_async", (cmd_function)sql_query_async, 2, fixup_sql_query,
- 0, ANY_ROUTE},
- {"sql_xquery", (cmd_function)sql_xquery, 3, fixup_sql_xquery, 0,
- ANY_ROUTE},
- {"sql_pvquery", (cmd_function)sql_pvquery, 3, fixup_sql_pvquery, 0,
- ANY_ROUTE},
- {"sql_result_free", (cmd_function)sql_rfree, 1, fixup_sql_rfree, 0,
- ANY_ROUTE},
- {"bind_sqlops", (cmd_function)bind_sqlops, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0}};
+ {{"dbr", sizeof("dbr") - 1}, PVT_OTHER, pv_get_dbr, 0,
pv_parse_dbr_name, 0, 0, 0},
+ {{"sqlrows", sizeof("sqlrows") - 1}, PVT_OTHER, pv_get_sqlrows, 0,
pv_parse_con_name, 0, 0, 0},
+ {{0, 0}, 0, 0, 0, 0, 0, 0, 0}
+};
+
+static cmd_export_t cmds[] = {
+ {"sql_query", (cmd_function)sql_query, 3, fixup_sql_query, 0, ANY_ROUTE},
+ {"sql_query", (cmd_function)sql_query2, 2, fixup_sql_query, 0, ANY_ROUTE},
+ {"sql_query_async", (cmd_function)sql_query_async, 2, fixup_sql_query, 0,
ANY_ROUTE},
+ {"sql_xquery", (cmd_function)sql_xquery, 3, fixup_sql_xquery, 0, ANY_ROUTE},
+ {"sql_pvquery", (cmd_function)sql_pvquery, 3, fixup_sql_pvquery,
0, ANY_ROUTE},
+ {"sql_result_free", (cmd_function)sql_rfree, 1, fixup_sql_rfree, 0,
ANY_ROUTE},
+ {"bind_sqlops", (cmd_function)bind_sqlops, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0}
+};
static param_export_t params[] = {
- {"sqlcon", PARAM_STRING | PARAM_USE_FUNC, (void *)sql_con_param},
- {"sqlres", PARAM_STRING | PARAM_USE_FUNC, (void *)sql_res_param},
- {"tr_buf_size", PARAM_INT, &sqlops_tr_buf_size},
- {"log_buf_size", PARAM_INT, &sqlops_log_buf_size},
- {"connect_mode", PARAM_INT, &sqlops_connect_mode},
- {"results_maxsize", PARAM_INT, &sqlops_results_maxsize}, {0, 0, 0}};
+ {"sqlcon", PARAM_STRING | PARAM_USE_FUNC, (void *)sql_con_param},
+ {"sqlres", PARAM_STRING | PARAM_USE_FUNC, (void *)sql_res_param},
+ {"tr_buf_size", PARAM_INT, &sqlops_tr_buf_size},
+ {"log_buf_size", PARAM_INT, &sqlops_log_buf_size},
+ {"connect_mode", PARAM_INT, &sqlops_connect_mode},
+ {"results_maxsize", PARAM_INT, &sqlops_results_maxsize},
+ {0, 0, 0}
+};
static tr_export_t mod_trans[] = {
- {{"sql", sizeof("sql") - 1}, tr_parse_sql}, {{0, 0}, 0}};
-
+ {{"sql", sizeof("sql") - 1}, tr_parse_sql},
+ {{0, 0}, 0}
+};
/** module exports */
struct module_exports exports = {
- "sqlops", /* module name */
- DEFAULT_DLFLAGS, /* dlopen flags */
- cmds, /* exported functions */
- params, /* exported parameters */
- 0, /* exported rpc functions */
- mod_pvs, /* exported pseudo-variables */
- 0, /* response handling function */
- mod_init, /* module init function */
- child_init, /* per-child init function */
- destroy /* module destroy function */
+ "sqlops", /* module name */
+ DEFAULT_DLFLAGS, /* dlopen flags */
+ cmds, /* exported functions */
+ params, /* exported parameters */
+ 0, /* exported rpc functions */
+ mod_pvs, /* exported pseudo-variables */
+ 0, /* response handling function */
+ mod_init, /* module init function */
+ child_init, /* per-child init function */
+ destroy /* module destroy function */
};
+/* clang-format on */
static int mod_init(void)
{