summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-10-20 17:43:44 +0200
committerGitHub <noreply@github.com>2019-10-20 17:43:44 +0200
commit275edef51c858e9e55934ec3af92ec19db74f3d3 (patch)
tree81c4367dfb4d51fec9c71c2a407f502a514b6a67 /src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
parentddd0e461fb8e451912a6aee90869023e2c2d8272 (diff)
parentbe955e59bcd950d6430189a8a23a608927665c02 (diff)
downloadhercules-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/HPMHooking/HPMHooking_login.Hooks.inc')
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc52
1 files changed, 52 insertions, 0 deletions
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;