27#ifndef __NILOREA_PCRE_HELPERS__
28#define __NILOREA_PCRE_HELPERS__
36#ifndef PCRE2_CODE_UNIT_WIDTH
37#define PCRE2_CODE_UNIT_WIDTH 8
51#define PCRE_CASELESS PCRE2_CASELESS
54#define PCRE_MULTILINE PCRE2_MULTILINE
57#define PCRE_DOTALL PCRE2_DOTALL
60#define PCRE_EXTENDED PCRE2_EXTENDED
63#define PCRE_ANCHORED PCRE2_ANCHORED
66#define PCRE_UTF8 PCRE2_UTF
69#define PCRE_UCP PCRE2_UCP
75#ifdef PCRE2_LIST_FREE_CONST
76#define PCRE2_LIST_FREE_CAST(x) ((const PCRE2_UCHAR8**)(void*)(x))
78#define PCRE2_LIST_FREE_CAST(x) ((PCRE2_UCHAR8**)(void*)(x))
82#define npcre_print_error(__LEVEL__, __rc__) \
84 _npcre_print_error(__LEVEL__, __FILE__, __func__, __LINE__, __rc__); \
PCRE2_UCHAR8 ** match_list
populated match list (NULL-terminated) after npcre_match_capture() Allocated by PCRE2 via pcre2_subst...
pcre2_code * regexp
regexp
pcre2_match_data * match_data
match data storage (ovector, etc.)
char * regexp_str
original regexp string
pthread_rwlock_t rwlock
rwlock protecting match_data, match_list, and captured
int captured
flag for match_list cleaning
N_PCRE * npcre_new(char *str, int flags)
pcre helper, compile and optimize regexp
int _npcre_print_error(int LOG_LEVEL, const char *file, const char *func, int line, int rc)
print error helper
int npcre_match_capture(char *str, N_PCRE *pcre)
thread-safe pcre match with captures stored in pcre->match_list
int npcre_match(char *str, N_PCRE *pcre)
thread-safe pcre match, only returns TRUE/FALSE, no captures stored
int npcre_clean_match(N_PCRE *pcre)
clean match results from a previous npcre_match_capture
int npcre_delete(N_PCRE **pcre)
pcre helper, delete/free a compiled regexp
Common headers and low-level functions & define.
static int LOG_LEVEL
static global maximum wanted log level value