diff options
author | Haru <haru@dotalux.com> | 2019-10-20 17:43:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-20 17:43:44 +0200 |
commit | 275edef51c858e9e55934ec3af92ec19db74f3d3 (patch) | |
tree | 81c4367dfb4d51fec9c71c2a407f502a514b6a67 /src/plugins | |
parent | ddd0e461fb8e451912a6aee90869023e2c2d8272 (diff) | |
parent | be955e59bcd950d6430189a8a23a608927665c02 (diff) | |
download | hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.gz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.bz2 hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.xz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.zip |
Merge pull request #2547 from guilherme-gm/201910-dehardcode-db
Dehardcode DB files path
Diffstat (limited to 'src/plugins')
10 files changed, 322 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 31e0ca536..389d273e3 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4180,6 +4180,10 @@ typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_CHARSERVERCONNEC typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_CHARSERVERCONNECT) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd); #endif // LOGIN_LCLIF_P_H #ifdef COMMON_CONF_H /* libconfig */ +typedef void (*HPMHOOK_pre_libconfig_set_db_path) (const char **db_path); +typedef void (*HPMHOOK_post_libconfig_set_db_path) (const char *db_path); +typedef void (*HPMHOOK_pre_libconfig_format_db_path) (const char **filename, char **path_buf, int *buffer_len); +typedef void (*HPMHOOK_post_libconfig_format_db_path) (const char *filename, char *path_buf, int buffer_len); typedef int (*HPMHOOK_pre_libconfig_read) (struct config_t **config, FILE **stream); typedef int (*HPMHOOK_post_libconfig_read) (int retVal___, struct config_t *config, FILE *stream); typedef void (*HPMHOOK_pre_libconfig_write) (const struct config_t **config, FILE **stream); @@ -5146,6 +5150,10 @@ typedef int (*HPMHOOK_pre_mapif_parse_ClanMemberCount) (int *fd, int *clan_id, i typedef int (*HPMHOOK_post_mapif_parse_ClanMemberCount) (int retVal___, int fd, int clan_id, int kick_interval); #endif // CHAR_MAPIF_H #ifdef COMMON_MAPINDEX_H /* mapindex */ +typedef bool (*HPMHOOK_pre_mapindex_config_read_dbpath) (const char **filename, const struct config_t **config); +typedef bool (*HPMHOOK_post_mapindex_config_read_dbpath) (bool retVal___, const char *filename, const struct config_t *config); +typedef bool (*HPMHOOK_pre_mapindex_config_read) (void); +typedef bool (*HPMHOOK_post_mapindex_config_read) (bool retVal___); typedef int (*HPMHOOK_pre_mapindex_init) (void); typedef int (*HPMHOOK_post_mapindex_init) (int retVal___); typedef void (*HPMHOOK_pre_mapindex_final) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index a5f65654e..cdba77e09 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -778,6 +778,10 @@ struct { struct HPMHookPoint *HP_inter_storage_parse_frommap_post; struct HPMHookPoint *HP_inter_storage_retrieve_bound_items_pre; struct HPMHookPoint *HP_inter_storage_retrieve_bound_items_post; + struct HPMHookPoint *HP_libconfig_set_db_path_pre; + struct HPMHookPoint *HP_libconfig_set_db_path_post; + struct HPMHookPoint *HP_libconfig_format_db_path_pre; + struct HPMHookPoint *HP_libconfig_format_db_path_post; struct HPMHookPoint *HP_libconfig_read_pre; struct HPMHookPoint *HP_libconfig_read_post; struct HPMHookPoint *HP_libconfig_write_pre; @@ -1252,6 +1256,10 @@ struct { struct HPMHookPoint *HP_mapif_parse_ClanMemberKick_post; struct HPMHookPoint *HP_mapif_parse_ClanMemberCount_pre; struct HPMHookPoint *HP_mapif_parse_ClanMemberCount_post; + struct HPMHookPoint *HP_mapindex_config_read_dbpath_pre; + struct HPMHookPoint *HP_mapindex_config_read_dbpath_post; + struct HPMHookPoint *HP_mapindex_config_read_pre; + struct HPMHookPoint *HP_mapindex_config_read_post; struct HPMHookPoint *HP_mapindex_init_pre; struct HPMHookPoint *HP_mapindex_init_post; struct HPMHookPoint *HP_mapindex_final_pre; @@ -2391,6 +2399,10 @@ struct { int HP_inter_storage_parse_frommap_post; int HP_inter_storage_retrieve_bound_items_pre; int HP_inter_storage_retrieve_bound_items_post; + int HP_libconfig_set_db_path_pre; + int HP_libconfig_set_db_path_post; + int HP_libconfig_format_db_path_pre; + int HP_libconfig_format_db_path_post; int HP_libconfig_read_pre; int HP_libconfig_read_post; int HP_libconfig_write_pre; @@ -2865,6 +2877,10 @@ struct { int HP_mapif_parse_ClanMemberKick_post; int HP_mapif_parse_ClanMemberCount_pre; int HP_mapif_parse_ClanMemberCount_post; + int HP_mapindex_config_read_dbpath_pre; + int HP_mapindex_config_read_dbpath_post; + int HP_mapindex_config_read_pre; + int HP_mapindex_config_read_post; int HP_mapindex_init_pre; int HP_mapindex_init_post; int HP_mapindex_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index efd72b670..a6043756d 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -425,6 +425,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter_storage->parse_frommap, HP_inter_storage_parse_frommap) }, { HP_POP(inter_storage->retrieve_bound_items, HP_inter_storage_retrieve_bound_items) }, /* libconfig_interface */ + { HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) }, + { HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) }, { HP_POP(libconfig->read, HP_libconfig_read) }, { HP_POP(libconfig->write, HP_libconfig_write) }, { HP_POP(libconfig->set_options, HP_libconfig_set_options) }, @@ -665,6 +667,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mapif->parse_ClanMemberKick, HP_mapif_parse_ClanMemberKick) }, { HP_POP(mapif->parse_ClanMemberCount, HP_mapif_parse_ClanMemberCount) }, /* mapindex_interface */ + { HP_POP(mapindex->config_read_dbpath, HP_mapindex_config_read_dbpath) }, + { HP_POP(mapindex->config_read, HP_mapindex_config_read) }, { HP_POP(mapindex->init, HP_mapindex_init) }, { HP_POP(mapindex->final, HP_mapindex_final) }, { HP_POP(mapindex->addmap, HP_mapindex_addmap) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 7ce54d288..b25025b1d 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -10116,6 +10116,58 @@ bool HP_inter_storage_retrieve_bound_items(int char_id, int account_id, int guil return retVal___; } /* libconfig_interface */ +void HP_libconfig_set_db_path(const char *db_path) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_set_db_path_pre > 0) { + void (*preHookFunc) (const char **db_path); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_set_db_path_pre[hIndex].func; + preHookFunc(&db_path); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.set_db_path(db_path); + } + if (HPMHooks.count.HP_libconfig_set_db_path_post > 0) { + void (*postHookFunc) (const char *db_path); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_set_db_path_post[hIndex].func; + postHookFunc(db_path); + } + } + return; +} +void HP_libconfig_format_db_path(const char *filename, char *path_buf, int buffer_len) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_format_db_path_pre > 0) { + void (*preHookFunc) (const char **filename, char **path_buf, int *buffer_len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_format_db_path_pre[hIndex].func; + preHookFunc(&filename, &path_buf, &buffer_len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.format_db_path(filename, path_buf, buffer_len); + } + if (HPMHooks.count.HP_libconfig_format_db_path_post > 0) { + void (*postHookFunc) (const char *filename, char *path_buf, int buffer_len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_format_db_path_post[hIndex].func; + postHookFunc(filename, path_buf, buffer_len); + } + } + return; +} int HP_libconfig_read(struct config_t *config, FILE *stream) { int hIndex = 0; int retVal___ = 0; @@ -16415,6 +16467,60 @@ int HP_mapif_parse_ClanMemberCount(int fd, int clan_id, int kick_interval) { return retVal___; } /* mapindex_interface */ +bool HP_mapindex_config_read_dbpath(const char *filename, const struct config_t *config) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapindex_config_read_dbpath_pre > 0) { + bool (*preHookFunc) (const char **filename, const struct config_t **config); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapindex.config_read_dbpath(filename, config); + } + if (HPMHooks.count.HP_mapindex_config_read_dbpath_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config); + } + } + return retVal___; +} +bool HP_mapindex_config_read(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapindex_config_read_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapindex_config_read_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapindex.config_read(); + } + if (HPMHooks.count.HP_mapindex_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapindex_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} int HP_mapindex_init(void) { int hIndex = 0; int retVal___ = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index ba0fe05c2..556757d76 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -212,6 +212,10 @@ struct { struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_post; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre; struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post; + struct HPMHookPoint *HP_libconfig_set_db_path_pre; + struct HPMHookPoint *HP_libconfig_set_db_path_post; + struct HPMHookPoint *HP_libconfig_format_db_path_pre; + struct HPMHookPoint *HP_libconfig_format_db_path_post; struct HPMHookPoint *HP_libconfig_read_pre; struct HPMHookPoint *HP_libconfig_read_post; struct HPMHookPoint *HP_libconfig_write_pre; @@ -1013,6 +1017,10 @@ struct { int HP_PRIV__lclif_parse_CA_REQ_HASH_post; int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre; int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post; + int HP_libconfig_set_db_path_pre; + int HP_libconfig_set_db_path_post; + int HP_libconfig_format_db_path_pre; + int HP_libconfig_format_db_path_post; int HP_libconfig_read_pre; int HP_libconfig_read_post; int HP_libconfig_write_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 1e3548621..65680e072 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -131,6 +131,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(lclif->p->parse_CA_REQ_HASH, HP_PRIV__lclif_parse_CA_REQ_HASH) }, { HP_POP(lclif->p->parse_CA_CHARSERVERCONNECT, HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT) }, /* libconfig_interface */ + { HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) }, + { HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) }, { HP_POP(libconfig->read, HP_libconfig_read) }, { HP_POP(libconfig->write, HP_libconfig_write) }, { HP_POP(libconfig->set_options, HP_libconfig_set_options) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 080fb75ff..8f6076e2a 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -2518,6 +2518,58 @@ enum parsefunc_rcode HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT(int fd, struct lo return retVal___; } /* libconfig_interface */ +void HP_libconfig_set_db_path(const char *db_path) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_set_db_path_pre > 0) { + void (*preHookFunc) (const char **db_path); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_set_db_path_pre[hIndex].func; + preHookFunc(&db_path); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.set_db_path(db_path); + } + if (HPMHooks.count.HP_libconfig_set_db_path_post > 0) { + void (*postHookFunc) (const char *db_path); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_set_db_path_post[hIndex].func; + postHookFunc(db_path); + } + } + return; +} +void HP_libconfig_format_db_path(const char *filename, char *path_buf, int buffer_len) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_format_db_path_pre > 0) { + void (*preHookFunc) (const char **filename, char **path_buf, int *buffer_len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_format_db_path_pre[hIndex].func; + preHookFunc(&filename, &path_buf, &buffer_len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.format_db_path(filename, path_buf, buffer_len); + } + if (HPMHooks.count.HP_libconfig_format_db_path_post > 0) { + void (*postHookFunc) (const char *filename, char *path_buf, int buffer_len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_format_db_path_post[hIndex].func; + postHookFunc(filename, path_buf, buffer_len); + } + } + return; +} int HP_libconfig_read(struct config_t *config, FILE *stream) { int hIndex = 0; int retVal___ = 0; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 42ab189f1..1196e3a99 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3288,6 +3288,10 @@ struct { struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_post; struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre; struct HPMHookPoint *HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post; + struct HPMHookPoint *HP_libconfig_set_db_path_pre; + struct HPMHookPoint *HP_libconfig_set_db_path_post; + struct HPMHookPoint *HP_libconfig_format_db_path_pre; + struct HPMHookPoint *HP_libconfig_format_db_path_post; struct HPMHookPoint *HP_libconfig_read_pre; struct HPMHookPoint *HP_libconfig_read_post; struct HPMHookPoint *HP_libconfig_write_pre; @@ -3758,6 +3762,10 @@ struct { struct HPMHookPoint *HP_map_merge_zone_post; struct HPMHookPoint *HP_map_zone_clear_single_pre; struct HPMHookPoint *HP_map_zone_clear_single_post; + struct HPMHookPoint *HP_mapindex_config_read_dbpath_pre; + struct HPMHookPoint *HP_mapindex_config_read_dbpath_post; + struct HPMHookPoint *HP_mapindex_config_read_pre; + struct HPMHookPoint *HP_mapindex_config_read_post; struct HPMHookPoint *HP_mapindex_init_pre; struct HPMHookPoint *HP_mapindex_init_post; struct HPMHookPoint *HP_mapindex_final_pre; @@ -10109,6 +10117,10 @@ struct { int HP_itemdb_read_libconfig_lapineddukddak_sub_post; int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_pre; int HP_itemdb_read_libconfig_lapineddukddak_sub_sources_post; + int HP_libconfig_set_db_path_pre; + int HP_libconfig_set_db_path_post; + int HP_libconfig_format_db_path_pre; + int HP_libconfig_format_db_path_post; int HP_libconfig_read_pre; int HP_libconfig_read_post; int HP_libconfig_write_pre; @@ -10579,6 +10591,10 @@ struct { int HP_map_merge_zone_post; int HP_map_zone_clear_single_pre; int HP_map_zone_clear_single_post; + int HP_mapindex_config_read_dbpath_pre; + int HP_mapindex_config_read_dbpath_post; + int HP_mapindex_config_read_pre; + int HP_mapindex_config_read_post; int HP_mapindex_init_pre; int HP_mapindex_init_post; int HP_mapindex_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index e6dcdec42..da72b688a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1684,6 +1684,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->read_libconfig_lapineddukddak_sub, HP_itemdb_read_libconfig_lapineddukddak_sub) }, { HP_POP(itemdb->read_libconfig_lapineddukddak_sub_sources, HP_itemdb_read_libconfig_lapineddukddak_sub_sources) }, /* libconfig_interface */ + { HP_POP(libconfig->set_db_path, HP_libconfig_set_db_path) }, + { HP_POP(libconfig->format_db_path, HP_libconfig_format_db_path) }, { HP_POP(libconfig->read, HP_libconfig_read) }, { HP_POP(libconfig->write, HP_libconfig_write) }, { HP_POP(libconfig->set_options, HP_libconfig_set_options) }, @@ -1923,6 +1925,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->merge_zone, HP_map_merge_zone) }, { HP_POP(map->zone_clear_single, HP_map_zone_clear_single) }, /* mapindex_interface */ + { HP_POP(mapindex->config_read_dbpath, HP_mapindex_config_read_dbpath) }, + { HP_POP(mapindex->config_read, HP_mapindex_config_read) }, { HP_POP(mapindex->init, HP_mapindex_init) }, { HP_POP(mapindex->final, HP_mapindex_final) }, { HP_POP(mapindex->addmap, HP_mapindex_addmap) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 8eefa292a..c331d66a9 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -43260,6 +43260,58 @@ bool HP_itemdb_read_libconfig_lapineddukddak_sub_sources(struct config_setting_t return retVal___; } /* libconfig_interface */ +void HP_libconfig_set_db_path(const char *db_path) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_set_db_path_pre > 0) { + void (*preHookFunc) (const char **db_path); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_set_db_path_pre[hIndex].func; + preHookFunc(&db_path); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.set_db_path(db_path); + } + if (HPMHooks.count.HP_libconfig_set_db_path_post > 0) { + void (*postHookFunc) (const char *db_path); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_set_db_path_post[hIndex].func; + postHookFunc(db_path); + } + } + return; +} +void HP_libconfig_format_db_path(const char *filename, char *path_buf, int buffer_len) { + int hIndex = 0; + if (HPMHooks.count.HP_libconfig_format_db_path_pre > 0) { + void (*preHookFunc) (const char **filename, char **path_buf, int *buffer_len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_libconfig_format_db_path_pre[hIndex].func; + preHookFunc(&filename, &path_buf, &buffer_len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.libconfig.format_db_path(filename, path_buf, buffer_len); + } + if (HPMHooks.count.HP_libconfig_format_db_path_post > 0) { + void (*postHookFunc) (const char *filename, char *path_buf, int buffer_len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_format_db_path_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_libconfig_format_db_path_post[hIndex].func; + postHookFunc(filename, path_buf, buffer_len); + } + } + return; +} int HP_libconfig_read(struct config_t *config, FILE *stream) { int hIndex = 0; int retVal___ = 0; @@ -49689,6 +49741,60 @@ void HP_map_zone_clear_single(struct map_zone_data *zone) { return; } /* mapindex_interface */ +bool HP_mapindex_config_read_dbpath(const char *filename, const struct config_t *config) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapindex_config_read_dbpath_pre > 0) { + bool (*preHookFunc) (const char **filename, const struct config_t **config); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapindex.config_read_dbpath(filename, config); + } + if (HPMHooks.count.HP_mapindex_config_read_dbpath_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_dbpath_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapindex_config_read_dbpath_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config); + } + } + return retVal___; +} +bool HP_mapindex_config_read(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mapindex_config_read_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mapindex_config_read_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mapindex.config_read(); + } + if (HPMHooks.count.HP_mapindex_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mapindex_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} int HP_mapindex_init(void) { int hIndex = 0; int retVal___ = 0; |