From 86a06df0f10aa857402a6f7f4afe63d63c05e7da Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Feb 2018 21:54:48 +0300 Subject: Update HPM hooks. --- src/plugins/HPMHooking/HPMHooking_login.Hooks.inc | 1895 ++++++++++++++++----- 1 file changed, 1470 insertions(+), 425 deletions(-) (limited to 'src/plugins/HPMHooking/HPMHooking_login.Hooks.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 658ee874d..e432da70d 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -106,41 +106,42 @@ FILE* HP_HCache_open(const char *file, const char *opt) { } return retVal___; } -/* cmdline_interface */ -void HP_cmdline_init(void) { +/* account_interface */ +struct Sql* HP_account_db_sql_up(AccountDB *self) { int hIndex = 0; - if (HPMHooks.count.HP_cmdline_init_pre > 0) { - void (*preHookFunc) (void); + struct Sql* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_up_pre > 0) { + struct Sql* (*preHookFunc) (AccountDB **self); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_init_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_up_pre[hIndex].func; + retVal___ = preHookFunc(&self); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.cmdline.init(); + retVal___ = HPMHooks.source.account.db_sql_up(self); } - if (HPMHooks.count.HP_cmdline_init_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_init_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_up_post > 0) { + struct Sql* (*postHookFunc) (struct Sql* retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_up_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_up_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); } } - return; + return retVal___; } -void HP_cmdline_final(void) { +void HP_account_mmo_send_accreg2(AccountDB *self, int fd, int account_id, int char_id) { int hIndex = 0; - if (HPMHooks.count.HP_cmdline_final_pre > 0) { - void (*preHookFunc) (void); + if (HPMHooks.count.HP_account_mmo_send_accreg2_pre > 0) { + void (*preHookFunc) (AccountDB **self, int *fd, int *account_id, int *char_id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_final_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_send_accreg2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_send_accreg2_pre[hIndex].func; + preHookFunc(&self, &fd, &account_id, &char_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -148,53 +149,52 @@ void HP_cmdline_final(void) { } } { - HPMHooks.source.cmdline.final(); + HPMHooks.source.account.mmo_send_accreg2(self, fd, account_id, char_id); } - if (HPMHooks.count.HP_cmdline_final_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_final_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_mmo_send_accreg2_post > 0) { + void (*postHookFunc) (AccountDB *self, int fd, int account_id, int char_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_send_accreg2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_send_accreg2_post[hIndex].func; + postHookFunc(self, fd, account_id, char_id); } } return; } -bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) { +void HP_account_mmo_save_accreg2(AccountDB *self, int fd, int account_id, int char_id) { int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_cmdline_arg_add_pre > 0) { - bool (*preHookFunc) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options); + if (HPMHooks.count.HP_account_mmo_save_accreg2_pre > 0) { + void (*preHookFunc) (AccountDB **self, int *fd, int *account_id, int *char_id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_arg_add_pre[hIndex].func; - retVal___ = preHookFunc(&pluginID, &name, &shortname, &func, &help, &options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_save_accreg2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_save_accreg2_pre[hIndex].func; + preHookFunc(&self, &fd, &account_id, &char_id); } if (*HPMforce_return) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.cmdline.arg_add(pluginID, name, shortname, func, help, options); + HPMHooks.source.account.mmo_save_accreg2(self, fd, account_id, char_id); } - if (HPMHooks.count.HP_cmdline_arg_add_post > 0) { - bool (*postHookFunc) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_arg_add_post[hIndex].func; - retVal___ = postHookFunc(retVal___, pluginID, name, shortname, func, help, options); + if (HPMHooks.count.HP_account_mmo_save_accreg2_post > 0) { + void (*postHookFunc) (AccountDB *self, int fd, int account_id, int char_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_save_accreg2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_save_accreg2_post[hIndex].func; + postHookFunc(self, fd, account_id, char_id); } } - return retVal___; + return; } -int HP_cmdline_exec(int argc, char **argv, unsigned int options) { +bool HP_account_mmo_auth_fromsql(AccountDB_SQL *db, struct mmo_account *acc, int account_id) { int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_cmdline_exec_pre > 0) { - int (*preHookFunc) (int *argc, char ***argv, unsigned int *options); + bool retVal___ = false; + if (HPMHooks.count.HP_account_mmo_auth_fromsql_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, struct mmo_account **acc, int *account_id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_exec_pre[hIndex].func; - retVal___ = preHookFunc(&argc, &argv, &options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_fromsql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_auth_fromsql_pre[hIndex].func; + retVal___ = preHookFunc(&db, &acc, &account_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -202,26 +202,26 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) { } } { - retVal___ = HPMHooks.source.cmdline.exec(argc, argv, options); + retVal___ = HPMHooks.source.account.mmo_auth_fromsql(db, acc, account_id); } - if (HPMHooks.count.HP_cmdline_exec_post > 0) { - int (*postHookFunc) (int retVal___, int argc, char **argv, unsigned int options); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_exec_post[hIndex].func; - retVal___ = postHookFunc(retVal___, argc, argv, options); + if (HPMHooks.count.HP_account_mmo_auth_fromsql_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, struct mmo_account *acc, int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_fromsql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_auth_fromsql_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, acc, account_id); } } return retVal___; } -bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { +bool HP_account_mmo_auth_tosql(AccountDB_SQL *db, const struct mmo_account *acc, bool is_new) { int hIndex = 0; bool retVal___ = false; - if (HPMHooks.count.HP_cmdline_arg_next_value_pre > 0) { - bool (*preHookFunc) (const char **name, int *current_arg, int *argc); + if (HPMHooks.count.HP_account_mmo_auth_tosql_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, const struct mmo_account **acc, bool *is_new); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_pre[hIndex].func; - retVal___ = preHookFunc(&name, ¤t_arg, &argc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_tosql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_mmo_auth_tosql_pre[hIndex].func; + retVal___ = preHookFunc(&db, &acc, &is_new); } if (*HPMforce_return) { *HPMforce_return = false; @@ -229,26 +229,26 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { } } { - retVal___ = HPMHooks.source.cmdline.arg_next_value(name, current_arg, argc); + retVal___ = HPMHooks.source.account.mmo_auth_tosql(db, acc, is_new); } - if (HPMHooks.count.HP_cmdline_arg_next_value_post > 0) { - bool (*postHookFunc) (bool retVal___, const char *name, int current_arg, int argc); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_post[hIndex].func; - retVal___ = postHookFunc(retVal___, name, current_arg, argc); + if (HPMHooks.count.HP_account_mmo_auth_tosql_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, const struct mmo_account *acc, bool is_new); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_mmo_auth_tosql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_mmo_auth_tosql_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, acc, is_new); } } return retVal___; } -const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { +AccountDB* HP_account_db_sql(void) { int hIndex = 0; - const char* retVal___ = NULL; - if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) { - const char* (*preHookFunc) (struct CmdlineArgData **arg); + AccountDB* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_pre > 0) { + AccountDB* (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func; - retVal___ = preHookFunc(&arg); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_pre[hIndex].func; + retVal___ = preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; @@ -256,52 +256,52 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { } } { - retVal___ = HPMHooks.source.cmdline.arg_source(arg); + retVal___ = HPMHooks.source.account.db_sql(); } - if (HPMHooks.count.HP_cmdline_arg_source_post > 0) { - const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg); - for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func; - retVal___ = postHookFunc(retVal___, arg); + if (HPMHooks.count.HP_account_db_sql_post > 0) { + AccountDB* (*postHookFunc) (AccountDB* retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_post[hIndex].func; + retVal___ = postHookFunc(retVal___); } } return retVal___; } -/* console_interface */ -void HP_console_init(void) { +bool HP_account_db_sql_init(AccountDB *self) { int hIndex = 0; - if (HPMHooks.count.HP_console_init_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_init_pre > 0) { + bool (*preHookFunc) (AccountDB **self); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_console_init_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_init_pre[hIndex].func; + retVal___ = preHookFunc(&self); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.console.init(); + retVal___ = HPMHooks.source.account.db_sql_init(self); } - if (HPMHooks.count.HP_console_init_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_console_init_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_init_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_init_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); } } - return; + return retVal___; } -void HP_console_final(void) { +void HP_account_db_sql_destroy(AccountDB *self) { int hIndex = 0; - if (HPMHooks.count.HP_console_final_pre > 0) { - void (*preHookFunc) (void); + if (HPMHooks.count.HP_account_db_sql_destroy_pre > 0) { + void (*preHookFunc) (AccountDB **self); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_console_final_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_destroy_pre[hIndex].func; + preHookFunc(&self); } if (*HPMforce_return) { *HPMforce_return = false; @@ -309,106 +309,107 @@ void HP_console_final(void) { } } { - HPMHooks.source.console.final(); + HPMHooks.source.account.db_sql_destroy(self); } - if (HPMHooks.count.HP_console_final_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_console_final_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_destroy_post > 0) { + void (*postHookFunc) (AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_destroy_post[hIndex].func; + postHookFunc(self); } } return; } -void HP_console_display_title(void) { +bool HP_account_db_sql_get_property(AccountDB *self, const char *key, char *buf, size_t buflen) { int hIndex = 0; - if (HPMHooks.count.HP_console_display_title_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_get_property_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const char **key, char **buf, size_t *buflen); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_console_display_title_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_get_property_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_get_property_pre[hIndex].func; + retVal___ = preHookFunc(&self, &key, &buf, &buflen); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.console.display_title(); + retVal___ = HPMHooks.source.account.db_sql_get_property(self, key, buf, buflen); } - if (HPMHooks.count.HP_console_display_title_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_console_display_title_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_get_property_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const char *key, char *buf, size_t buflen); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_get_property_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_get_property_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, key, buf, buflen); } } - return; + return retVal___; } -void HP_console_display_gplnotice(void) { +bool HP_account_db_sql_set_property(AccountDB *self, struct config_t *config, bool imported) { int hIndex = 0; - if (HPMHooks.count.HP_console_display_gplnotice_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_set_property_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct config_t **config, bool *imported); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_set_property_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_set_property_pre[hIndex].func; + retVal___ = preHookFunc(&self, &config, &imported); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.console.display_gplnotice(); + retVal___ = HPMHooks.source.account.db_sql_set_property(self, config, imported); } - if (HPMHooks.count.HP_console_display_gplnotice_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_set_property_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_set_property_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_set_property_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, config, imported); } } - return; + return retVal___; } -/* core_interface */ -void HP_core_shutdown_callback(void) { +bool HP_account_db_sql_create(AccountDB *self, struct mmo_account *acc) { int hIndex = 0; - if (HPMHooks.count.HP_core_shutdown_callback_pre > 0) { - void (*preHookFunc) (void); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_create_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_core_shutdown_callback_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_create_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_create_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.core.shutdown_callback(); + retVal___ = HPMHooks.source.account.db_sql_create(self, acc); } - if (HPMHooks.count.HP_core_shutdown_callback_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_core_shutdown_callback_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_account_db_sql_create_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_create_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_create_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); } } - return; + return retVal___; } -/* db_interface */ -enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) { +bool HP_account_db_sql_remove(AccountDB *self, const int account_id) { int hIndex = 0; - enum DBOptions retVal___ = DB_OPT_BASE; - if (HPMHooks.count.HP_DB_fix_options_pre > 0) { - enum DBOptions (*preHookFunc) (enum DBType *type, enum DBOptions *options); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_remove_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const int *account_id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_fix_options_pre[hIndex].func; - retVal___ = preHookFunc(&type, &options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_remove_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_remove_pre[hIndex].func; + retVal___ = preHookFunc(&self, &account_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -416,26 +417,26 @@ enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) { } } { - retVal___ = HPMHooks.source.DB.fix_options(type, options); + retVal___ = HPMHooks.source.account.db_sql_remove(self, account_id); } - if (HPMHooks.count.HP_DB_fix_options_post > 0) { - enum DBOptions (*postHookFunc) (enum DBOptions retVal___, enum DBType type, enum DBOptions options); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_fix_options_post[hIndex].func; - retVal___ = postHookFunc(retVal___, type, options); + if (HPMHooks.count.HP_account_db_sql_remove_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_remove_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_remove_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, account_id); } } return retVal___; } -DBComparator HP_DB_default_cmp(enum DBType type) { +bool HP_account_db_sql_save(AccountDB *self, const struct mmo_account *acc) { int hIndex = 0; - DBComparator retVal___ = NULL; - if (HPMHooks.count.HP_DB_default_cmp_pre > 0) { - DBComparator (*preHookFunc) (enum DBType *type); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_save_pre > 0) { + bool (*preHookFunc) (AccountDB **self, const struct mmo_account **acc); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_default_cmp_pre[hIndex].func; - retVal___ = preHookFunc(&type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_save_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_save_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); } if (*HPMforce_return) { *HPMforce_return = false; @@ -443,26 +444,26 @@ DBComparator HP_DB_default_cmp(enum DBType type) { } } { - retVal___ = HPMHooks.source.DB.default_cmp(type); + retVal___ = HPMHooks.source.account.db_sql_save(self, acc); } - if (HPMHooks.count.HP_DB_default_cmp_post > 0) { - DBComparator (*postHookFunc) (DBComparator retVal___, enum DBType type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_default_cmp_post[hIndex].func; - retVal___ = postHookFunc(retVal___, type); + if (HPMHooks.count.HP_account_db_sql_save_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, const struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_save_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_save_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); } } return retVal___; } -DBHasher HP_DB_default_hash(enum DBType type) { +bool HP_account_db_sql_load_num(AccountDB *self, struct mmo_account *acc, const int account_id) { int hIndex = 0; - DBHasher retVal___ = NULL; - if (HPMHooks.count.HP_DB_default_hash_pre > 0) { - DBHasher (*preHookFunc) (enum DBType *type); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_load_num_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc, const int *account_id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_default_hash_pre[hIndex].func; - retVal___ = preHookFunc(&type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_num_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_load_num_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc, &account_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -470,26 +471,26 @@ DBHasher HP_DB_default_hash(enum DBType type) { } } { - retVal___ = HPMHooks.source.DB.default_hash(type); + retVal___ = HPMHooks.source.account.db_sql_load_num(self, acc, account_id); } - if (HPMHooks.count.HP_DB_default_hash_post > 0) { - DBHasher (*postHookFunc) (DBHasher retVal___, enum DBType type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_default_hash_post[hIndex].func; - retVal___ = postHookFunc(retVal___, type); + if (HPMHooks.count.HP_account_db_sql_load_num_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc, const int account_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_num_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_load_num_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc, account_id); } } return retVal___; } -DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) { +bool HP_account_db_sql_load_str(AccountDB *self, struct mmo_account *acc, const char *userid) { int hIndex = 0; - DBReleaser retVal___ = NULL; - if (HPMHooks.count.HP_DB_default_release_pre > 0) { - DBReleaser (*preHookFunc) (enum DBType *type, enum DBOptions *options); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_load_str_pre > 0) { + bool (*preHookFunc) (AccountDB **self, struct mmo_account **acc, const char **userid); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_default_release_pre[hIndex].func; - retVal___ = preHookFunc(&type, &options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_str_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_load_str_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc, &userid); } if (*HPMforce_return) { *HPMforce_return = false; @@ -497,26 +498,26 @@ DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) { } } { - retVal___ = HPMHooks.source.DB.default_release(type, options); + retVal___ = HPMHooks.source.account.db_sql_load_str(self, acc, userid); } - if (HPMHooks.count.HP_DB_default_release_post > 0) { - DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBType type, enum DBOptions options); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_default_release_post[hIndex].func; - retVal___ = postHookFunc(retVal___, type, options); + if (HPMHooks.count.HP_account_db_sql_load_str_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB *self, struct mmo_account *acc, const char *userid); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_load_str_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_load_str_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc, userid); } } return retVal___; } -DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { +AccountDBIterator* HP_account_db_sql_iterator(AccountDB *self) { int hIndex = 0; - DBReleaser retVal___ = NULL; - if (HPMHooks.count.HP_DB_custom_release_pre > 0) { - DBReleaser (*preHookFunc) (enum DBReleaseOption *which); + AccountDBIterator* retVal___ = NULL; + if (HPMHooks.count.HP_account_db_sql_iterator_pre > 0) { + AccountDBIterator* (*preHookFunc) (AccountDB **self); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_custom_release_pre[hIndex].func; - retVal___ = preHookFunc(&which); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iterator_pre[hIndex].func; + retVal___ = preHookFunc(&self); } if (*HPMforce_return) { *HPMforce_return = false; @@ -524,53 +525,52 @@ DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { } } { - retVal___ = HPMHooks.source.DB.custom_release(which); + retVal___ = HPMHooks.source.account.db_sql_iterator(self); } - if (HPMHooks.count.HP_DB_custom_release_post > 0) { - DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBReleaseOption which); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_custom_release_post[hIndex].func; - retVal___ = postHookFunc(retVal___, which); + if (HPMHooks.count.HP_account_db_sql_iterator_post > 0) { + AccountDBIterator* (*postHookFunc) (AccountDBIterator* retVal___, AccountDB *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iterator_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iterator_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self); } } return retVal___; } -struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { +void HP_account_db_sql_iter_destroy(AccountDBIterator *self) { int hIndex = 0; - struct DBMap* retVal___ = NULL; - if (HPMHooks.count.HP_DB_alloc_pre > 0) { - struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); + if (HPMHooks.count.HP_account_db_sql_iter_destroy_pre > 0) { + void (*preHookFunc) (AccountDBIterator **self); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func; - retVal___ = preHookFunc(&file, &func, &line, &type, &options, &maxlen); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iter_destroy_pre[hIndex].func; + preHookFunc(&self); } if (*HPMforce_return) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen); + HPMHooks.source.account.db_sql_iter_destroy(self); } - if (HPMHooks.count.HP_DB_alloc_post > 0) { - struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func; - retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen); + if (HPMHooks.count.HP_account_db_sql_iter_destroy_post > 0) { + void (*postHookFunc) (AccountDBIterator *self); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iter_destroy_post[hIndex].func; + postHookFunc(self); } } - return retVal___; + return; } -union DBKey HP_DB_i2key(int key) { +bool HP_account_db_sql_iter_next(AccountDBIterator *self, struct mmo_account *acc) { int hIndex = 0; - union DBKey retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_i2key_pre > 0) { - union DBKey (*preHookFunc) (int *key); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_sql_iter_next_pre > 0) { + bool (*preHookFunc) (AccountDBIterator **self, struct mmo_account **acc); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_i2key_pre[hIndex].func; - retVal___ = preHookFunc(&key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_next_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_sql_iter_next_pre[hIndex].func; + retVal___ = preHookFunc(&self, &acc); } if (*HPMforce_return) { *HPMforce_return = false; @@ -578,26 +578,26 @@ union DBKey HP_DB_i2key(int key) { } } { - retVal___ = HPMHooks.source.DB.i2key(key); + retVal___ = HPMHooks.source.account.db_sql_iter_next(self, acc); } - if (HPMHooks.count.HP_DB_i2key_post > 0) { - union DBKey (*postHookFunc) (union DBKey retVal___, int key); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_i2key_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key); + if (HPMHooks.count.HP_account_db_sql_iter_next_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDBIterator *self, struct mmo_account *acc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_sql_iter_next_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_sql_iter_next_post[hIndex].func; + retVal___ = postHookFunc(retVal___, self, acc); } } return retVal___; } -union DBKey HP_DB_ui2key(unsigned int key) { +bool HP_account_db_read_inter(AccountDB_SQL *db, const char *filename, bool imported) { int hIndex = 0; - union DBKey retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_ui2key_pre > 0) { - union DBKey (*preHookFunc) (unsigned int *key); + bool retVal___ = false; + if (HPMHooks.count.HP_account_db_read_inter_pre > 0) { + bool (*preHookFunc) (AccountDB_SQL **db, const char **filename, bool *imported); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_ui2key_pre[hIndex].func; - retVal___ = preHookFunc(&key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_read_inter_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_account_db_read_inter_pre[hIndex].func; + retVal___ = preHookFunc(&db, &filename, &imported); } if (*HPMforce_return) { *HPMforce_return = false; @@ -605,26 +605,79 @@ union DBKey HP_DB_ui2key(unsigned int key) { } } { - retVal___ = HPMHooks.source.DB.ui2key(key); + retVal___ = HPMHooks.source.account.db_read_inter(db, filename, imported); } - if (HPMHooks.count.HP_DB_ui2key_post > 0) { - union DBKey (*postHookFunc) (union DBKey retVal___, unsigned int key); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_ui2key_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key); + if (HPMHooks.count.HP_account_db_read_inter_post > 0) { + bool (*postHookFunc) (bool retVal___, AccountDB_SQL *db, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_account_db_read_inter_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_account_db_read_inter_post[hIndex].func; + retVal___ = postHookFunc(retVal___, db, filename, imported); } } return retVal___; } -union DBKey HP_DB_str2key(const char *key) { +/* cmdline_interface */ +void HP_cmdline_init(void) { int hIndex = 0; - union DBKey retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_str2key_pre > 0) { - union DBKey (*preHookFunc) (const char **key); + if (HPMHooks.count.HP_cmdline_init_pre > 0) { + void (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_str2key_pre[hIndex].func; - retVal___ = preHookFunc(&key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.cmdline.init(); + } + if (HPMHooks.count.HP_cmdline_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_cmdline_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_cmdline_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.cmdline.final(); + } + if (HPMHooks.count.HP_cmdline_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_cmdline_arg_add_pre > 0) { + bool (*preHookFunc) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_arg_add_pre[hIndex].func; + retVal___ = preHookFunc(&pluginID, &name, &shortname, &func, &help, &options); } if (*HPMforce_return) { *HPMforce_return = false; @@ -632,26 +685,26 @@ union DBKey HP_DB_str2key(const char *key) { } } { - retVal___ = HPMHooks.source.DB.str2key(key); + retVal___ = HPMHooks.source.cmdline.arg_add(pluginID, name, shortname, func, help, options); } - if (HPMHooks.count.HP_DB_str2key_post > 0) { - union DBKey (*postHookFunc) (union DBKey retVal___, const char *key); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_str2key_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key); + if (HPMHooks.count.HP_cmdline_arg_add_post > 0) { + bool (*postHookFunc) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_arg_add_post[hIndex].func; + retVal___ = postHookFunc(retVal___, pluginID, name, shortname, func, help, options); } } return retVal___; } -union DBKey HP_DB_i642key(int64 key) { +int HP_cmdline_exec(int argc, char **argv, unsigned int options) { int hIndex = 0; - union DBKey retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_i642key_pre > 0) { - union DBKey (*preHookFunc) (int64 *key); + int retVal___ = 0; + if (HPMHooks.count.HP_cmdline_exec_pre > 0) { + int (*preHookFunc) (int *argc, char ***argv, unsigned int *options); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_i642key_pre[hIndex].func; - retVal___ = preHookFunc(&key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_exec_pre[hIndex].func; + retVal___ = preHookFunc(&argc, &argv, &options); } if (*HPMforce_return) { *HPMforce_return = false; @@ -659,26 +712,26 @@ union DBKey HP_DB_i642key(int64 key) { } } { - retVal___ = HPMHooks.source.DB.i642key(key); + retVal___ = HPMHooks.source.cmdline.exec(argc, argv, options); } - if (HPMHooks.count.HP_DB_i642key_post > 0) { - union DBKey (*postHookFunc) (union DBKey retVal___, int64 key); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_i642key_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key); + if (HPMHooks.count.HP_cmdline_exec_post > 0) { + int (*postHookFunc) (int retVal___, int argc, char **argv, unsigned int options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_exec_post[hIndex].func; + retVal___ = postHookFunc(retVal___, argc, argv, options); } } return retVal___; } -union DBKey HP_DB_ui642key(uint64 key) { +bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) { int hIndex = 0; - union DBKey retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_ui642key_pre > 0) { - union DBKey (*preHookFunc) (uint64 *key); + bool retVal___ = false; + if (HPMHooks.count.HP_cmdline_arg_next_value_pre > 0) { + bool (*preHookFunc) (const char **name, int *current_arg, int *argc); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_ui642key_pre[hIndex].func; - retVal___ = preHookFunc(&key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_pre[hIndex].func; + retVal___ = preHookFunc(&name, ¤t_arg, &argc); } if (*HPMforce_return) { *HPMforce_return = false; @@ -686,26 +739,26 @@ union DBKey HP_DB_ui642key(uint64 key) { } } { - retVal___ = HPMHooks.source.DB.ui642key(key); + retVal___ = HPMHooks.source.cmdline.arg_next_value(name, current_arg, argc); } - if (HPMHooks.count.HP_DB_ui642key_post > 0) { - union DBKey (*postHookFunc) (union DBKey retVal___, uint64 key); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_ui642key_post[hIndex].func; - retVal___ = postHookFunc(retVal___, key); + if (HPMHooks.count.HP_cmdline_arg_next_value_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *name, int current_arg, int argc); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name, current_arg, argc); } } return retVal___; } -struct DBData HP_DB_i2data(int data) { +const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) { int hIndex = 0; - struct DBData retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_i2data_pre > 0) { - struct DBData (*preHookFunc) (int *data); + const char* retVal___ = NULL; + if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) { + const char* (*preHookFunc) (struct CmdlineArgData **arg); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_i2data_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func; + retVal___ = preHookFunc(&arg); } if (*HPMforce_return) { *HPMforce_return = false; @@ -713,26 +766,830 @@ struct DBData HP_DB_i2data(int data) { } } { - retVal___ = HPMHooks.source.DB.i2data(data); + retVal___ = HPMHooks.source.cmdline.arg_source(arg); } - if (HPMHooks.count.HP_DB_i2data_post > 0) { - struct DBData (*postHookFunc) (struct DBData retVal___, int data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_i2data_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_cmdline_arg_source_post > 0) { + const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg); + for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func; + retVal___ = postHookFunc(retVal___, arg); } } return retVal___; } -struct DBData HP_DB_ui2data(unsigned int data) { +/* console_interface */ +void HP_console_init(void) { int hIndex = 0; - struct DBData retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_ui2data_pre > 0) { - struct DBData (*preHookFunc) (unsigned int *data); + if (HPMHooks.count.HP_console_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_console_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.init(); + } + if (HPMHooks.count.HP_console_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_console_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_console_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_console_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_console_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.final(); + } + if (HPMHooks.count.HP_console_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_console_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_console_display_title(void) { + int hIndex = 0; + if (HPMHooks.count.HP_console_display_title_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_console_display_title_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.display_title(); + } + if (HPMHooks.count.HP_console_display_title_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_console_display_title_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_console_display_gplnotice(void) { + int hIndex = 0; + if (HPMHooks.count.HP_console_display_gplnotice_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.console.display_gplnotice(); + } + if (HPMHooks.count.HP_console_display_gplnotice_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func; + postHookFunc(); + } + } + return; +} +/* core_interface */ +void HP_core_shutdown_callback(void) { + int hIndex = 0; + if (HPMHooks.count.HP_core_shutdown_callback_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_core_shutdown_callback_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.core.shutdown_callback(); + } + if (HPMHooks.count.HP_core_shutdown_callback_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_core_shutdown_callback_post[hIndex].func; + postHookFunc(); + } + } + return; +} +/* db_interface */ +enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) { + int hIndex = 0; + enum DBOptions retVal___ = DB_OPT_BASE; + if (HPMHooks.count.HP_DB_fix_options_pre > 0) { + enum DBOptions (*preHookFunc) (enum DBType *type, enum DBOptions *options); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_fix_options_pre[hIndex].func; + retVal___ = preHookFunc(&type, &options); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.fix_options(type, options); + } + if (HPMHooks.count.HP_DB_fix_options_post > 0) { + enum DBOptions (*postHookFunc) (enum DBOptions retVal___, enum DBType type, enum DBOptions options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_fix_options_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, options); + } + } + return retVal___; +} +DBComparator HP_DB_default_cmp(enum DBType type) { + int hIndex = 0; + DBComparator retVal___ = NULL; + if (HPMHooks.count.HP_DB_default_cmp_pre > 0) { + DBComparator (*preHookFunc) (enum DBType *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_default_cmp_pre[hIndex].func; + retVal___ = preHookFunc(&type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.default_cmp(type); + } + if (HPMHooks.count.HP_DB_default_cmp_post > 0) { + DBComparator (*postHookFunc) (DBComparator retVal___, enum DBType type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_default_cmp_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type); + } + } + return retVal___; +} +DBHasher HP_DB_default_hash(enum DBType type) { + int hIndex = 0; + DBHasher retVal___ = NULL; + if (HPMHooks.count.HP_DB_default_hash_pre > 0) { + DBHasher (*preHookFunc) (enum DBType *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_default_hash_pre[hIndex].func; + retVal___ = preHookFunc(&type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.default_hash(type); + } + if (HPMHooks.count.HP_DB_default_hash_post > 0) { + DBHasher (*postHookFunc) (DBHasher retVal___, enum DBType type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_default_hash_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type); + } + } + return retVal___; +} +DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) { + int hIndex = 0; + DBReleaser retVal___ = NULL; + if (HPMHooks.count.HP_DB_default_release_pre > 0) { + DBReleaser (*preHookFunc) (enum DBType *type, enum DBOptions *options); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_default_release_pre[hIndex].func; + retVal___ = preHookFunc(&type, &options); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.default_release(type, options); + } + if (HPMHooks.count.HP_DB_default_release_post > 0) { + DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBType type, enum DBOptions options); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_default_release_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, options); + } + } + return retVal___; +} +DBReleaser HP_DB_custom_release(enum DBReleaseOption which) { + int hIndex = 0; + DBReleaser retVal___ = NULL; + if (HPMHooks.count.HP_DB_custom_release_pre > 0) { + DBReleaser (*preHookFunc) (enum DBReleaseOption *which); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_custom_release_pre[hIndex].func; + retVal___ = preHookFunc(&which); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.custom_release(which); + } + if (HPMHooks.count.HP_DB_custom_release_post > 0) { + DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBReleaseOption which); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_custom_release_post[hIndex].func; + retVal___ = postHookFunc(retVal___, which); + } + } + return retVal___; +} +struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) { + int hIndex = 0; + struct DBMap* retVal___ = NULL; + if (HPMHooks.count.HP_DB_alloc_pre > 0) { + struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func; + retVal___ = preHookFunc(&file, &func, &line, &type, &options, &maxlen); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen); + } + if (HPMHooks.count.HP_DB_alloc_post > 0) { + struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func; + retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen); + } + } + return retVal___; +} +union DBKey HP_DB_i2key(int key) { + int hIndex = 0; + union DBKey retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_i2key_pre > 0) { + union DBKey (*preHookFunc) (int *key); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_i2key_pre[hIndex].func; + retVal___ = preHookFunc(&key); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.i2key(key); + } + if (HPMHooks.count.HP_DB_i2key_post > 0) { + union DBKey (*postHookFunc) (union DBKey retVal___, int key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_i2key_post[hIndex].func; + retVal___ = postHookFunc(retVal___, key); + } + } + return retVal___; +} +union DBKey HP_DB_ui2key(unsigned int key) { + int hIndex = 0; + union DBKey retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_ui2key_pre > 0) { + union DBKey (*preHookFunc) (unsigned int *key); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_ui2key_pre[hIndex].func; + retVal___ = preHookFunc(&key); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.ui2key(key); + } + if (HPMHooks.count.HP_DB_ui2key_post > 0) { + union DBKey (*postHookFunc) (union DBKey retVal___, unsigned int key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_ui2key_post[hIndex].func; + retVal___ = postHookFunc(retVal___, key); + } + } + return retVal___; +} +union DBKey HP_DB_str2key(const char *key) { + int hIndex = 0; + union DBKey retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_str2key_pre > 0) { + union DBKey (*preHookFunc) (const char **key); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_str2key_pre[hIndex].func; + retVal___ = preHookFunc(&key); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.str2key(key); + } + if (HPMHooks.count.HP_DB_str2key_post > 0) { + union DBKey (*postHookFunc) (union DBKey retVal___, const char *key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_str2key_post[hIndex].func; + retVal___ = postHookFunc(retVal___, key); + } + } + return retVal___; +} +union DBKey HP_DB_i642key(int64 key) { + int hIndex = 0; + union DBKey retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_i642key_pre > 0) { + union DBKey (*preHookFunc) (int64 *key); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_i642key_pre[hIndex].func; + retVal___ = preHookFunc(&key); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.i642key(key); + } + if (HPMHooks.count.HP_DB_i642key_post > 0) { + union DBKey (*postHookFunc) (union DBKey retVal___, int64 key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_i642key_post[hIndex].func; + retVal___ = postHookFunc(retVal___, key); + } + } + return retVal___; +} +union DBKey HP_DB_ui642key(uint64 key) { + int hIndex = 0; + union DBKey retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_ui642key_pre > 0) { + union DBKey (*preHookFunc) (uint64 *key); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_ui642key_pre[hIndex].func; + retVal___ = preHookFunc(&key); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.ui642key(key); + } + if (HPMHooks.count.HP_DB_ui642key_post > 0) { + union DBKey (*postHookFunc) (union DBKey retVal___, uint64 key); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_ui642key_post[hIndex].func; + retVal___ = postHookFunc(retVal___, key); + } + } + return retVal___; +} +struct DBData HP_DB_i2data(int data) { + int hIndex = 0; + struct DBData retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_i2data_pre > 0) { + struct DBData (*preHookFunc) (int *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_i2data_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.i2data(data); + } + if (HPMHooks.count.HP_DB_i2data_post > 0) { + struct DBData (*postHookFunc) (struct DBData retVal___, int data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_i2data_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +struct DBData HP_DB_ui2data(unsigned int data) { + int hIndex = 0; + struct DBData retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_ui2data_pre > 0) { + struct DBData (*preHookFunc) (unsigned int *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_ui2data_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.ui2data(data); + } + if (HPMHooks.count.HP_DB_ui2data_post > 0) { + struct DBData (*postHookFunc) (struct DBData retVal___, unsigned int data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_ui2data_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +struct DBData HP_DB_ptr2data(void *data) { + int hIndex = 0; + struct DBData retVal___ = { 0 }; + if (HPMHooks.count.HP_DB_ptr2data_pre > 0) { + struct DBData (*preHookFunc) (void **data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_ptr2data_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.ptr2data(data); + } + if (HPMHooks.count.HP_DB_ptr2data_post > 0) { + struct DBData (*postHookFunc) (struct DBData retVal___, void *data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_ptr2data_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +int HP_DB_data2i(struct DBData *data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_DB_data2i_pre > 0) { + int (*preHookFunc) (struct DBData **data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_data2i_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.data2i(data); + } + if (HPMHooks.count.HP_DB_data2i_post > 0) { + int (*postHookFunc) (int retVal___, struct DBData *data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_data2i_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +unsigned int HP_DB_data2ui(struct DBData *data) { + int hIndex = 0; + unsigned int retVal___ = 0; + if (HPMHooks.count.HP_DB_data2ui_pre > 0) { + unsigned int (*preHookFunc) (struct DBData **data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_data2ui_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.data2ui(data); + } + if (HPMHooks.count.HP_DB_data2ui_post > 0) { + unsigned int (*postHookFunc) (unsigned int retVal___, struct DBData *data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_data2ui_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +void* HP_DB_data2ptr(struct DBData *data) { + int hIndex = 0; + void* retVal___ = NULL; + if (HPMHooks.count.HP_DB_data2ptr_pre > 0) { + void* (*preHookFunc) (struct DBData **data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func; + retVal___ = preHookFunc(&data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.DB.data2ptr(data); + } + if (HPMHooks.count.HP_DB_data2ptr_post > 0) { + void* (*postHookFunc) (void* retVal___, struct DBData *data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func; + retVal___ = postHookFunc(retVal___, data); + } + } + return retVal___; +} +void HP_DB_init(void) { + int hIndex = 0; + if (HPMHooks.count.HP_DB_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.DB.init(); + } + if (HPMHooks.count.HP_DB_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_DB_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_DB_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_DB_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.DB.final(); + } + if (HPMHooks.count.HP_DB_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_DB_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +/* des_interface */ +void HP_des_decrypt_block(struct des_bit64 *block) { + int hIndex = 0; + if (HPMHooks.count.HP_des_decrypt_block_pre > 0) { + void (*preHookFunc) (struct des_bit64 **block); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; + preHookFunc(&block); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt_block(block); + } + if (HPMHooks.count.HP_des_decrypt_block_post > 0) { + void (*postHookFunc) (struct des_bit64 *block); + for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; + postHookFunc(block); + } + } + return; +} +void HP_des_decrypt(unsigned char *data, size_t size) { + int hIndex = 0; + if (HPMHooks.count.HP_des_decrypt_pre > 0) { + void (*preHookFunc) (unsigned char **data, size_t *size); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; + preHookFunc(&data, &size); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.des.decrypt(data, size); + } + if (HPMHooks.count.HP_des_decrypt_post > 0) { + void (*postHookFunc) (unsigned char *data, size_t size); + for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; + postHookFunc(data, size); + } + } + return; +} +/* ipban_interface */ +void HP_ipban_init(void) { + int hIndex = 0; + if (HPMHooks.count.HP_ipban_init_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_init_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.ipban.init(); + } + if (HPMHooks.count.HP_ipban_init_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_init_post[hIndex].func; + postHookFunc(); + } + } + return; +} +void HP_ipban_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_ipban_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.ipban.final(); + } + if (HPMHooks.count.HP_ipban_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +int HP_ipban_cleanup(int tid, int64 tick, int id, intptr_t data) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_ipban_cleanup_pre > 0) { + int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_cleanup_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_cleanup_pre[hIndex].func; + retVal___ = preHookFunc(&tid, &tick, &id, &data); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.cleanup(tid, tick, id, data); + } + if (HPMHooks.count.HP_ipban_cleanup_post > 0) { + int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_cleanup_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_cleanup_post[hIndex].func; + retVal___ = postHookFunc(retVal___, tid, tick, id, data); + } + } + return retVal___; +} +bool HP_ipban_config_read_inter(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_inter_pre > 0) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_inter_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_inter_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.ipban.config_read_inter(filename, imported); + } + if (HPMHooks.count.HP_ipban_config_read_inter_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_inter_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_inter_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} +bool HP_ipban_config_read_connection(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_connection_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_ui2data_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_connection_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_connection_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); } if (*HPMforce_return) { *HPMforce_return = false; @@ -740,26 +1597,26 @@ struct DBData HP_DB_ui2data(unsigned int data) { } } { - retVal___ = HPMHooks.source.DB.ui2data(data); + retVal___ = HPMHooks.source.ipban.config_read_connection(filename, config, imported); } - if (HPMHooks.count.HP_DB_ui2data_post > 0) { - struct DBData (*postHookFunc) (struct DBData retVal___, unsigned int data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_ui2data_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_ipban_config_read_connection_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_connection_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_connection_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; } -struct DBData HP_DB_ptr2data(void *data) { +bool HP_ipban_config_read_dynamic(const char *filename, struct config_t *config, bool imported) { int hIndex = 0; - struct DBData retVal___ = { 0 }; - if (HPMHooks.count.HP_DB_ptr2data_pre > 0) { - struct DBData (*preHookFunc) (void **data); + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_dynamic_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_ptr2data_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_dynamic_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_dynamic_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); } if (*HPMforce_return) { *HPMforce_return = false; @@ -767,26 +1624,26 @@ struct DBData HP_DB_ptr2data(void *data) { } } { - retVal___ = HPMHooks.source.DB.ptr2data(data); + retVal___ = HPMHooks.source.ipban.config_read_dynamic(filename, config, imported); } - if (HPMHooks.count.HP_DB_ptr2data_post > 0) { - struct DBData (*postHookFunc) (struct DBData retVal___, void *data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_ptr2data_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_ipban_config_read_dynamic_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_dynamic_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_dynamic_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; } -int HP_DB_data2i(struct DBData *data) { +bool HP_ipban_config_read(const char *filename, struct config_t *config, bool imported) { int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_DB_data2i_pre > 0) { - int (*preHookFunc) (struct DBData **data); + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_config_read_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_data2i_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); } if (*HPMforce_return) { *HPMforce_return = false; @@ -794,26 +1651,26 @@ int HP_DB_data2i(struct DBData *data) { } } { - retVal___ = HPMHooks.source.DB.data2i(data); + retVal___ = HPMHooks.source.ipban.config_read(filename, config, imported); } - if (HPMHooks.count.HP_DB_data2i_post > 0) { - int (*postHookFunc) (int retVal___, struct DBData *data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_data2i_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_ipban_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; } -unsigned int HP_DB_data2ui(struct DBData *data) { +bool HP_ipban_check(uint32 ip) { int hIndex = 0; - unsigned int retVal___ = 0; - if (HPMHooks.count.HP_DB_data2ui_pre > 0) { - unsigned int (*preHookFunc) (struct DBData **data); + bool retVal___ = false; + if (HPMHooks.count.HP_ipban_check_pre > 0) { + bool (*preHookFunc) (uint32 *ip); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_data2ui_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_check_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_check_pre[hIndex].func; + retVal___ = preHookFunc(&ip); } if (*HPMforce_return) { *HPMforce_return = false; @@ -821,52 +1678,52 @@ unsigned int HP_DB_data2ui(struct DBData *data) { } } { - retVal___ = HPMHooks.source.DB.data2ui(data); + retVal___ = HPMHooks.source.ipban.check(ip); } - if (HPMHooks.count.HP_DB_data2ui_post > 0) { - unsigned int (*postHookFunc) (unsigned int retVal___, struct DBData *data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_data2ui_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_ipban_check_post > 0) { + bool (*postHookFunc) (bool retVal___, uint32 ip); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_check_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_check_post[hIndex].func; + retVal___ = postHookFunc(retVal___, ip); } } return retVal___; } -void* HP_DB_data2ptr(struct DBData *data) { +void HP_ipban_log(uint32 ip) { int hIndex = 0; - void* retVal___ = NULL; - if (HPMHooks.count.HP_DB_data2ptr_pre > 0) { - void* (*preHookFunc) (struct DBData **data); + if (HPMHooks.count.HP_ipban_log_pre > 0) { + void (*preHookFunc) (uint32 *ip); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func; - retVal___ = preHookFunc(&data); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_ipban_log_pre[hIndex].func; + preHookFunc(&ip); } if (*HPMforce_return) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.DB.data2ptr(data); + HPMHooks.source.ipban.log(ip); } - if (HPMHooks.count.HP_DB_data2ptr_post > 0) { - void* (*postHookFunc) (void* retVal___, struct DBData *data); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func; - retVal___ = postHookFunc(retVal___, data); + if (HPMHooks.count.HP_ipban_log_post > 0) { + void (*postHookFunc) (uint32 ip); + for (hIndex = 0; hIndex < HPMHooks.count.HP_ipban_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_ipban_log_post[hIndex].func; + postHookFunc(ip); } } - return retVal___; + return; } -void HP_DB_init(void) { +/* lchrif_interface */ +void HP_lchrif_server_init(int id) { int hIndex = 0; - if (HPMHooks.count.HP_DB_init_pre > 0) { - void (*preHookFunc) (void); + if (HPMHooks.count.HP_lchrif_server_init_pre > 0) { + void (*preHookFunc) (int *id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_init_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_init_pre[hIndex].func; + preHookFunc(&id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -874,25 +1731,25 @@ void HP_DB_init(void) { } } { - HPMHooks.source.DB.init(); + HPMHooks.source.lchrif.server_init(id); } - if (HPMHooks.count.HP_DB_init_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_init_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_lchrif_server_init_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_init_post[hIndex].func; + postHookFunc(id); } } return; } -void HP_DB_final(void) { +void HP_lchrif_server_destroy(int id) { int hIndex = 0; - if (HPMHooks.count.HP_DB_final_pre > 0) { - void (*preHookFunc) (void); + if (HPMHooks.count.HP_lchrif_server_destroy_pre > 0) { + void (*preHookFunc) (int *id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_DB_final_pre[hIndex].func; - preHookFunc(); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_destroy_pre[hIndex].func; + preHookFunc(&id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -900,26 +1757,25 @@ void HP_DB_final(void) { } } { - HPMHooks.source.DB.final(); + HPMHooks.source.lchrif.server_destroy(id); } - if (HPMHooks.count.HP_DB_final_post > 0) { - void (*postHookFunc) (void); - for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_DB_final_post[hIndex].func; - postHookFunc(); + if (HPMHooks.count.HP_lchrif_server_destroy_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_destroy_post[hIndex].func; + postHookFunc(id); } } return; } -/* des_interface */ -void HP_des_decrypt_block(struct des_bit64 *block) { +void HP_lchrif_server_reset(int id) { int hIndex = 0; - if (HPMHooks.count.HP_des_decrypt_block_pre > 0) { - void (*preHookFunc) (struct des_bit64 **block); + if (HPMHooks.count.HP_lchrif_server_reset_pre > 0) { + void (*preHookFunc) (int *id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func; - preHookFunc(&block); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_reset_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_server_reset_pre[hIndex].func; + preHookFunc(&id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -927,25 +1783,25 @@ void HP_des_decrypt_block(struct des_bit64 *block) { } } { - HPMHooks.source.des.decrypt_block(block); + HPMHooks.source.lchrif.server_reset(id); } - if (HPMHooks.count.HP_des_decrypt_block_post > 0) { - void (*postHookFunc) (struct des_bit64 *block); - for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func; - postHookFunc(block); + if (HPMHooks.count.HP_lchrif_server_reset_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_server_reset_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_server_reset_post[hIndex].func; + postHookFunc(id); } } return; } -void HP_des_decrypt(unsigned char *data, size_t size) { +void HP_lchrif_on_disconnect(int id) { int hIndex = 0; - if (HPMHooks.count.HP_des_decrypt_pre > 0) { - void (*preHookFunc) (unsigned char **data, size_t *size); + if (HPMHooks.count.HP_lchrif_on_disconnect_pre > 0) { + void (*preHookFunc) (int *id); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func; - preHookFunc(&data, &size); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_on_disconnect_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_lchrif_on_disconnect_pre[hIndex].func; + preHookFunc(&id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -953,13 +1809,13 @@ void HP_des_decrypt(unsigned char *data, size_t size) { } } { - HPMHooks.source.des.decrypt(data, size); + HPMHooks.source.lchrif.on_disconnect(id); } - if (HPMHooks.count.HP_des_decrypt_post > 0) { - void (*postHookFunc) (unsigned char *data, size_t size); - for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func; - postHookFunc(data, size); + if (HPMHooks.count.HP_lchrif_on_disconnect_post > 0) { + void (*postHookFunc) (int id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_lchrif_on_disconnect_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_lchrif_on_disconnect_post[hIndex].func; + postHookFunc(id); } } return; @@ -5117,6 +5973,195 @@ uint16 HP_login_convert_users_to_colors(uint16 users) { } return retVal___; } +/* loginlog_interface */ +unsigned long HP_loginlog_failedattempts(uint32 ip, unsigned int minutes) { + int hIndex = 0; + unsigned long retVal___ = 0; + if (HPMHooks.count.HP_loginlog_failedattempts_pre > 0) { + unsigned long (*preHookFunc) (uint32 *ip, unsigned int *minutes); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_failedattempts_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_failedattempts_pre[hIndex].func; + retVal___ = preHookFunc(&ip, &minutes); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.failedattempts(ip, minutes); + } + if (HPMHooks.count.HP_loginlog_failedattempts_post > 0) { + unsigned long (*postHookFunc) (unsigned long retVal___, uint32 ip, unsigned int minutes); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_failedattempts_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_failedattempts_post[hIndex].func; + retVal___ = postHookFunc(retVal___, ip, minutes); + } + } + return retVal___; +} +void HP_loginlog_log(uint32 ip, const char *username, int rcode, const char *message) { + int hIndex = 0; + if (HPMHooks.count.HP_loginlog_log_pre > 0) { + void (*preHookFunc) (uint32 *ip, const char **username, int *rcode, const char **message); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_log_pre[hIndex].func; + preHookFunc(&ip, &username, &rcode, &message); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.loginlog.log(ip, username, rcode, message); + } + if (HPMHooks.count.HP_loginlog_log_post > 0) { + void (*postHookFunc) (uint32 ip, const char *username, int rcode, const char *message); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_log_post[hIndex].func; + postHookFunc(ip, username, rcode, message); + } + } + return; +} +bool HP_loginlog_init(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_init_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_init_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.init(); + } + if (HPMHooks.count.HP_loginlog_init_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_init_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_loginlog_final(void) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_final_pre > 0) { + bool (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_final_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.final(); + } + if (HPMHooks.count.HP_loginlog_final_post > 0) { + bool (*postHookFunc) (bool retVal___); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_final_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} +bool HP_loginlog_config_read_names(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_names_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_names_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_names_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read_names(filename, config, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_names_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_names_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_names_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_loginlog_config_read_log(const char *filename, struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_log_pre > 0) { + bool (*preHookFunc) (const char **filename, struct config_t **config, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_log_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_log_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read_log(filename, config, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_log_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, struct config_t *config, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_log_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_log_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_loginlog_config_read(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_loginlog_config_read_pre > 0) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_loginlog_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.loginlog.config_read(filename, imported); + } + if (HPMHooks.count.HP_loginlog_config_read_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for (hIndex = 0; hIndex < HPMHooks.count.HP_loginlog_config_read_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_loginlog_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} /* md5_interface */ void HP_md5_string(const char *string, char *output) { int hIndex = 0; -- cgit v1.2.3-60-g2f50