Module: kamailio Branch: master Commit: 66bf2498be1d524a3c56af9f2477f7e368090482 URL: https://github.com/kamailio/kamailio/commit/66bf2498be1d524a3c56af9f2477f7e368090482
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2025-12-08T14:57:40+01:00 htable: export the db-related functions to inter-modules API - GH #4457 --- Modified: src/modules/htable/api.c Modified: src/modules/htable/api.h --- Diff: https://github.com/kamailio/kamailio/commit/66bf2498be1d524a3c56af9f2477f7e368090482.diff Patch: https://github.com/kamailio/kamailio/commit/66bf2498be1d524a3c56af9f2477f7e368090482.patch --- diff --git a/src/modules/htable/api.c b/src/modules/htable/api.c index 94095d3d5d4..1c07170a845 100644 --- a/src/modules/htable/api.c +++ b/src/modules/htable/api.c @@ -26,8 +26,9 @@ #include "../../core/dprint.h" #include "ht_api.h" -#include "api.h" +#include "ht_db.h" #include "ht_dmq.h" +#include "api.h" /** * @@ -166,6 +167,7 @@ int bind_htable(htable_api_t *api) ERR("Invalid parameter value\n"); return -1; } + api->table_spec = ht_api_table_spec; api->init_tables = ht_api_init_tables; api->set = ht_api_set_cell; @@ -175,5 +177,10 @@ int bind_htable(htable_api_t *api) api->get_expire = ht_api_get_cell_expire; api->rm_re = ht_api_rm_cell_re; api->count_re = ht_api_count_cells_re; + api->db_open_con = ht_db_open_con; + api->db_close_con = ht_db_close_con; + api->db_load_tables = ht_db_load_tables; + api->db_sync_tables = ht_db_sync_tables; + return 0; } diff --git a/src/modules/htable/api.h b/src/modules/htable/api.h index 8f67e5ca71a..5fd4e80177f 100644 --- a/src/modules/htable/api.h +++ b/src/modules/htable/api.h @@ -40,6 +40,11 @@ typedef int (*ht_api_get_cell_expire_f)( typedef int (*ht_api_rm_cell_re_f)(str *hname, str *sre, int mode); typedef int (*ht_api_count_cells_re_f)(str *hname, str *sre, int mode); +typedef int (*ht_api_db_open_con_f)(void); +typedef int (*ht_api_db_close_con_f)(void); +typedef int (*ht_api_db_load_tables_f)(void); +typedef int (*ht_api_db_sync_tables_f)(void); + typedef struct htable_api { ht_api_table_spec_f table_spec; @@ -51,6 +56,10 @@ typedef struct htable_api ht_api_get_cell_expire_f get_expire; ht_api_rm_cell_re_f rm_re; ht_api_count_cells_re_f count_re; + ht_api_db_open_con_f db_open_con; + ht_api_db_close_con_f db_close_con; + ht_api_db_load_tables_f db_load_tables; + ht_api_db_sync_tables_f db_sync_tables; } htable_api_t; typedef int (*bind_htable_f)(htable_api_t *api); _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
