summaryrefslogtreecommitdiff
path: root/src/map/npc.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-18 22:02:33 -0200
committershennetsind <ind@henn.et>2014-01-18 22:02:33 -0200
commitc32a22c52b75ae8c3bc2064110318f4ad1d6954a (patch)
treeb63a2ba9db0e7825b3365fa53fa8ddd8a35315b3 /src/map/npc.h
parent14f84fc044754d22740905b7fa90022b4a04b0d8 (diff)
downloadhercules-c32a22c52b75ae8c3bc2064110318f4ad1d6954a.tar.gz
hercules-c32a22c52b75ae8c3bc2064110318f4ad1d6954a.tar.bz2
hercules-c32a22c52b75ae8c3bc2064110318f4ad1d6954a.tar.xz
hercules-c32a22c52b75ae8c3bc2064110318f4ad1d6954a.zip
PCRE Interface
Plugins may now take advantage of the pcre support within the core. Thanks to Haruna! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/npc.h')
-rw-r--r--src/map/npc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/map/npc.h b/src/map/npc.h
index 2f4401bf7..df3c1729b 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -323,6 +323,25 @@ struct npc_chat_interface {
struct npc_chat_interface *npc_chat;
+/**
+ * pcre interface (libpcre)
+ * so that plugins may share and take advantage of the core's pcre
+ **/
+struct pcre_interface {
+ 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);
+ void (*free) (void *ptr);
+ int (*copy_substring) (const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);
+ 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);
+};
+
+struct pcre_interface *libpcre;
+
+/**
+ * Also defaults libpcre
+ **/
void npc_chat_defaults(void);
#endif