Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_pcre.h File Reference

PCRE helpers for regex matching. More...

#include <pcre2.h>
#include <nilorea/n_common.h>
+ Include dependency graph for n_pcre.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  N_PCRE
 N_PCRE structure. More...
 

Macros

#define npcre_print_error(__LEVEL__, __rc__)
 PCRE error logging function wrapper to get line and func.
 
#define PCRE2_CODE_UNIT_WIDTH   8
 
#define PCRE2_LIST_FREE_CAST(x)   ((PCRE2_UCHAR8**)(void*)(x))
 
#define PCRE_ANCHORED   PCRE2_ANCHORED
 
#define PCRE_CASELESS   PCRE2_CASELESS
 
#define PCRE_DOTALL   PCRE2_DOTALL
 
#define PCRE_EXTENDED   PCRE2_EXTENDED
 
#define PCRE_MULTILINE   PCRE2_MULTILINE
 
#define PCRE_UCP   PCRE2_UCP
 
#define PCRE_UTF8   PCRE2_UTF
 

Functions

int _npcre_print_error (int LOG_LEVEL, const char *file, const char *func, int line, int rc)
 print error helper
 
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
 
int npcre_match (char *str, N_PCRE *pcre)
 thread-safe pcre match, only returns TRUE/FALSE, no captures stored
 
int npcre_match_capture (char *str, N_PCRE *pcre)
 thread-safe pcre match with captures stored in pcre->match_list
 
N_PCREnpcre_new (char *str, int flags)
 pcre helper, compile and optimize regexp
 

Detailed Description

PCRE helpers for regex matching.

Author
Castagnier Mickael
Version
2.0
Date
04/12/2019

Definition in file n_pcre.h.

Macro Definition Documentation

◆ npcre_print_error

#define npcre_print_error (   __LEVEL__,
  __rc__ 
)
Value:
do { \
_npcre_print_error(__LEVEL__, __FILE__, __func__, __LINE__, __rc__); \
} while (0)

PCRE error logging function wrapper to get line and func.

Definition at line 82 of file n_pcre.h.

◆ PCRE2_CODE_UNIT_WIDTH

#define PCRE2_CODE_UNIT_WIDTH   8

Definition at line 37 of file n_pcre.h.

◆ PCRE2_LIST_FREE_CAST

#define PCRE2_LIST_FREE_CAST (   x)    ((PCRE2_UCHAR8**)(void*)(x))

Definition at line 78 of file n_pcre.h.

◆ PCRE_ANCHORED

#define PCRE_ANCHORED   PCRE2_ANCHORED

Definition at line 63 of file n_pcre.h.

◆ PCRE_CASELESS

#define PCRE_CASELESS   PCRE2_CASELESS

Definition at line 51 of file n_pcre.h.

◆ PCRE_DOTALL

#define PCRE_DOTALL   PCRE2_DOTALL

Definition at line 57 of file n_pcre.h.

◆ PCRE_EXTENDED

#define PCRE_EXTENDED   PCRE2_EXTENDED

Definition at line 60 of file n_pcre.h.

◆ PCRE_MULTILINE

#define PCRE_MULTILINE   PCRE2_MULTILINE

Definition at line 54 of file n_pcre.h.

◆ PCRE_UCP

#define PCRE_UCP   PCRE2_UCP

Definition at line 69 of file n_pcre.h.

◆ PCRE_UTF8

#define PCRE_UTF8   PCRE2_UTF

Definition at line 66 of file n_pcre.h.