ndn-lite
Data Structures | Macros | Typedefs | Enumerations | Functions
re.c File Reference
#include "re.h"
#include <stdio.h>

Data Structures

struct  regex_t
 

Macros

#define MAX_REGEXP_OBJECTS   30 /* Max number of regex symbols in expression. */
 
#define MAX_CHAR_CLASS_LEN   40 /* Max length of character-class buffer in. */
 

Typedefs

typedef struct regex_t regex_t
 

Enumerations

enum  {
  UNUSED, DOT, BEGIN, END,
  QUESTIONMARK, STAR, PLUS, CHAR,
  CHAR_CLASS, INV_CHAR_CLASS, DIGIT, NOT_DIGIT,
  ALPHA, NOT_ALPHA, WHITESPACE, NOT_WHITESPACE
}
 

Functions

static int matchpattern (regex_t *pattern, const char *text)
 
static int matchcharclass (char c, const char *str)
 
static int matchstar (regex_t p, regex_t *pattern, const char *text)
 
static int matchplus (regex_t p, regex_t *pattern, const char *text)
 
static int matchone (regex_t p, char c)
 
static int matchdigit (char c)
 
static int matchalpha (char c)
 
static int matchwhitespace (char c)
 
static int matchmetachar (char c, const char *str)
 
static int matchrange (char c, const char *str)
 
static int ismetachar (char c)
 
int re_match (const char *pattern, const char *text)
 Find matches of the txt pattern inside text (will compile automatically first). More...
 
int re_matchp (re_t pattern, const char *text)
 Find matches of the compiled pattern inside text. More...
 
re_t re_compile (const char *pattern)
 Compile regex string pattern to a regex_t-array. More...
 
void re_print (regex_t *pattern)
 
static int matchalphanum (char c)
 
static int matchquestion (regex_t p, regex_t *pattern, const char *text)
 

Macro Definition Documentation

◆ MAX_CHAR_CLASS_LEN

#define MAX_CHAR_CLASS_LEN   40 /* Max length of character-class buffer in. */

◆ MAX_REGEXP_OBJECTS

#define MAX_REGEXP_OBJECTS   30 /* Max number of regex symbols in expression. */

Typedef Documentation

◆ regex_t

typedef struct regex_t regex_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNUSED 
DOT 
BEGIN 
END 
QUESTIONMARK 
STAR 
PLUS 
CHAR 
CHAR_CLASS 
INV_CHAR_CLASS 
DIGIT 
NOT_DIGIT 
ALPHA 
NOT_ALPHA 
WHITESPACE 
NOT_WHITESPACE 

Function Documentation

◆ ismetachar()

static int ismetachar ( char  c)
static

◆ matchalpha()

static int matchalpha ( char  c)
static

◆ matchalphanum()

static int matchalphanum ( char  c)
static

◆ matchcharclass()

static int matchcharclass ( char  c,
const char *  str 
)
static

◆ matchdigit()

static int matchdigit ( char  c)
static

◆ matchmetachar()

static int matchmetachar ( char  c,
const char *  str 
)
static

◆ matchone()

static int matchone ( regex_t  p,
char  c 
)
static

◆ matchpattern()

static int matchpattern ( regex_t pattern,
const char *  text 
)
static

◆ matchplus()

static int matchplus ( regex_t  p,
regex_t pattern,
const char *  text 
)
static

◆ matchquestion()

static int matchquestion ( regex_t  p,
regex_t pattern,
const char *  text 
)
static

◆ matchrange()

static int matchrange ( char  c,
const char *  str 
)
static

◆ matchstar()

static int matchstar ( regex_t  p,
regex_t pattern,
const char *  text 
)
static

◆ matchwhitespace()

static int matchwhitespace ( char  c)
static

◆ re_print()

void re_print ( regex_t pattern)