summaryrefslogtreecommitdiff
path: root/src/common/HPM.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/HPM.h')
-rw-r--r--src/common/HPM.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/common/HPM.h b/src/common/HPM.h
index 444829419..1d13a178f 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -65,7 +65,7 @@ struct hpm_symbol {
void *ptr; ///< The symbol value
};
-struct HPluginData {
+struct hplugin_data_entry {
unsigned int pluginID;
unsigned int type;
struct {
@@ -74,6 +74,11 @@ struct HPluginData {
void *data;
};
+struct hplugin_data_store {
+ struct hplugin_data_entry **array;
+ unsigned int count;
+};
+
struct HPluginPacket {
unsigned int pluginID;
unsigned short cmd;
@@ -86,10 +91,6 @@ struct HPMFileNameCache {
char *name;
};
-struct HPDataOperationStorage {
- void **HPDataSRCPtr;
- unsigned int *hdatac;
-};
/* */
struct HPConfListenStorage {
unsigned int pluginID;
@@ -136,15 +137,18 @@ struct HPM_interface {
unsigned char (*parse_packets) (int fd, enum HPluginPacketHookingPoints point);
void (*load_sub) (struct hplugin *plugin);
bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
- void (*grabHPData) (struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr);
- /* for server-specific HPData e.g. map_session_data */
- bool (*grabHPDataSub) (struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr);
/* for custom config parsing */
bool (*parseConf) (const char *w1, const char *w2, enum HPluginConfType point);
/* validates plugin data */
bool (*DataCheck) (struct s_HPMDataCheck *src, unsigned int size, int version, char *name);
void (*datacheck_init) (const struct s_HPMDataCheck *src, unsigned int length, int version);
void (*datacheck_final) (void);
+
+ struct hplugin_data_store *(*data_store_create) (void);
+ void (*data_store_destroy) (struct hplugin_data_store *store);
+ bool (*data_store_validate) (enum HPluginDataTypes type, struct hplugin_data_store **store);
+ /* for server-specific HPData e.g. map_session_data */
+ bool (*data_store_validate_sub) (enum HPluginDataTypes type, struct hplugin_data_store **store);
};
CMDLINEARG(loadplugin);