From c32a22c52b75ae8c3bc2064110318f4ad1d6954a Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 18 Jan 2014 22:02:33 -0200 Subject: PCRE Interface Plugins may now take advantage of the pcre support within the core. Thanks to Haruna! Signed-off-by: shennetsind --- src/map/npc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/map/npc.h') 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 -- cgit v1.2.3-70-g09d2