Back to index

nagios-plugins  1.4.16
Classes | Defines | Typedefs | Enumerations | Functions
regex_internal.h File Reference
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <langinfo.h>
#include "localcharset.h"
#include <wchar.h>
#include <wctype.h>
#include <stdint.h>
#include <alloca.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  re_node_set
struct  re_token_t
struct  re_string_t
struct  bin_tree_t
struct  bin_tree_storage_t
struct  re_dfastate_t
struct  re_state_table_entry
struct  state_array_t
struct  re_sub_match_last_t
struct  re_sub_match_top_t
struct  re_backref_cache_entry
struct  re_match_context_t
struct  re_sift_context_t
struct  re_fail_stack_ent_t
struct  re_fail_stack_t
struct  re_dfa_t
struct  bracket_elem_t
union  re_token_t.opr
union  bracket_elem_t.opr

Defines

#define __libc_lock_init(NAME)   do { } while (0)
#define __libc_lock_lock(NAME)   do { } while (0)
#define __libc_lock_unlock(NAME)   do { } while (0)
#define isblank(ch)   ((ch) == ' ' || (ch) == '\t')
#define gettext(msgid)   (msgid)
#define gettext_noop(String)   String
#define SIZE_MAX   ((size_t) -1)
#define BE(expr, val)   (expr)
#define ASCII_CHARS   0x80
#define SBC_MAX   (UCHAR_MAX + 1)
#define COLL_ELEM_LEN_MAX   8
#define NEWLINE_CHAR   '\n'
#define WIDE_NEWLINE_CHAR   L'\n'
#define __wctype   wctype
#define __iswctype   iswctype
#define __btowc   btowc
#define __wcrtomb   wcrtomb
#define __mbrtowc   mbrtowc
#define __regfree   regfree
#define attribute_hidden
#define __attribute(arg)
#define REG_MISSING   ((Idx) -1)
#define REG_ERROR   ((Idx) -2)
#define REG_VALID_INDEX(n)   (0 <= (n))
#define REG_VALID_NONZERO_INDEX(n)   (0 < (n))
#define BITSET_WORD_MAX   ULONG_MAX
#define BITSET_WORDS   ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
#define PREV_WORD_CONSTRAINT   0x0001
#define PREV_NOTWORD_CONSTRAINT   0x0002
#define NEXT_WORD_CONSTRAINT   0x0004
#define NEXT_NOTWORD_CONSTRAINT   0x0008
#define PREV_NEWLINE_CONSTRAINT   0x0010
#define NEXT_NEWLINE_CONSTRAINT   0x0020
#define PREV_BEGBUF_CONSTRAINT   0x0040
#define NEXT_ENDBUF_CONSTRAINT   0x0080
#define WORD_DELIM_CONSTRAINT   0x0100
#define NOT_WORD_DELIM_CONSTRAINT   0x0200
#define EPSILON_BIT   8
#define IS_EPSILON_NODE(type)   ((type) & EPSILON_BIT)
#define internal_function
#define re_string_peek_byte(pstr, offset)   ((pstr)->mbs[(pstr)->cur_idx + offset])
#define re_string_fetch_byte(pstr)   ((pstr)->mbs[(pstr)->cur_idx++])
#define re_string_first_byte(pstr, idx)   ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
#define re_string_is_single_byte_char(pstr, idx)
#define re_string_eoi(pstr)   ((pstr)->stop <= (pstr)->cur_idx)
#define re_string_cur_idx(pstr)   ((pstr)->cur_idx)
#define re_string_get_buffer(pstr)   ((pstr)->mbs)
#define re_string_length(pstr)   ((pstr)->len)
#define re_string_byte_at(pstr, idx)   ((pstr)->mbs[idx])
#define re_string_skip_bytes(pstr, idx)   ((pstr)->cur_idx += (idx))
#define re_string_set_index(pstr, idx)   ((pstr)->cur_idx = (idx))
#define __libc_use_alloca(n)   0
#define alloca(n)   malloc (n)
#define MAX(a, b)   ((a) < (b) ? (b) : (a))
#define re_malloc(t, n)   ((t *) malloc ((n) * sizeof (t)))
#define re_realloc(p, t, n)   ((t *) realloc (p, (n) * sizeof (t)))
#define re_free(p)   free (p)
#define BIN_TREE_STORAGE_SIZE   ((1024 - sizeof (void *)) / sizeof (bin_tree_t))
#define CONTEXT_WORD   1
#define CONTEXT_NEWLINE   (CONTEXT_WORD << 1)
#define CONTEXT_BEGBUF   (CONTEXT_NEWLINE << 1)
#define CONTEXT_ENDBUF   (CONTEXT_BEGBUF << 1)
#define IS_WORD_CONTEXT(c)   ((c) & CONTEXT_WORD)
#define IS_NEWLINE_CONTEXT(c)   ((c) & CONTEXT_NEWLINE)
#define IS_BEGBUF_CONTEXT(c)   ((c) & CONTEXT_BEGBUF)
#define IS_ENDBUF_CONTEXT(c)   ((c) & CONTEXT_ENDBUF)
#define IS_ORDINARY_CONTEXT(c)   ((c) == 0)
#define IS_WORD_CHAR(ch)   (isalnum (ch) || (ch) == '_')
#define IS_NEWLINE(ch)   ((ch) == NEWLINE_CHAR)
#define IS_WIDE_WORD_CHAR(ch)   (iswalnum (ch) || (ch) == L'_')
#define IS_WIDE_NEWLINE(ch)   ((ch) == WIDE_NEWLINE_CHAR)
#define NOT_SATISFY_PREV_CONSTRAINT(constraint, context)
#define NOT_SATISFY_NEXT_CONSTRAINT(constraint, context)
#define re_node_set_init_empty(set)   memset (set, '\0', sizeof (re_node_set))
#define re_node_set_remove(set, id)   (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
#define re_node_set_empty(p)   ((p)->nelem = 0)
#define re_node_set_free(set)   re_free ((set)->elems)
#define __GNUC_PREREQ(maj, min)   0
#define __attribute_warn_unused_result__   /* empty */

Typedefs

typedef __re_idx_t Idx
typedef __re_size_t re_hashval_t
typedef unsigned long int bitset_word_t
typedef bitset_word_t bitset_t [BITSET_WORDS]
typedef bitset_word_tre_bitset_ptr_t
typedef const bitset_word_tre_const_bitset_ptr_t
typedef struct re_string_t
typedef struct re_dfa_t
typedef struct bin_tree_t
typedef struct bin_tree_storage_t
typedef struct re_dfastate_t

Enumerations

enum  re_context_type {
  INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT, INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
  LINE_FIRST = PREV_NEWLINE_CONSTRAINT, LINE_LAST = NEXT_NEWLINE_CONSTRAINT, BUF_FIRST = PREV_BEGBUF_CONSTRAINT, BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
  WORD_DELIM = WORD_DELIM_CONSTRAINT, NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT
}
enum  re_token_type_t {
  NON_TYPE = 0, CHARACTER = 1, END_OF_RE = 2, SIMPLE_BRACKET = 3,
  OP_BACK_REF = 4, OP_PERIOD = 5, OP_OPEN_SUBEXP = EPSILON_BIT | 0, OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
  OP_ALT = EPSILON_BIT | 2, OP_DUP_ASTERISK = EPSILON_BIT | 3, ANCHOR = EPSILON_BIT | 4, CONCAT = 16,
  SUBEXP = 17, OP_DUP_PLUS = 18, OP_DUP_QUESTION, OP_OPEN_BRACKET,
  OP_CLOSE_BRACKET, OP_CHARSET_RANGE, OP_OPEN_DUP_NUM, OP_CLOSE_DUP_NUM,
  OP_NON_MATCH_LIST, OP_OPEN_COLL_ELEM, OP_CLOSE_COLL_ELEM, OP_OPEN_EQUIV_CLASS,
  OP_CLOSE_EQUIV_CLASS, OP_OPEN_CHAR_CLASS, OP_CLOSE_CHAR_CLASS, OP_WORD,
  OP_NOTWORD, OP_SPACE, OP_NOTSPACE, BACK_SLASH
}
enum  bracket_elem_type {
  SB_CHAR, MB_CHAR, EQUIV_CLASS, COLL_SYM,
  CHAR_CLASS
}

Functions

static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) internal_function
static void build_upper_buffer (re_string_t *pstr) internal_function
static void re_string_translate_buffer (re_string_t *pstr) internal_function
static unsigned int re_string_context_at (const re_string_t *input, Idx idx, int eflags) internal_function __attribute((pure))
static void bitset_set (bitset_t set, Idx i)
static void bitset_clear (bitset_t set, Idx i)
static bool bitset_contain (const bitset_t set, Idx i)
static void bitset_empty (bitset_t set)
static void bitset_set_all (bitset_t set)
static void bitset_copy (bitset_t dest, const bitset_t src)
static void bitset_not (bitset_t set)
static void bitset_merge (bitset_t dest, const bitset_t src)
static void bitset_mask (bitset_t dest, const bitset_t src)

Class Documentation

struct re_node_set

Definition at line 222 of file regex_internal.h.

Class Members
Idx alloc
Idx * elems
Idx nelem
struct re_token_t

Definition at line 328 of file regex_internal.h.

Class Members
unsigned int constraint: 10
unsigned int duplicated: 1
union re_token_t opr
unsigned int opt_subexp: 1
re_token_type_t type
unsigned int word_char: 1
struct re_string_t

Definition at line 359 of file regex_internal.h.

Class Members
Idx bufs_len
Idx cur_idx
unsigned char icase
unsigned char is_utf8
Idx len
unsigned char map_notascii
int mb_cur_max
unsigned char * mbs
unsigned char mbs_allocated
unsigned char newline_anchor
unsigned char offsets_needed
Idx raw_len
const unsigned char * raw_mbs
Idx raw_mbs_idx
Idx raw_stop
Idx stop
unsigned int tip_context
RE_TRANSLATE_TYPE trans
Idx valid_len
Idx valid_raw_len
re_const_bitset_ptr_t word_char
unsigned char word_ops_used
struct bin_tree_t

Definition at line 483 of file regex_internal.h.

Collaboration diagram for bin_tree_t:
Class Members
struct bin_tree_t * first
struct bin_tree_t * left
struct bin_tree_t * next
Idx node_idx
struct bin_tree_t * parent
struct bin_tree_t * right
re_token_t token
struct bin_tree_storage_t

Definition at line 502 of file regex_internal.h.

Collaboration diagram for bin_tree_storage_t:
Class Members
bin_tree_t data
struct bin_tree_storage_t * next
struct re_dfastate_t

Definition at line 537 of file regex_internal.h.

Collaboration diagram for re_dfastate_t:
Class Members
unsigned int accept_mb: 1
unsigned int context: 4
re_node_set * entrance_nodes
unsigned int halt: 1
unsigned int has_backref: 1
unsigned int has_constraint: 1
re_hashval_t hash
re_node_set inveclosure
re_node_set nodes
re_node_set non_eps_nodes
struct re_dfastate_t ** trtable
struct re_dfastate_t ** word_trtable
struct re_state_table_entry

Definition at line 557 of file regex_internal.h.

Collaboration diagram for re_state_table_entry:
Class Members
Idx alloc
re_dfastate_t ** array
Idx num
struct state_array_t

Definition at line 566 of file regex_internal.h.

Collaboration diagram for state_array_t:
Class Members
Idx alloc
re_dfastate_t ** array
Idx next_idx
struct re_sub_match_last_t

Definition at line 575 of file regex_internal.h.

Collaboration diagram for re_sub_match_last_t:
Class Members
Idx node
state_array_t path
Idx str_idx
struct re_sub_match_top_t

Definition at line 586 of file regex_internal.h.

Collaboration diagram for re_sub_match_top_t:
Class Members
Idx alasts
re_sub_match_last_t ** lasts
Idx nlasts
Idx node
state_array_t * path
Idx str_idx
struct re_backref_cache_entry

Definition at line 596 of file regex_internal.h.

Class Members
unsigned short int eps_reachable_subexps_map
char more
Idx node
Idx str_idx
Idx subexp_from
Idx subexp_to
char unused
struct re_match_context_t

Definition at line 607 of file regex_internal.h.

Collaboration diagram for re_match_context_t:
Class Members
Idx abkref_ents
Idx asub_tops
struct re_backref_cache_entry * bkref_ents
const re_dfa_t * dfa
int eflags
re_string_t input
Idx last_node
Idx match_last
int max_mb_elem_len
Idx nbkref_ents
Idx nsub_tops
re_dfastate_t ** state_log
Idx state_log_top
re_sub_match_top_t ** sub_tops
struct re_sift_context_t

Definition at line 634 of file regex_internal.h.

Collaboration diagram for re_sift_context_t:
Class Members
Idx last_node
Idx last_str_idx
re_dfastate_t ** limited_states
re_node_set limits
re_dfastate_t ** sifted_states
struct re_fail_stack_ent_t

Definition at line 643 of file regex_internal.h.

Collaboration diagram for re_fail_stack_ent_t:
Class Members
re_node_set eps_via_nodes
Idx idx
Idx node
regmatch_t * regs
struct re_fail_stack_t

Definition at line 651 of file regex_internal.h.

Collaboration diagram for re_fail_stack_t:
Class Members
Idx alloc
Idx num
struct re_fail_stack_ent_t * stack
struct re_dfa_t

Definition at line 658 of file regex_internal.h.

Collaboration diagram for re_dfa_t:
Class Members
bitset_word_t completed_bkref_map
re_node_set * eclosures
re_node_set * edests
unsigned int has_mb_node: 1
unsigned int has_plural_match: 1
Idx init_node
re_dfastate_t * init_state
re_dfastate_t * init_state_begbuf
re_dfastate_t * init_state_nl
re_dfastate_t * init_state_word
re_node_set * inveclosures
unsigned int is_utf8: 1
unsigned int map_notascii: 1
int mb_cur_max
Idx nbackref
Idx * nexts
re_token_t * nodes
size_t nodes_alloc
size_t nodes_len
Idx * org_indices
re_bitset_ptr_t sb_char
re_hashval_t state_hash_mask
struct re_state_table_entry * state_table
bin_tree_t * str_tree
bin_tree_storage_t * str_tree_storage
int str_tree_storage_idx
Idx * subexp_map
reg_syntax_t syntax
bitset_word_t used_bkref_map
bitset_t word_char
unsigned int word_ops_used: 1
struct bracket_elem_t

Definition at line 723 of file regex_internal.h.

Class Members
union bracket_elem_t opr
bracket_elem_type type
union re_token_t.opr

Definition at line 330 of file regex_internal.h.

Class Members
unsigned char c
re_context_type ctx_type
Idx idx
re_bitset_ptr_t sbcset
union bracket_elem_t.opr

Definition at line 726 of file regex_internal.h.

Class Members
unsigned char ch
unsigned char * name
wchar_t wch

Define Documentation

#define __attribute (   arg)

Definition at line 126 of file regex_internal.h.

#define __attribute_warn_unused_result__   /* empty */

Definition at line 870 of file regex_internal.h.

#define __btowc   btowc

Definition at line 116 of file regex_internal.h.

#define __GNUC_PREREQ (   maj,
  min 
)    0

Definition at line 861 of file regex_internal.h.

#define __iswctype   iswctype

Definition at line 115 of file regex_internal.h.

#define __libc_lock_init (   NAME)    do { } while (0)

Definition at line 45 of file regex_internal.h.

#define __libc_lock_lock (   NAME)    do { } while (0)

Definition at line 46 of file regex_internal.h.

#define __libc_lock_unlock (   NAME)    do { } while (0)

Definition at line 47 of file regex_internal.h.

#define __libc_use_alloca (   n)    0

Definition at line 469 of file regex_internal.h.

#define __mbrtowc   mbrtowc

Definition at line 118 of file regex_internal.h.

#define __regfree   regfree

Definition at line 119 of file regex_internal.h.

#define __wcrtomb   wcrtomb

Definition at line 117 of file regex_internal.h.

#define __wctype   wctype

Definition at line 114 of file regex_internal.h.

#define alloca (   n)    malloc (n)

Definition at line 471 of file regex_internal.h.

#define ASCII_CHARS   0x80

Definition at line 101 of file regex_internal.h.

Definition at line 120 of file regex_internal.h.

#define BE (   expr,
  val 
)    (expr)

Definition at line 94 of file regex_internal.h.

#define BIN_TREE_STORAGE_SIZE   ((1024 - sizeof (void *)) / sizeof (bin_tree_t))

Definition at line 499 of file regex_internal.h.

#define BITSET_WORD_MAX   ULONG_MAX

Definition at line 158 of file regex_internal.h.

#define BITSET_WORDS   ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)

Definition at line 191 of file regex_internal.h.

#define COLL_ELEM_LEN_MAX   8

Definition at line 106 of file regex_internal.h.

#define CONTEXT_BEGBUF   (CONTEXT_NEWLINE << 1)

Definition at line 511 of file regex_internal.h.

#define CONTEXT_ENDBUF   (CONTEXT_BEGBUF << 1)

Definition at line 512 of file regex_internal.h.

#define CONTEXT_NEWLINE   (CONTEXT_WORD << 1)

Definition at line 510 of file regex_internal.h.

#define CONTEXT_WORD   1

Definition at line 509 of file regex_internal.h.

#define EPSILON_BIT   8

Definition at line 246 of file regex_internal.h.

#define gettext (   msgid)    (msgid)

Definition at line 73 of file regex_internal.h.

#define gettext_noop (   String)    String

Definition at line 79 of file regex_internal.h.

Definition at line 424 of file regex_internal.h.

#define IS_BEGBUF_CONTEXT (   c)    ((c) & CONTEXT_BEGBUF)

Definition at line 516 of file regex_internal.h.

#define IS_ENDBUF_CONTEXT (   c)    ((c) & CONTEXT_ENDBUF)

Definition at line 517 of file regex_internal.h.

#define IS_EPSILON_NODE (   type)    ((type) & EPSILON_BIT)

Definition at line 357 of file regex_internal.h.

#define IS_NEWLINE (   ch)    ((ch) == NEWLINE_CHAR)

Definition at line 521 of file regex_internal.h.

#define IS_NEWLINE_CONTEXT (   c)    ((c) & CONTEXT_NEWLINE)

Definition at line 515 of file regex_internal.h.

#define IS_ORDINARY_CONTEXT (   c)    ((c) == 0)

Definition at line 518 of file regex_internal.h.

#define IS_WIDE_NEWLINE (   ch)    ((ch) == WIDE_NEWLINE_CHAR)

Definition at line 523 of file regex_internal.h.

#define IS_WIDE_WORD_CHAR (   ch)    (iswalnum (ch) || (ch) == L'_')

Definition at line 522 of file regex_internal.h.

#define IS_WORD_CHAR (   ch)    (isalnum (ch) || (ch) == '_')

Definition at line 520 of file regex_internal.h.

#define IS_WORD_CONTEXT (   c)    ((c) & CONTEXT_WORD)

Definition at line 514 of file regex_internal.h.

#define isblank (   ch)    ((ch) == ' ' || (ch) == '\t')

Definition at line 52 of file regex_internal.h.

#define MAX (   a,
 
)    ((a) < (b) ? (b) : (a))

Definition at line 476 of file regex_internal.h.

#define NEWLINE_CHAR   '\n'

Definition at line 109 of file regex_internal.h.

#define NEXT_ENDBUF_CONSTRAINT   0x0080

Definition at line 204 of file regex_internal.h.

#define NEXT_NEWLINE_CONSTRAINT   0x0020

Definition at line 202 of file regex_internal.h.

#define NEXT_NOTWORD_CONSTRAINT   0x0008

Definition at line 200 of file regex_internal.h.

#define NEXT_WORD_CONSTRAINT   0x0004

Definition at line 199 of file regex_internal.h.

#define NOT_SATISFY_NEXT_CONSTRAINT (   constraint,
  context 
)
Value:
((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
  || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
  || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
  || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))

Definition at line 531 of file regex_internal.h.

#define NOT_SATISFY_PREV_CONSTRAINT (   constraint,
  context 
)
Value:
((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
  || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
  || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
  || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))

Definition at line 525 of file regex_internal.h.

#define NOT_WORD_DELIM_CONSTRAINT   0x0200

Definition at line 206 of file regex_internal.h.

#define PREV_BEGBUF_CONSTRAINT   0x0040

Definition at line 203 of file regex_internal.h.

#define PREV_NEWLINE_CONSTRAINT   0x0010

Definition at line 201 of file regex_internal.h.

#define PREV_NOTWORD_CONSTRAINT   0x0002

Definition at line 198 of file regex_internal.h.

#define PREV_WORD_CONSTRAINT   0x0001

Definition at line 197 of file regex_internal.h.

#define re_free (   p)    free (p)

Definition at line 481 of file regex_internal.h.

#define re_malloc (   t,
 
)    ((t *) malloc ((n) * sizeof (t)))

Definition at line 479 of file regex_internal.h.

#define re_node_set_empty (   p)    ((p)->nelem = 0)

Definition at line 710 of file regex_internal.h.

#define re_node_set_free (   set)    re_free ((set)->elems)

Definition at line 711 of file regex_internal.h.

#define re_node_set_init_empty (   set)    memset (set, '\0', sizeof (re_node_set))

Definition at line 707 of file regex_internal.h.

#define re_node_set_remove (   set,
  id 
)    (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))

Definition at line 708 of file regex_internal.h.

#define re_realloc (   p,
  t,
 
)    ((t *) realloc (p, (n) * sizeof (t)))

Definition at line 480 of file regex_internal.h.

#define re_string_byte_at (   pstr,
  idx 
)    ((pstr)->mbs[idx])

Definition at line 454 of file regex_internal.h.

#define re_string_cur_idx (   pstr)    ((pstr)->cur_idx)

Definition at line 451 of file regex_internal.h.

#define re_string_eoi (   pstr)    ((pstr)->stop <= (pstr)->cur_idx)

Definition at line 450 of file regex_internal.h.

#define re_string_fetch_byte (   pstr)    ((pstr)->mbs[(pstr)->cur_idx++])

Definition at line 443 of file regex_internal.h.

#define re_string_first_byte (   pstr,
  idx 
)    ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)

Definition at line 445 of file regex_internal.h.

#define re_string_get_buffer (   pstr)    ((pstr)->mbs)

Definition at line 452 of file regex_internal.h.

#define re_string_is_single_byte_char (   pstr,
  idx 
)
Value:
((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
                            || (pstr)->wcs[(idx) + 1] != WEOF))

Definition at line 447 of file regex_internal.h.

#define re_string_length (   pstr)    ((pstr)->len)

Definition at line 453 of file regex_internal.h.

#define re_string_peek_byte (   pstr,
  offset 
)    ((pstr)->mbs[(pstr)->cur_idx + offset])

Definition at line 441 of file regex_internal.h.

#define re_string_set_index (   pstr,
  idx 
)    ((pstr)->cur_idx = (idx))

Definition at line 456 of file regex_internal.h.

#define re_string_skip_bytes (   pstr,
  idx 
)    ((pstr)->cur_idx += (idx))

Definition at line 455 of file regex_internal.h.

#define REG_ERROR   ((Idx) -2)

Definition at line 135 of file regex_internal.h.

#define REG_MISSING   ((Idx) -1)

Definition at line 132 of file regex_internal.h.

#define REG_VALID_INDEX (   n)    (0 <= (n))

Definition at line 141 of file regex_internal.h.

#define REG_VALID_NONZERO_INDEX (   n)    (0 < (n))

Definition at line 148 of file regex_internal.h.

#define SBC_MAX   (UCHAR_MAX + 1)

Definition at line 104 of file regex_internal.h.

#define SIZE_MAX   ((size_t) -1)

Definition at line 84 of file regex_internal.h.

#define WIDE_NEWLINE_CHAR   L'\n'

Definition at line 110 of file regex_internal.h.

#define WORD_DELIM_CONSTRAINT   0x0100

Definition at line 205 of file regex_internal.h.


Typedef Documentation

typedef struct bin_tree_storage_t

Definition at line 507 of file regex_internal.h.

typedef struct bin_tree_t

Definition at line 497 of file regex_internal.h.

Definition at line 193 of file regex_internal.h.

typedef unsigned long int bitset_word_t

Definition at line 156 of file regex_internal.h.

typedef __re_idx_t Idx

Definition at line 129 of file regex_internal.h.

Definition at line 194 of file regex_internal.h.

Definition at line 195 of file regex_internal.h.

typedef struct re_dfa_t

Definition at line 418 of file regex_internal.h.

typedef struct re_dfastate_t

Definition at line 555 of file regex_internal.h.

Definition at line 152 of file regex_internal.h.

typedef struct re_string_t

Definition at line 414 of file regex_internal.h.


Enumeration Type Documentation

Enumerator:
SB_CHAR 
MB_CHAR 
EQUIV_CLASS 
COLL_SYM 
CHAR_CLASS 

Definition at line 714 of file regex_internal.h.

Enumerator:
NON_TYPE 
CHARACTER 
END_OF_RE 
SIMPLE_BRACKET 
OP_BACK_REF 
OP_PERIOD 
OP_OPEN_SUBEXP 
OP_CLOSE_SUBEXP 
OP_ALT 
OP_DUP_ASTERISK 
ANCHOR 
CONCAT 
SUBEXP 
OP_DUP_PLUS 
OP_DUP_QUESTION 
OP_OPEN_BRACKET 
OP_CLOSE_BRACKET 
OP_CHARSET_RANGE 
OP_OPEN_DUP_NUM 
OP_CLOSE_DUP_NUM 
OP_NON_MATCH_LIST 
OP_OPEN_COLL_ELEM 
OP_CLOSE_COLL_ELEM 
OP_OPEN_EQUIV_CLASS 
OP_CLOSE_EQUIV_CLASS 
OP_OPEN_CHAR_CLASS 
OP_CLOSE_CHAR_CLASS 
OP_WORD 
OP_NOTWORD 
OP_SPACE 
OP_NOTSPACE 
BACK_SLASH 

Definition at line 229 of file regex_internal.h.

{
  NON_TYPE = 0,

  /* Node type, These are used by token, node, tree.  */
  CHARACTER = 1,
  END_OF_RE = 2,
  SIMPLE_BRACKET = 3,
  OP_BACK_REF = 4,
  OP_PERIOD = 5,
#ifdef RE_ENABLE_I18N
  COMPLEX_BRACKET = 6,
  OP_UTF8_PERIOD = 7,
#endif /* RE_ENABLE_I18N */

  /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
     when the debugger shows values of this enum type.  */
#define EPSILON_BIT 8
  OP_OPEN_SUBEXP = EPSILON_BIT | 0,
  OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
  OP_ALT = EPSILON_BIT | 2,
  OP_DUP_ASTERISK = EPSILON_BIT | 3,
  ANCHOR = EPSILON_BIT | 4,

  /* Tree type, these are used only by tree. */
  CONCAT = 16,
  SUBEXP = 17,

  /* Token type, these are used only by token.  */
  OP_DUP_PLUS = 18,
  OP_DUP_QUESTION,
  OP_OPEN_BRACKET,
  OP_CLOSE_BRACKET,
  OP_CHARSET_RANGE,
  OP_OPEN_DUP_NUM,
  OP_CLOSE_DUP_NUM,
  OP_NON_MATCH_LIST,
  OP_OPEN_COLL_ELEM,
  OP_CLOSE_COLL_ELEM,
  OP_OPEN_EQUIV_CLASS,
  OP_CLOSE_EQUIV_CLASS,
  OP_OPEN_CHAR_CLASS,
  OP_CLOSE_CHAR_CLASS,
  OP_WORD,
  OP_NOTWORD,
  OP_SPACE,
  OP_NOTSPACE,
  BACK_SLASH

} re_token_type_t;

Function Documentation

static void bitset_clear ( bitset_t  set,
Idx  i 
) [inline, static]

Definition at line 744 of file regex_internal.h.

{
  set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
}

Here is the caller graph for this function:

static bool bitset_contain ( const bitset_t  set,
Idx  i 
) [inline, static]

Definition at line 750 of file regex_internal.h.

{
  return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
}

Here is the caller graph for this function:

static void bitset_copy ( bitset_t  dest,
const bitset_t  src 
) [inline, static]

Definition at line 771 of file regex_internal.h.

{
  memcpy (dest, src, sizeof (bitset_t));
}

Here is the caller graph for this function:

static void bitset_empty ( bitset_t  set) [inline, static]

Definition at line 756 of file regex_internal.h.

{
  memset (set, '\0', sizeof (bitset_t));
}

Here is the caller graph for this function:

static void bitset_mask ( bitset_t  dest,
const bitset_t  src 
) [inline, static]

Definition at line 797 of file regex_internal.h.

{
  int bitset_i;
  for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
    dest[bitset_i] &= src[bitset_i];
}

Here is the caller graph for this function:

static void bitset_merge ( bitset_t  dest,
const bitset_t  src 
) [inline, static]

Definition at line 789 of file regex_internal.h.

{
  int bitset_i;
  for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
    dest[bitset_i] |= src[bitset_i];
}

Here is the caller graph for this function:

static void bitset_not ( bitset_t  set) [inline, static]

Definition at line 777 of file regex_internal.h.

{
  int bitset_i;
  for (bitset_i = 0; bitset_i < SBC_MAX / BITSET_WORD_BITS; ++bitset_i)
    set[bitset_i] = ~set[bitset_i];
  if (SBC_MAX % BITSET_WORD_BITS != 0)
    set[BITSET_WORDS - 1] =
      ((((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1)
       & ~set[BITSET_WORDS - 1]);
}

Here is the caller graph for this function:

static void bitset_set ( bitset_t  set,
Idx  i 
) [inline, static]

Definition at line 738 of file regex_internal.h.

{
  set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
}

Here is the caller graph for this function:

static void bitset_set_all ( bitset_t  set) [inline, static]

Definition at line 762 of file regex_internal.h.

{
  memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS));
  if (SBC_MAX % BITSET_WORD_BITS != 0)
    set[BITSET_WORDS - 1] =
      ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1;
}

Here is the caller graph for this function:

static void build_upper_buffer ( re_string_t pstr) [static]
static unsigned int re_string_context_at ( const re_string_t input,
Idx  idx,
int  eflags 
) [static]
static reg_errcode_t re_string_realloc_buffers ( re_string_t pstr,
Idx  new_buf_len 
) [static]
static void re_string_translate_buffer ( re_string_t pstr) [static]