Module: kamailio
Branch: master
Commit: ef8d71197442ffd130a6e80ca147b5feb6c316a4
URL:
https://github.com/kamailio/kamailio/commit/ef8d71197442ffd130a6e80ca147b5f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-12T09:33:17+02:00
pdf: reformat export structures
---
Modified: src/modules/pdt/pdt.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ef8d71197442ffd130a6e80ca147b5f…
Patch:
https://github.com/kamailio/kamailio/commit/ef8d71197442ffd130a6e80ca147b5f…
---
diff --git a/src/modules/pdt/pdt.c b/src/modules/pdt/pdt.c
index 252a275917c..22d5f663067 100644
--- a/src/modules/pdt/pdt.c
+++ b/src/modules/pdt/pdt.c
@@ -95,40 +95,46 @@ static int fixup_translate(void **param, int param_no);
static int update_new_uri(struct sip_msg *msg, int plen, str *d, int mode);
static int pdt_init_rpc(void);
-static cmd_export_t cmds[] = {{"prefix2domain", (cmd_function)w_prefix2domain,
- 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE},
- {"prefix2domain", (cmd_function)w_prefix2domain_1, 1, fixup_igp_null, 0,
- REQUEST_ROUTE | FAILURE_ROUTE},
- {"prefix2domain", (cmd_function)w_prefix2domain_2, 2, fixup_igp_igp, 0,
- REQUEST_ROUTE | FAILURE_ROUTE},
- {"pd_translate", (cmd_function)w_pd_translate, 2, fixup_translate, 0,
- REQUEST_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE},
- {0, 0, 0, 0, 0, 0}};
-
-static param_export_t params[] = {{"db_url", PARAM_STR, &db_url},
- {"db_table", PARAM_STR, &db_table},
- {"sdomain_column", PARAM_STR, &sdomain_column},
- {"prefix_column", PARAM_STR, &prefix_column},
- {"domain_column", PARAM_STR, &domain_column},
- {"prefix", PARAM_STR, &pdt_prefix},
- {"char_list", PARAM_STR, &pdt_char_list},
- {"fetch_rows", INT_PARAM, &pdt_fetch_rows},
- {"check_domain", INT_PARAM, &pdt_check_domain}, {0, 0, 0}};
+/* clang-format off */
+static cmd_export_t cmds[] = {
+ {"prefix2domain", (cmd_function)w_prefix2domain,
+ 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE},
+ {"prefix2domain", (cmd_function)w_prefix2domain_1, 1, fixup_igp_null, 0,
+ REQUEST_ROUTE | FAILURE_ROUTE},
+ {"prefix2domain", (cmd_function)w_prefix2domain_2, 2, fixup_igp_igp, 0,
+ REQUEST_ROUTE | FAILURE_ROUTE},
+ {"pd_translate", (cmd_function)w_pd_translate, 2, fixup_translate, 0,
+ REQUEST_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE},
+ {0, 0, 0, 0, 0, 0}
+};
+
+static param_export_t params[] = {
+ {"db_url", PARAM_STR, &db_url},
+ {"db_table", PARAM_STR, &db_table},
+ {"sdomain_column", PARAM_STR, &sdomain_column},
+ {"prefix_column", PARAM_STR, &prefix_column},
+ {"domain_column", PARAM_STR, &domain_column},
+ {"prefix", PARAM_STR, &pdt_prefix},
+ {"char_list", PARAM_STR, &pdt_char_list},
+ {"fetch_rows", INT_PARAM, &pdt_fetch_rows},
+ {"check_domain", INT_PARAM, &pdt_check_domain},
+ {0, 0, 0}
+};
struct module_exports exports = {
- "pdt", /* module name */
- DEFAULT_DLFLAGS, /* dlopen flags */
- cmds, /* cmd exports */
- params, /* param exports */
- 0, /* RPC method exports */
- 0, /* exported pseudo-variables */
- 0, /* response function */
- mod_init, /* module initialization function */
- child_init, /* per child init function */
- mod_destroy /* destroy function */
+ "pdt", /* module name */
+ DEFAULT_DLFLAGS, /* dlopen flags */
+ cmds, /* cmd exports */
+ params, /* param exports */
+ 0, /* RPC method exports */
+ 0, /* exported pseudo-variables */
+ 0, /* response function */
+ mod_init, /* module initialization function */
+ child_init, /* per child init function */
+ mod_destroy /* destroy function */
};
-
+/* clang-format on */
/**
* init module function
@@ -846,9 +852,13 @@ static void pdt_rpc_list(rpc_t *rpc, void *ctx)
}
+/* clang-format off */
rpc_export_t pdt_rpc_cmds[] = {
- {"pdt.reload", pdt_rpc_reload, pdt_rpc_reload_doc, 0},
- {"pdt.list", pdt_rpc_list, pdt_rpc_list_doc, 0}, {0, 0, 0, 0}};
+ {"pdt.reload", pdt_rpc_reload, pdt_rpc_reload_doc, 0},
+ {"pdt.list", pdt_rpc_list, pdt_rpc_list_doc, 0},
+ {0, 0, 0, 0}
+};
+/* clang-format on */
/**