ReactOS 0.4.15-dev-7934-g1dc8d80
regex.h File Reference

Go to the source code of this file.

Classes

struct  re_pattern_buffer
 
struct  re_registers
 
struct  regmatch_t
 

Macros

#define RE_BACKSLASH_ESCAPE_IN_LISTS   ((unsigned long int) 1)
 
#define RE_BK_PLUS_QM   (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
 
#define RE_CHAR_CLASSES   (RE_BK_PLUS_QM << 1)
 
#define RE_CONTEXT_INDEP_ANCHORS   (RE_CHAR_CLASSES << 1)
 
#define RE_CONTEXT_INDEP_OPS   (RE_CONTEXT_INDEP_ANCHORS << 1)
 
#define RE_CONTEXT_INVALID_OPS   (RE_CONTEXT_INDEP_OPS << 1)
 
#define RE_DOT_NEWLINE   (RE_CONTEXT_INVALID_OPS << 1)
 
#define RE_DOT_NOT_NULL   (RE_DOT_NEWLINE << 1)
 
#define RE_HAT_LISTS_NOT_NEWLINE   (RE_DOT_NOT_NULL << 1)
 
#define RE_INTERVALS   (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
#define RE_LIMITED_OPS   (RE_INTERVALS << 1)
 
#define RE_NEWLINE_ALT   (RE_LIMITED_OPS << 1)
 
#define RE_NO_BK_BRACES   (RE_NEWLINE_ALT << 1)
 
#define RE_NO_BK_PARENS   (RE_NO_BK_BRACES << 1)
 
#define RE_NO_BK_REFS   (RE_NO_BK_PARENS << 1)
 
#define RE_NO_BK_VBAR   (RE_NO_BK_REFS << 1)
 
#define RE_NO_EMPTY_RANGES   (RE_NO_BK_VBAR << 1)
 
#define RE_UNMATCHED_RIGHT_PAREN_ORD   (RE_NO_EMPTY_RANGES << 1)
 
#define RE_NO_POSIX_BACKTRACKING   (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
 
#define RE_NO_GNU_OPS   (RE_NO_POSIX_BACKTRACKING << 1)
 
#define RE_DEBUG   (RE_NO_GNU_OPS << 1)
 
#define RE_SYNTAX_EMACS   0
 
#define RE_SYNTAX_AWK
 
#define RE_SYNTAX_GNU_AWK
 
#define RE_SYNTAX_POSIX_AWK
 
#define RE_SYNTAX_GREP
 
#define RE_SYNTAX_EGREP
 
#define RE_SYNTAX_POSIX_EGREP    (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
 
#define RE_SYNTAX_ED   RE_SYNTAX_POSIX_BASIC
 
#define RE_SYNTAX_SED   RE_SYNTAX_POSIX_BASIC
 
#define _RE_SYNTAX_POSIX_COMMON
 
#define RE_SYNTAX_POSIX_BASIC    (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
 
#define RE_SYNTAX_POSIX_MINIMAL_BASIC    (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
 
#define RE_SYNTAX_POSIX_EXTENDED
 
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED
 
#define RE_DUP_MAX   (0x7fff)
 
#define REG_EXTENDED   1
 
#define REG_ICASE   (REG_EXTENDED << 1)
 
#define REG_NEWLINE   (REG_ICASE << 1)
 
#define REG_NOSUB   (REG_NEWLINE << 1)
 
#define REG_NOTBOL   1
 
#define REG_NOTEOL   (1 << 1)
 
#define RE_TRANSLATE_TYPE   char *
 
#define REGS_UNALLOCATED   0
 
#define REGS_REALLOCATE   1
 
#define REGS_FIXED   2
 
#define RE_NREGS   30
 
#define _RE_ARGS(args)   ()
 

Typedefs

typedef long int s_reg_t
 
typedef unsigned long int active_reg_t
 
typedef unsigned long int reg_syntax_t
 
typedef struct re_pattern_buffer regex_t
 
typedef int regoff_t
 

Enumerations

enum  reg_errcode_t {
  REG_NOERROR = 0 , REG_NOMATCH , REG_BADPAT , REG_ECOLLATE ,
  REG_ECTYPE , REG_EESCAPE , REG_ESUBREG , REG_EBRACK ,
  REG_EPAREN , REG_EBRACE , REG_BADBR , REG_ERANGE ,
  REG_ESPACE , REG_BADRPT , REG_EEND , REG_ESIZE ,
  REG_ERPAREN
}
 

Functions

reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax))
 
const char *__re_compile_pattern _RE_ARGS ((const char *pattern, size_t length, struct re_pattern_buffer *buffer))
 
int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer))
 
int __re_search _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs))
 
int __re_search_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop))
 
int __re_match _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs))
 
int __re_match_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop))
 
void __re_set_registers _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends))
 
int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern, int __cflags))
 
int __regexec _RE_ARGS ((const regex_t *__preg, const char *__string, size_t __nmatch, regmatch_t __pmatch[], int __eflags))
 
size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg, char *__errbuf, size_t __errbuf_size))
 
void __regfree _RE_ARGS ((regex_t *__preg))
 

Variables

reg_syntax_t re_syntax_options
 

Macro Definition Documentation

◆ _RE_ARGS

#define _RE_ARGS (   args)    ()

Definition at line 439 of file regex.h.

◆ _RE_SYNTAX_POSIX_COMMON

#define _RE_SYNTAX_POSIX_COMMON
Value:
#define RE_DOT_NOT_NULL
Definition: regex.h:102
#define RE_INTERVALS
Definition: regex.h:111
#define RE_DOT_NEWLINE
Definition: regex.h:98
#define RE_CHAR_CLASSES
Definition: regex.h:68
#define RE_NO_EMPTY_RANGES
Definition: regex.h:142

Definition at line 211 of file regex.h.

◆ RE_BACKSLASH_ESCAPE_IN_LISTS

#define RE_BACKSLASH_ESCAPE_IN_LISTS   ((unsigned long int) 1)

Definition at line 57 of file regex.h.

◆ RE_BK_PLUS_QM

#define RE_BK_PLUS_QM   (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)

Definition at line 62 of file regex.h.

◆ RE_CHAR_CLASSES

#define RE_CHAR_CLASSES   (RE_BK_PLUS_QM << 1)

Definition at line 68 of file regex.h.

◆ RE_CONTEXT_INDEP_ANCHORS

#define RE_CONTEXT_INDEP_ANCHORS   (RE_CHAR_CLASSES << 1)

Definition at line 82 of file regex.h.

◆ RE_CONTEXT_INDEP_OPS

#define RE_CONTEXT_INDEP_OPS   (RE_CONTEXT_INDEP_ANCHORS << 1)

Definition at line 90 of file regex.h.

◆ RE_CONTEXT_INVALID_OPS

#define RE_CONTEXT_INVALID_OPS   (RE_CONTEXT_INDEP_OPS << 1)

Definition at line 94 of file regex.h.

◆ RE_DEBUG

#define RE_DEBUG   (RE_NO_GNU_OPS << 1)

Definition at line 162 of file regex.h.

◆ RE_DOT_NEWLINE

#define RE_DOT_NEWLINE   (RE_CONTEXT_INVALID_OPS << 1)

Definition at line 98 of file regex.h.

◆ RE_DOT_NOT_NULL

#define RE_DOT_NOT_NULL   (RE_DOT_NEWLINE << 1)

Definition at line 102 of file regex.h.

◆ RE_DUP_MAX

#define RE_DUP_MAX   (0x7fff)

Definition at line 246 of file regex.h.

◆ RE_HAT_LISTS_NOT_NEWLINE

#define RE_HAT_LISTS_NOT_NEWLINE   (RE_DOT_NOT_NULL << 1)

Definition at line 106 of file regex.h.

◆ RE_INTERVALS

#define RE_INTERVALS   (RE_HAT_LISTS_NOT_NEWLINE << 1)

Definition at line 111 of file regex.h.

◆ RE_LIMITED_OPS

#define RE_LIMITED_OPS   (RE_INTERVALS << 1)

Definition at line 115 of file regex.h.

◆ RE_NEWLINE_ALT

#define RE_NEWLINE_ALT   (RE_LIMITED_OPS << 1)

Definition at line 119 of file regex.h.

◆ RE_NO_BK_BRACES

#define RE_NO_BK_BRACES   (RE_NEWLINE_ALT << 1)

Definition at line 124 of file regex.h.

◆ RE_NO_BK_PARENS

#define RE_NO_BK_PARENS   (RE_NO_BK_BRACES << 1)

Definition at line 128 of file regex.h.

◆ RE_NO_BK_REFS

#define RE_NO_BK_REFS   (RE_NO_BK_PARENS << 1)

Definition at line 132 of file regex.h.

◆ RE_NO_BK_VBAR

#define RE_NO_BK_VBAR   (RE_NO_BK_REFS << 1)

Definition at line 136 of file regex.h.

◆ RE_NO_EMPTY_RANGES

#define RE_NO_EMPTY_RANGES   (RE_NO_BK_VBAR << 1)

Definition at line 142 of file regex.h.

◆ RE_NO_GNU_OPS

#define RE_NO_GNU_OPS   (RE_NO_POSIX_BACKTRACKING << 1)

Definition at line 154 of file regex.h.

◆ RE_NO_POSIX_BACKTRACKING

#define RE_NO_POSIX_BACKTRACKING   (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)

Definition at line 150 of file regex.h.

◆ RE_NREGS

#define RE_NREGS   30

Definition at line 412 of file regex.h.

◆ RE_SYNTAX_AWK

#define RE_SYNTAX_AWK
Value:
#define RE_BACKSLASH_ESCAPE_IN_LISTS
Definition: regex.h:57
#define RE_CONTEXT_INDEP_ANCHORS
Definition: regex.h:82
#define RE_NO_BK_VBAR
Definition: regex.h:136
#define RE_NO_BK_REFS
Definition: regex.h:132
#define RE_UNMATCHED_RIGHT_PAREN_ORD
Definition: regex.h:146
#define RE_NO_BK_PARENS
Definition: regex.h:128
#define RE_NO_GNU_OPS
Definition: regex.h:154

Definition at line 176 of file regex.h.

◆ RE_SYNTAX_ED

#define RE_SYNTAX_ED   RE_SYNTAX_POSIX_BASIC

Definition at line 206 of file regex.h.

◆ RE_SYNTAX_EGREP

#define RE_SYNTAX_EGREP
Value:
#define RE_NEWLINE_ALT
Definition: regex.h:119
#define RE_CONTEXT_INDEP_OPS
Definition: regex.h:90
#define RE_HAT_LISTS_NOT_NEWLINE
Definition: regex.h:106

Definition at line 196 of file regex.h.

◆ RE_SYNTAX_EMACS

#define RE_SYNTAX_EMACS   0

Definition at line 174 of file regex.h.

◆ RE_SYNTAX_GNU_AWK

#define RE_SYNTAX_GNU_AWK
Value:

Definition at line 183 of file regex.h.

◆ RE_SYNTAX_GREP

#define RE_SYNTAX_GREP
Value:

Definition at line 191 of file regex.h.

◆ RE_SYNTAX_POSIX_AWK

#define RE_SYNTAX_POSIX_AWK

◆ RE_SYNTAX_POSIX_BASIC

#define RE_SYNTAX_POSIX_BASIC    (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)

Definition at line 215 of file regex.h.

◆ RE_SYNTAX_POSIX_EGREP

#define RE_SYNTAX_POSIX_EGREP    (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)

Definition at line 202 of file regex.h.

◆ RE_SYNTAX_POSIX_EXTENDED

#define RE_SYNTAX_POSIX_EXTENDED
Value:

Definition at line 224 of file regex.h.

◆ RE_SYNTAX_POSIX_MINIMAL_BASIC

#define RE_SYNTAX_POSIX_MINIMAL_BASIC    (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)

Definition at line 221 of file regex.h.

◆ RE_SYNTAX_POSIX_MINIMAL_EXTENDED

#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED

◆ RE_SYNTAX_SED

#define RE_SYNTAX_SED   RE_SYNTAX_POSIX_BASIC

Definition at line 208 of file regex.h.

◆ RE_TRANSLATE_TYPE

#define RE_TRANSLATE_TYPE   char *

Definition at line 321 of file regex.h.

◆ RE_UNMATCHED_RIGHT_PAREN_ORD

#define RE_UNMATCHED_RIGHT_PAREN_ORD   (RE_NO_EMPTY_RANGES << 1)

Definition at line 146 of file regex.h.

◆ REG_EXTENDED

#define REG_EXTENDED   1

Definition at line 253 of file regex.h.

◆ REG_ICASE

#define REG_ICASE   (REG_EXTENDED << 1)

Definition at line 257 of file regex.h.

◆ REG_NEWLINE

#define REG_NEWLINE   (REG_ICASE << 1)

Definition at line 262 of file regex.h.

◆ REG_NOSUB

#define REG_NOSUB   (REG_NEWLINE << 1)

Definition at line 266 of file regex.h.

◆ REG_NOTBOL

#define REG_NOTBOL   1

Definition at line 276 of file regex.h.

◆ REG_NOTEOL

#define REG_NOTEOL   (1 << 1)

Definition at line 279 of file regex.h.

◆ REGS_FIXED

#define REGS_FIXED   2

Definition at line 368 of file regex.h.

◆ REGS_REALLOCATE

#define REGS_REALLOCATE   1

Definition at line 367 of file regex.h.

◆ REGS_UNALLOCATED

#define REGS_UNALLOCATED   0

Definition at line 366 of file regex.h.

Typedef Documentation

◆ active_reg_t

Definition at line 46 of file regex.h.

◆ reg_syntax_t

Definition at line 53 of file regex.h.

◆ regex_t

Definition at line 392 of file regex.h.

◆ regoff_t

typedef int regoff_t

Definition at line 395 of file regex.h.

◆ s_reg_t

typedef long int s_reg_t

Definition at line 45 of file regex.h.

Enumeration Type Documentation

◆ reg_errcode_t

Enumerator
REG_NOERROR 
REG_NOMATCH 
REG_BADPAT 
REG_ECOLLATE 
REG_ECTYPE 
REG_EESCAPE 
REG_ESUBREG 
REG_EBRACK 
REG_EPAREN 
REG_EBRACE 
REG_BADBR 
REG_ERANGE 
REG_ESPACE 
REG_BADRPT 
REG_EEND 
REG_ESIZE 
REG_ERPAREN 

Definition at line 284 of file regex.h.

285{
286#ifdef _XOPEN_SOURCE
287 REG_ENOSYS = -1, /* This will never happen for this implementation. */
288#endif
289
290 REG_NOERROR = 0, /* Success. */
291 REG_NOMATCH, /* Didn't find a match (for regexec). */
292
293 /* POSIX regcomp return error codes. (In the order listed in the
294 standard.) */
295 REG_BADPAT, /* Invalid pattern. */
296 REG_ECOLLATE, /* Not implemented. */
297 REG_ECTYPE, /* Invalid character class name. */
298 REG_EESCAPE, /* Trailing backslash. */
299 REG_ESUBREG, /* Invalid back reference. */
300 REG_EBRACK, /* Unmatched left bracket. */
301 REG_EPAREN, /* Parenthesis imbalance. */
302 REG_EBRACE, /* Unmatched \{. */
303 REG_BADBR, /* Invalid contents of \{\}. */
304 REG_ERANGE, /* Invalid range end. */
305 REG_ESPACE, /* Ran out of memory. */
306 REG_BADRPT, /* No preceding re for repetition op. */
307
308 /* Error codes we've added. */
309 REG_EEND, /* Premature end. */
310 REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
311 REG_ERPAREN /* Unmatched ) or \‍); not returned from regcomp. */
reg_errcode_t
Definition: regex.h:285
@ REG_ERANGE
Definition: regex.h:304
@ REG_EEND
Definition: regex.h:309
@ REG_ESIZE
Definition: regex.h:310
@ REG_NOMATCH
Definition: regex.h:291
@ REG_BADPAT
Definition: regex.h:295
@ REG_ERPAREN
Definition: regex.h:311
@ REG_ECOLLATE
Definition: regex.h:296
@ REG_EBRACK
Definition: regex.h:300
@ REG_ECTYPE
Definition: regex.h:297
@ REG_ESPACE
Definition: regex.h:305
@ REG_EESCAPE
Definition: regex.h:298
@ REG_EPAREN
Definition: regex.h:301
@ REG_ESUBREG
Definition: regex.h:299
@ REG_BADBR
Definition: regex.h:303
@ REG_BADRPT
Definition: regex.h:306
@ REG_NOERROR
Definition: regex.h:290
@ REG_EBRACE
Definition: regex.h:302

Function Documentation

◆ _RE_ARGS() [1/12]

const char *re_compile_pattern _RE_ARGS ( (const char *pattern, size_t length, struct re_pattern_buffer *buffer )

◆ _RE_ARGS() [2/12]

int regexec _RE_ARGS ( (const regex_t *__preg, const char *__string, size_t __nmatch, regmatch_t __pmatch[], int __eflags)  )

◆ _RE_ARGS() [3/12]

size_t regerror _RE_ARGS ( (int __errcode, const regex_t *__preg, char *__errbuf, size_t __errbuf_size)  )

◆ _RE_ARGS() [4/12]

reg_syntax_t re_set_syntax _RE_ARGS ( (reg_syntax_t syntax)  )

◆ _RE_ARGS() [5/12]

void regfree _RE_ARGS ( (regex_t *__preg)  )

◆ _RE_ARGS() [6/12]

int regcomp _RE_ARGS ( (regex_t *__preg, const char *__pattern, int __cflags)  )

◆ _RE_ARGS() [7/12]

int re_compile_fastmap _RE_ARGS ( (struct re_pattern_buffer *buffer )

◆ _RE_ARGS() [8/12]

◆ _RE_ARGS() [9/12]

◆ _RE_ARGS() [10/12]

int re_search_2 _RE_ARGS ( (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop)  )

◆ _RE_ARGS() [11/12]

int re_match_2 _RE_ARGS ( (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop)  )

◆ _RE_ARGS() [12/12]

void re_set_registers _RE_ARGS ( (struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)  )

Variable Documentation

◆ re_syntax_options

reg_syntax_t re_syntax_options
extern