summaryrefslogtreecommitdiff
path: root/src/map/npc.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-02 11:54:36 +0100
committerHaru <haru@dotalux.com>2015-12-02 11:55:16 +0100
commit300668dce8699accfb3e8cbce6db55b937230bb7 (patch)
tree5e9f28572c21e4dfe0afc8b43640109ac4db6337 /src/map/npc.h
parent9be1d84752ba2ed733ae29d68304f5825cf29162 (diff)
downloadhercules-300668dce8699accfb3e8cbce6db55b937230bb7.tar.gz
hercules-300668dce8699accfb3e8cbce6db55b937230bb7.tar.bz2
hercules-300668dce8699accfb3e8cbce6db55b937230bb7.tar.xz
hercules-300668dce8699accfb3e8cbce6db55b937230bb7.zip
Fixed compile errors on very old PACKETVERs
- Fixes #903 and other similar problems Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.h')
-rw-r--r--src/map/npc.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/map/npc.h b/src/map/npc.h
index e7fc16a21..d5e4618a1 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -295,32 +295,51 @@ HPShared struct npc_interface *npc;
/* comes from npc_chat.c */
#ifdef PCRE_SUPPORT
#include <pcre/include/pcre.h>
-/* Structure containing all info associated with a single pattern block */
+#endif // PCRE_SUPPORT
+
+/**
+ * Structure containing all info associated with a single pattern block
+ */
struct pcrematch_entry {
+#ifdef PCRE_SUPPORT
struct pcrematch_entry* next;
char* pattern;
pcre* pcre_;
pcre_extra* pcre_extra_;
char* label;
+#else // not PCRE_SUPPORT
+ UNAVAILABLE_STRUCT;
+#endif // PCRE_SUPPORT
};
-/* A set of patterns that can be activated and deactived with a single command */
+/**
+ * A set of patterns that can be activated and deactived with a single command
+ */
struct pcrematch_set {
+#ifdef PCRE_SUPPORT
struct pcrematch_set* prev;
struct pcrematch_set* next;
struct pcrematch_entry* head;
int setid;
+#else // not PCRE_SUPPORT
+ UNAVAILABLE_STRUCT;
+#endif // PCRE_SUPPORT
};
-/*
+/**
* Entire data structure hung off a NPC
*/
struct npc_parse {
+#ifdef PCRE_SUPPORT
struct pcrematch_set* active;
struct pcrematch_set* inactive;
+#else // not PCRE_SUPPORT
+ UNAVAILABLE_STRUCT;
+#endif // PCRE_SUPPORT
};
struct npc_chat_interface {
+#ifdef PCRE_SUPPORT
int (*sub) (struct block_list* bl, va_list ap);
void (*finalize) (struct npc_data* nd);
void (*def_pattern) (struct npc_data* nd, int setid, const char* pattern, const char* label);
@@ -330,6 +349,9 @@ struct npc_chat_interface {
void (*activate_pcreset) (struct npc_data* nd, int setid);
struct pcrematch_set* (*lookup_pcreset) (struct npc_data* nd, int setid);
void (*finalize_pcrematch_entry) (struct pcrematch_entry* e);
+#else // not PCRE_SUPPORT
+ UNAVAILABLE_STRUCT;
+#endif // PCRE_SUPPORT
};
/**
@@ -338,6 +360,7 @@ struct npc_chat_interface {
* should be moved into core/perhaps its own file once hpm is enhanced for login/char
**/
struct pcre_interface {
+#ifdef PCRE_SUPPORT
pcre *(*compile) (const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);
pcre_extra *(*study) (const pcre *code, int options, const char **errptr);
int (*exec) (const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize);
@@ -346,6 +369,9 @@ struct pcre_interface {
void (*free_substring) (const char *stringptr);
int (*copy_named_substring) (const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);
int (*get_substring) (const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);
+#else // not PCRE_SUPPORT
+ UNAVAILABLE_STRUCT;
+#endif // PCRE_SUPPORT
};
/**
@@ -358,6 +384,4 @@ void npc_chat_defaults(void);
HPShared struct npc_chat_interface *npc_chat;
HPShared struct pcre_interface *libpcre;
-#endif // PCRE_SUPPORT
-
#endif /* MAP_NPC_H */