| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "config.h" |
| 26 |
– |
#ifdef HAVE_LIBPCRE |
| 27 |
– |
#include <pcre.h> |
| 28 |
– |
#endif |
| 29 |
– |
|
| 26 |
|
#include "stdinc.h" |
| 27 |
|
#include "irc_string.h" |
| 28 |
|
|
| 235 |
|
return s - src - 1; /* count does not include NUL */ |
| 236 |
|
} |
| 237 |
|
#endif |
| 242 |
– |
|
| 243 |
– |
#ifdef HAVE_LIBPCRE |
| 244 |
– |
void * |
| 245 |
– |
ircd_pcre_compile(const char *pattern, const char **errptr) |
| 246 |
– |
{ |
| 247 |
– |
int erroroffset = 0; |
| 248 |
– |
int options = PCRE_EXTRA; |
| 249 |
– |
|
| 250 |
– |
assert(pattern); |
| 251 |
– |
|
| 252 |
– |
return pcre_compile(pattern, options, errptr, &erroroffset, NULL); |
| 253 |
– |
} |
| 254 |
– |
|
| 255 |
– |
int |
| 256 |
– |
ircd_pcre_exec(const void *code, const char *subject) |
| 257 |
– |
{ |
| 258 |
– |
assert(code && subject); |
| 259 |
– |
|
| 260 |
– |
return pcre_exec(code, NULL, subject, strlen(subject), 0, 0, NULL, 0) < 0; |
| 261 |
– |
} |
| 262 |
– |
#endif |