VSF Documented
Data Structures | Macros | Typedefs | Functions
arg_rex.c File Reference
#include "argtable3.h"
#include "argtable3_private.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>

Data Structures

struct  TRexMatch
 
struct  privhdr
 
struct  tagTRexNode
 
struct  TRex
 

Macros

#define _TREX_H_
 
#define TRexChar   char
 
#define MAX_CHAR   0xFF
 
#define _TREXC(c)   (c)
 
#define trex_strlen   strlen
 
#define trex_printf   printf
 
#define TREX_API   extern
 
#define TRex_True   1
 
#define TRex_False   0
 
#define TREX_ICASE   ARG_REX_ICASE
 
#define scisprint   isprint
 
#define scstrlen   strlen
 
#define scprintf   printf
 
#define _SC(x)   (x)
 
#define OP_GREEDY   (MAX_CHAR + 1) /* * + ? {n} */
 
#define OP_OR   (MAX_CHAR + 2)
 
#define OP_EXPR   (MAX_CHAR + 3) /* parentesis () */
 
#define OP_NOCAPEXPR   (MAX_CHAR + 4) /* parentesis (?:) */
 
#define OP_DOT   (MAX_CHAR + 5)
 
#define OP_CLASS   (MAX_CHAR + 6)
 
#define OP_CCLASS   (MAX_CHAR + 7)
 
#define OP_NCLASS   (MAX_CHAR + 8) /* negates class the [^ */
 
#define OP_RANGE   (MAX_CHAR + 9)
 
#define OP_CHAR   (MAX_CHAR + 10)
 
#define OP_EOL   (MAX_CHAR + 11)
 
#define OP_BOL   (MAX_CHAR + 12)
 
#define OP_WB   (MAX_CHAR + 13)
 
#define TREX_SYMBOL_ANY_CHAR   ('.')
 
#define TREX_SYMBOL_GREEDY_ONE_OR_MORE   ('+')
 
#define TREX_SYMBOL_GREEDY_ZERO_OR_MORE   ('*')
 
#define TREX_SYMBOL_GREEDY_ZERO_OR_ONE   ('?')
 
#define TREX_SYMBOL_BRANCH   ('|')
 
#define TREX_SYMBOL_END_OF_STRING   ('$')
 
#define TREX_SYMBOL_BEGINNING_OF_STRING   ('^')
 
#define TREX_SYMBOL_ESCAPE_CHAR   ('\\')
 

Typedefs

typedef unsigned int TRexBool
 
typedef struct TRex TRex
 
typedef int TRexNodeType
 
typedef struct tagTRexNode TRexNode
 

Functions

TREX_API TRextrex_compile (const TRexChar *pattern, const TRexChar **error, int flags)
 
TREX_API void trex_free (TRex *exp)
 
TREX_API TRexBool trex_match (TRex *exp, const TRexChar *text)
 
TREX_API TRexBool trex_search (TRex *exp, const TRexChar *text, const TRexChar **out_begin, const TRexChar **out_end)
 
TREX_API TRexBool trex_searchrange (TRex *exp, const TRexChar *text_begin, const TRexChar *text_end, const TRexChar **out_begin, const TRexChar **out_end)
 
TREX_API int trex_getsubexpcount (TRex *exp)
 
TREX_API TRexBool trex_getsubexp (TRex *exp, int n, TRexMatch *subexp)
 
struct arg_rexarg_rex0 (const char *shortopts, const char *longopts, const char *pattern, const char *datatype, int flags, const char *glossary)
 
struct arg_rexarg_rex1 (const char *shortopts, const char *longopts, const char *pattern, const char *datatype, int flags, const char *glossary)
 
struct arg_rexarg_rexn (const char *shortopts, const char *longopts, const char *pattern, const char *datatype, int mincount, int maxcount, int flags, const char *glossary)
 

Macro Definition Documentation

◆ _TREX_H_

#define _TREX_H_

◆ TRexChar

#define TRexChar   char

◆ MAX_CHAR

#define MAX_CHAR   0xFF

◆ _TREXC

#define _TREXC (   c)    (c)

◆ trex_strlen

#define trex_strlen   strlen

◆ trex_printf

#define trex_printf   printf

◆ TREX_API

#define TREX_API   extern

◆ TRex_True

#define TRex_True   1

◆ TRex_False

#define TRex_False   0

◆ TREX_ICASE

#define TREX_ICASE   ARG_REX_ICASE

◆ scisprint

#define scisprint   isprint

◆ scstrlen

#define scstrlen   strlen

◆ scprintf

#define scprintf   printf

◆ _SC

#define _SC (   x)    (x)

◆ OP_GREEDY

#define OP_GREEDY   (MAX_CHAR + 1) /* * + ? {n} */

◆ OP_OR

#define OP_OR   (MAX_CHAR + 2)

◆ OP_EXPR

#define OP_EXPR   (MAX_CHAR + 3) /* parentesis () */

◆ OP_NOCAPEXPR

#define OP_NOCAPEXPR   (MAX_CHAR + 4) /* parentesis (?:) */

◆ OP_DOT

#define OP_DOT   (MAX_CHAR + 5)

◆ OP_CLASS

#define OP_CLASS   (MAX_CHAR + 6)

◆ OP_CCLASS

#define OP_CCLASS   (MAX_CHAR + 7)

◆ OP_NCLASS

#define OP_NCLASS   (MAX_CHAR + 8) /* negates class the [^ */

◆ OP_RANGE

#define OP_RANGE   (MAX_CHAR + 9)

◆ OP_CHAR

#define OP_CHAR   (MAX_CHAR + 10)

◆ OP_EOL

#define OP_EOL   (MAX_CHAR + 11)

◆ OP_BOL

#define OP_BOL   (MAX_CHAR + 12)

◆ OP_WB

#define OP_WB   (MAX_CHAR + 13)

◆ TREX_SYMBOL_ANY_CHAR

#define TREX_SYMBOL_ANY_CHAR   ('.')

◆ TREX_SYMBOL_GREEDY_ONE_OR_MORE

#define TREX_SYMBOL_GREEDY_ONE_OR_MORE   ('+')

◆ TREX_SYMBOL_GREEDY_ZERO_OR_MORE

#define TREX_SYMBOL_GREEDY_ZERO_OR_MORE   ('*')

◆ TREX_SYMBOL_GREEDY_ZERO_OR_ONE

#define TREX_SYMBOL_GREEDY_ZERO_OR_ONE   ('?')

◆ TREX_SYMBOL_BRANCH

#define TREX_SYMBOL_BRANCH   ('|')

◆ TREX_SYMBOL_END_OF_STRING

#define TREX_SYMBOL_END_OF_STRING   ('$')

◆ TREX_SYMBOL_BEGINNING_OF_STRING

#define TREX_SYMBOL_BEGINNING_OF_STRING   ('^')

◆ TREX_SYMBOL_ESCAPE_CHAR

#define TREX_SYMBOL_ESCAPE_CHAR   ('\\')

Typedef Documentation

◆ TRexBool

typedef unsigned int TRexBool

◆ TRex

typedef struct TRex TRex

◆ TRexNodeType

typedef int TRexNodeType

◆ TRexNode

typedef struct tagTRexNode TRexNode

Function Documentation

◆ trex_compile()

TRex * trex_compile ( const TRexChar pattern,
const TRexChar **  error,
int  flags 
)

◆ trex_free()

void trex_free ( TRex exp)

◆ trex_match()

TRexBool trex_match ( TRex exp,
const TRexChar text 
)

◆ trex_search()

TRexBool trex_search ( TRex exp,
const TRexChar text,
const TRexChar **  out_begin,
const TRexChar **  out_end 
)

◆ trex_searchrange()

TRexBool trex_searchrange ( TRex exp,
const TRexChar text_begin,
const TRexChar text_end,
const TRexChar **  out_begin,
const TRexChar **  out_end 
)

◆ trex_getsubexpcount()

int trex_getsubexpcount ( TRex exp)

◆ trex_getsubexp()

TRexBool trex_getsubexp ( TRex exp,
int  n,
TRexMatch subexp 
)

◆ arg_rex0()

struct arg_rex * arg_rex0 ( const char *  shortopts,
const char *  longopts,
const char *  pattern,
const char *  datatype,
int  flags,
const char *  glossary 
)

◆ arg_rex1()

struct arg_rex * arg_rex1 ( const char *  shortopts,
const char *  longopts,
const char *  pattern,
const char *  datatype,
int  flags,
const char *  glossary 
)

◆ arg_rexn()

struct arg_rex * arg_rexn ( const char *  shortopts,
const char *  longopts,
const char *  pattern,
const char *  datatype,
int  mincount,
int  maxcount,
int  flags,
const char *  glossary 
)
Generated from commit: vsfteam/vsf@c3767bf