summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-07-30 11:55:45 -0400
committergumi <git@gumi.ca>2018-07-30 13:01:16 -0400
commit87eb2f98518a63a3f640b97ad62c8b18a5d6b946 (patch)
treeb56d31a13d363d1d706caf1d30cb3381b61f057f /src/plugins/HPMHooking
parenta28504fce050c8967b092759f1374d22c7a7ec0e (diff)
downloadhercules-87eb2f98518a63a3f640b97ad62c8b18a5d6b946.tar.gz
hercules-87eb2f98518a63a3f640b97ad62c8b18a5d6b946.tar.bz2
hercules-87eb2f98518a63a3f640b97ad62c8b18a5d6b946.tar.xz
hercules-87eb2f98518a63a3f640b97ad62c8b18a5d6b946.zip
always set the type when doing script->add_str
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc27
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 0c63a98b6..5412f6138 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6608,6 +6608,8 @@ typedef bool (*HPMHOOK_pre_script_config_read) (const char **filename, bool *imp
typedef bool (*HPMHOOK_post_script_config_read) (bool retVal___, const char *filename, bool imported);
typedef int (*HPMHOOK_pre_script_add_str) (const char **p);
typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p);
+typedef int (*HPMHOOK_pre_script_add_variable) (const char **varname);
+typedef int (*HPMHOOK_post_script_add_variable) (int retVal___, const char *varname);
typedef const char* (*HPMHOOK_pre_script_get_str) (int *id);
typedef const char* (*HPMHOOK_post_script_get_str) (const char* retVal___, int id);
typedef int (*HPMHOOK_pre_script_search_str) (const char **p);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index c4394d7f4..a4fdc7da0 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -5130,6 +5130,8 @@ struct {
struct HPMHookPoint *HP_script_config_read_post;
struct HPMHookPoint *HP_script_add_str_pre;
struct HPMHookPoint *HP_script_add_str_post;
+ struct HPMHookPoint *HP_script_add_variable_pre;
+ struct HPMHookPoint *HP_script_add_variable_post;
struct HPMHookPoint *HP_script_get_str_pre;
struct HPMHookPoint *HP_script_get_str_post;
struct HPMHookPoint *HP_script_search_str_pre;
@@ -11681,6 +11683,8 @@ struct {
int HP_script_config_read_post;
int HP_script_add_str_pre;
int HP_script_add_str_post;
+ int HP_script_add_variable_pre;
+ int HP_script_add_variable_post;
int HP_script_get_str_pre;
int HP_script_get_str_post;
int HP_script_search_str_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index e5584cc43..00d932689 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2628,6 +2628,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->setarray_pc, HP_script_setarray_pc) },
{ HP_POP(script->config_read, HP_script_config_read) },
{ HP_POP(script->add_str, HP_script_add_str) },
+ { HP_POP(script->add_variable, HP_script_add_variable) },
{ HP_POP(script->get_str, HP_script_get_str) },
{ HP_POP(script->search_str, HP_script_search_str) },
{ HP_POP(script->setd_sub, HP_script_setd_sub) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index f2ce1505c..d93557fe6 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -68339,6 +68339,33 @@ int HP_script_add_str(const char *p) {
}
return retVal___;
}
+int HP_script_add_variable(const char *varname) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_script_add_variable_pre > 0) {
+ int (*preHookFunc) (const char **varname);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_add_variable_pre[hIndex].func;
+ retVal___ = preHookFunc(&varname);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.add_variable(varname);
+ }
+ if (HPMHooks.count.HP_script_add_variable_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *varname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_add_variable_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, varname);
+ }
+ }
+ return retVal___;
+}
const char* HP_script_get_str(int id) {
int hIndex = 0;
const char* retVal___ = NULL;