The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
regex.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  re_pattern_buffer
 
struct  re_registers
 
struct  regmatch_t
 

Macros

#define __restrict
 
#define __restrict_arr
 
#define __STDC__   1
 
#define _RE_ARGS(args)   args
 
#define _RE_SYNTAX_POSIX_COMMON
 
#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_DEBUG   (RE_NO_GNU_OPS << 1)
 
#define RE_DOT_NEWLINE   (RE_CONTEXT_INVALID_OPS << 1)
 
#define RE_DOT_NOT_NULL   (RE_DOT_NEWLINE << 1)
 
#define RE_DUP_MAX   (0x7fff)
 
#define RE_HAT_LISTS_NOT_NEWLINE   (RE_DOT_NOT_NULL << 1)
 
#define RE_INTERVALS   (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
#define RE_INVALID_INTERVAL_ORD   (RE_DEBUG << 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_NO_GNU_OPS   (RE_NO_POSIX_BACKTRACKING << 1)
 
#define RE_NO_POSIX_BACKTRACKING   (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
 
#define RE_NREGS   30
 
#define RE_SYNTAX_AWK
 
#define RE_SYNTAX_ED   RE_SYNTAX_POSIX_BASIC
 
#define RE_SYNTAX_EGREP
 
#define RE_SYNTAX_EMACS   0
 
#define RE_SYNTAX_GNU_AWK
 
#define RE_SYNTAX_GREP
 
#define RE_SYNTAX_POSIX_AWK
 
#define RE_SYNTAX_POSIX_BASIC   (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
 
#define RE_SYNTAX_POSIX_EGREP
 
#define RE_SYNTAX_POSIX_EXTENDED
 
#define RE_SYNTAX_POSIX_MINIMAL_BASIC   (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
 
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED
 
#define RE_SYNTAX_SED   RE_SYNTAX_POSIX_BASIC
 
#define RE_TRANSLATE_TYPE   char *
 
#define RE_UNMATCHED_RIGHT_PAREN_ORD   (RE_NO_EMPTY_RANGES << 1)
 
#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 REGS_FIXED   2
 
#define REGS_REALLOCATE   1
 
#define REGS_UNALLOCATED   0
 

Typedefs

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
 
typedef long int s_reg_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 *__restrict __preg, const char *__restrict __pattern, int __cflags))
 
int regexec _RE_ARGS ((const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[__restrict_arr], 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

#define __restrict

Definition at line 532 of file regex.h.

#define __restrict_arr

Definition at line 539 of file regex.h.

#define __STDC__   1

Definition at line 438 of file regex.h.

#define _RE_ARGS (   args)    args

Definition at line 443 of file regex.h.

#define _RE_SYNTAX_POSIX_COMMON
Value:
#define RE_CHAR_CLASSES
Definition: regex.h:66
#define RE_DOT_NOT_NULL
Definition: regex.h:100
#define RE_NO_EMPTY_RANGES
Definition: regex.h:140
#define RE_DOT_NEWLINE
Definition: regex.h:96
#define RE_INTERVALS
Definition: regex.h:109

Definition at line 215 of file regex.h.

#define RE_BACKSLASH_ESCAPE_IN_LISTS   ((unsigned long int) 1)

Definition at line 55 of file regex.h.

#define RE_BK_PLUS_QM   (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)

Definition at line 60 of file regex.h.

#define RE_CHAR_CLASSES   (RE_BK_PLUS_QM << 1)

Definition at line 66 of file regex.h.

#define RE_CONTEXT_INDEP_ANCHORS   (RE_CHAR_CLASSES << 1)

Definition at line 80 of file regex.h.

#define RE_CONTEXT_INDEP_OPS   (RE_CONTEXT_INDEP_ANCHORS << 1)

Definition at line 88 of file regex.h.

#define RE_CONTEXT_INVALID_OPS   (RE_CONTEXT_INDEP_OPS << 1)

Definition at line 92 of file regex.h.

#define RE_DEBUG   (RE_NO_GNU_OPS << 1)

Definition at line 160 of file regex.h.

#define RE_DOT_NEWLINE   (RE_CONTEXT_INVALID_OPS << 1)

Definition at line 96 of file regex.h.

#define RE_DOT_NOT_NULL   (RE_DOT_NEWLINE << 1)

Definition at line 100 of file regex.h.

#define RE_DUP_MAX   (0x7fff)

Definition at line 250 of file regex.h.

#define RE_HAT_LISTS_NOT_NEWLINE   (RE_DOT_NOT_NULL << 1)

Definition at line 104 of file regex.h.

#define RE_INTERVALS   (RE_HAT_LISTS_NOT_NEWLINE << 1)

Definition at line 109 of file regex.h.

#define RE_INVALID_INTERVAL_ORD   (RE_DEBUG << 1)

Definition at line 165 of file regex.h.

#define RE_LIMITED_OPS   (RE_INTERVALS << 1)

Definition at line 113 of file regex.h.

#define RE_NEWLINE_ALT   (RE_LIMITED_OPS << 1)

Definition at line 117 of file regex.h.

#define RE_NO_BK_BRACES   (RE_NEWLINE_ALT << 1)

Definition at line 122 of file regex.h.

#define RE_NO_BK_PARENS   (RE_NO_BK_BRACES << 1)

Definition at line 126 of file regex.h.

#define RE_NO_BK_REFS   (RE_NO_BK_PARENS << 1)

Definition at line 130 of file regex.h.

#define RE_NO_BK_VBAR   (RE_NO_BK_REFS << 1)

Definition at line 134 of file regex.h.

#define RE_NO_EMPTY_RANGES   (RE_NO_BK_VBAR << 1)

Definition at line 140 of file regex.h.

#define RE_NO_GNU_OPS   (RE_NO_POSIX_BACKTRACKING << 1)

Definition at line 152 of file regex.h.

#define RE_NO_POSIX_BACKTRACKING   (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)

Definition at line 148 of file regex.h.

#define RE_NREGS   30

Definition at line 416 of file regex.h.

#define RE_SYNTAX_AWK
Value:
#define RE_NO_BK_REFS
Definition: regex.h:130
#define RE_CONTEXT_INDEP_ANCHORS
Definition: regex.h:80
#define RE_NO_BK_VBAR
Definition: regex.h:134
#define RE_BACKSLASH_ESCAPE_IN_LISTS
Definition: regex.h:55
#define RE_UNMATCHED_RIGHT_PAREN_ORD
Definition: regex.h:144
#define RE_DOT_NOT_NULL
Definition: regex.h:100
#define RE_NO_EMPTY_RANGES
Definition: regex.h:140
#define RE_DOT_NEWLINE
Definition: regex.h:96
#define RE_NO_GNU_OPS
Definition: regex.h:152
#define RE_NO_BK_PARENS
Definition: regex.h:126

Definition at line 179 of file regex.h.

#define RE_SYNTAX_ED   RE_SYNTAX_POSIX_BASIC

Definition at line 210 of file regex.h.

#define RE_SYNTAX_EGREP
Value:
#define RE_CONTEXT_INDEP_ANCHORS
Definition: regex.h:80
#define RE_NO_BK_VBAR
Definition: regex.h:134
#define RE_CHAR_CLASSES
Definition: regex.h:66
#define RE_NEWLINE_ALT
Definition: regex.h:117
#define RE_CONTEXT_INDEP_OPS
Definition: regex.h:88
#define RE_NO_BK_PARENS
Definition: regex.h:126
#define RE_HAT_LISTS_NOT_NEWLINE
Definition: regex.h:104

Definition at line 199 of file regex.h.

#define RE_SYNTAX_EMACS   0

Definition at line 177 of file regex.h.

#define RE_SYNTAX_GNU_AWK
Value:
#define RE_BACKSLASH_ESCAPE_IN_LISTS
Definition: regex.h:55
#define RE_DOT_NOT_NULL
Definition: regex.h:100
#define RE_CONTEXT_INDEP_OPS
Definition: regex.h:88
#define RE_INTERVALS
Definition: regex.h:109
#define RE_DEBUG
Definition: regex.h:160
#define RE_SYNTAX_POSIX_EXTENDED
Definition: regex.h:228

Definition at line 186 of file regex.h.

#define RE_SYNTAX_GREP
Value:
#define RE_CHAR_CLASSES
Definition: regex.h:66
#define RE_NEWLINE_ALT
Definition: regex.h:117
#define RE_INTERVALS
Definition: regex.h:109
#define RE_BK_PLUS_QM
Definition: regex.h:60
#define RE_HAT_LISTS_NOT_NEWLINE
Definition: regex.h:104

Definition at line 194 of file regex.h.

#define RE_SYNTAX_POSIX_AWK
Value:
#define RE_BACKSLASH_ESCAPE_IN_LISTS
Definition: regex.h:55
#define RE_INTERVALS
Definition: regex.h:109
#define RE_NO_GNU_OPS
Definition: regex.h:152
#define RE_SYNTAX_POSIX_EXTENDED
Definition: regex.h:228

Definition at line 190 of file regex.h.

#define RE_SYNTAX_POSIX_BASIC   (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)

Definition at line 219 of file regex.h.

#define RE_SYNTAX_POSIX_EGREP
Value:
#define RE_NO_BK_BRACES
Definition: regex.h:122
#define RE_INVALID_INTERVAL_ORD
Definition: regex.h:165
#define RE_SYNTAX_EGREP
Definition: regex.h:199
#define RE_INTERVALS
Definition: regex.h:109

Definition at line 205 of file regex.h.

#define RE_SYNTAX_POSIX_EXTENDED
Value:
#define RE_NO_BK_BRACES
Definition: regex.h:122
#define RE_CONTEXT_INDEP_ANCHORS
Definition: regex.h:80
#define RE_NO_BK_VBAR
Definition: regex.h:134
#define RE_UNMATCHED_RIGHT_PAREN_ORD
Definition: regex.h:144
#define RE_CONTEXT_INDEP_OPS
Definition: regex.h:88
#define RE_NO_BK_PARENS
Definition: regex.h:126
#define RE_CONTEXT_INVALID_OPS
Definition: regex.h:92
#define _RE_SYNTAX_POSIX_COMMON
Definition: regex.h:215

Definition at line 228 of file regex.h.

#define RE_SYNTAX_POSIX_MINIMAL_BASIC   (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)

Definition at line 225 of file regex.h.

#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED
Value:
#define RE_NO_BK_BRACES
Definition: regex.h:122
#define RE_NO_BK_REFS
Definition: regex.h:130
#define RE_CONTEXT_INDEP_ANCHORS
Definition: regex.h:80
#define RE_NO_BK_VBAR
Definition: regex.h:134
#define RE_UNMATCHED_RIGHT_PAREN_ORD
Definition: regex.h:144
#define RE_NO_BK_PARENS
Definition: regex.h:126
#define RE_CONTEXT_INVALID_OPS
Definition: regex.h:92
#define _RE_SYNTAX_POSIX_COMMON
Definition: regex.h:215

Definition at line 236 of file regex.h.

#define RE_SYNTAX_SED   RE_SYNTAX_POSIX_BASIC

Definition at line 212 of file regex.h.

#define RE_TRANSLATE_TYPE   char *

Definition at line 325 of file regex.h.

#define RE_UNMATCHED_RIGHT_PAREN_ORD   (RE_NO_EMPTY_RANGES << 1)

Definition at line 144 of file regex.h.

#define REG_EXTENDED   1

Definition at line 257 of file regex.h.

#define REG_ICASE   (REG_EXTENDED << 1)

Definition at line 261 of file regex.h.

#define REG_NEWLINE   (REG_ICASE << 1)

Definition at line 266 of file regex.h.

#define REG_NOSUB   (REG_NEWLINE << 1)

Definition at line 270 of file regex.h.

#define REG_NOTBOL   1

Definition at line 280 of file regex.h.

#define REG_NOTEOL   (1 << 1)

Definition at line 283 of file regex.h.

#define REGS_FIXED   2

Definition at line 372 of file regex.h.

#define REGS_REALLOCATE   1

Definition at line 371 of file regex.h.

#define REGS_UNALLOCATED   0

Definition at line 370 of file regex.h.

Typedef Documentation

typedef unsigned long int active_reg_t

Definition at line 44 of file regex.h.

typedef unsigned long int reg_syntax_t

Definition at line 51 of file regex.h.

typedef struct re_pattern_buffer regex_t

Definition at line 396 of file regex.h.

typedef int regoff_t

Definition at line 399 of file regex.h.

typedef long int s_reg_t

Definition at line 43 of file regex.h.

Enumeration Type Documentation

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 288 of file regex.h.

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

Function Documentation

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 *__restrict __preg, const char *__restrict __pattern, int __cflags)  )
int regexec _RE_ARGS ( (const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[__restrict_arr], 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)  )

Variable Documentation

reg_syntax_t re_syntax_options

Definition at line 1337 of file regex.c.