PPL Logo

libs/ck-libs/metis/GKlib/gkregex.c File Reference

Go to the source code of this file.

Data Structures

struct  re_node_set
struct  re_charset_t
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

Typedefs

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 re_string_t
typedef struct re_dfa_t re_dfa_t
typedef struct bin_tree_t bin_tree_t
typedef struct bin_tree_storage_t bin_tree_storage_t
typedef struct re_dfastate_t re_dfastate_t

Enumerations

enum  bool { false, true }
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, COMPLEX_BRACKET = 6, OP_UTF8_PERIOD = 7,
  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

void gkfooo ()
static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, int new_buf_len) internal_function
static void build_wcs_buffer (re_string_t *pstr) internal_function
static int build_wcs_upper_buffer (re_string_t *pstr) 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, int idx, int eflags) internal_function __attribute((pure))
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)
static int internal_function __attribute ((pure))
static void re_string_construct_common (const char *str, int len, re_string_t *pstr, RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa) internal_function
static re_dfastate_tcreate_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, unsigned int hash) internal_function
static re_dfastate_tcreate_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context, unsigned int hash) internal_function
static reg_errcode_t
internal_function 
re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len, RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa)
static reg_errcode_t
internal_function 
re_string_construct (re_string_t *pstr, const char *str, int len, RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa)
static int internal_function re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
static reg_errcode_t
internal_function 
re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
static void internal_function re_string_destruct (re_string_t *pstr)
static reg_errcode_t
internal_function 
re_node_set_alloc (re_node_set *set, int size)
static reg_errcode_t
internal_function 
re_node_set_init_1 (re_node_set *set, int elem)
static reg_errcode_t
internal_function 
re_node_set_init_2 (re_node_set *set, int elem1, int elem2)
static reg_errcode_t
internal_function 
re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
static reg_errcode_t
internal_function 
re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, const re_node_set *src2)
static reg_errcode_t
internal_function 
re_node_set_init_union (re_node_set *dest, const re_node_set *src1, const re_node_set *src2)
static reg_errcode_t
internal_function 
re_node_set_merge (re_node_set *dest, const re_node_set *src)
static int internal_function re_node_set_insert (re_node_set *set, int elem)
static int internal_function re_node_set_insert_last (re_node_set *set, int elem)
static void internal_function re_node_set_remove_at (re_node_set *set, int idx)
static int internal_function re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
static unsigned int
internal_function 
calc_state_hash (const re_node_set *nodes, unsigned int context)
static re_dfastate_t
*internal_function 
re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, const re_node_set *nodes)
static re_dfastate_t
*internal_function 
re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context)
static reg_errcode_t register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, unsigned int hash)
static void free_state (re_dfastate_t *state)
static reg_errcode_t re_compile_internal (regex_t *preg, const char *pattern, size_t length, reg_syntax_t syntax)
static void re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, char *fastmap)
static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len)
static void free_charset (re_charset_t *cset)
static void free_workarea_compile (regex_t *preg)
static reg_errcode_t create_initial_state (re_dfa_t *dfa)
static void optimize_utf8 (re_dfa_t *dfa)
static reg_errcode_t analyze (regex_t *preg)
static reg_errcode_t preorder (bin_tree_t *root, reg_errcode_t(fn(void *, bin_tree_t *)), void *extra)
static reg_errcode_t postorder (bin_tree_t *root, reg_errcode_t(fn(void *, bin_tree_t *)), void *extra)
static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node)
static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node)
static bin_tree_tlower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node)
static reg_errcode_t calc_first (void *extra, bin_tree_t *node)
static reg_errcode_t calc_next (void *extra, bin_tree_t *node)
static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node)
static int duplicate_node (re_dfa_t *dfa, int org_idx, unsigned int constraint)
static int search_duplicated_node (const re_dfa_t *dfa, int org_node, unsigned int constraint)
static reg_errcode_t calc_eclosure (re_dfa_t *dfa)
static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root)
static reg_errcode_t calc_inveclosure (re_dfa_t *dfa)
static int fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
static int peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) internal_function
static bin_tree_tparse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, reg_errcode_t *err)
static bin_tree_tparse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, int nest, reg_errcode_t *err)
static bin_tree_tparse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, int nest, reg_errcode_t *err)
static bin_tree_tparse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, int nest, reg_errcode_t *err)
static bin_tree_tparse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, reg_syntax_t syntax, int nest, reg_errcode_t *err)
static bin_tree_tparse_dup_op (bin_tree_t *dup_elem, re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err)
static bin_tree_tparse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err)
static reg_errcode_t parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp, re_token_t *token, int token_len, re_dfa_t *dfa, reg_syntax_t syntax, int accept_hyphen)
static reg_errcode_t parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp, re_token_t *token)
static reg_errcode_t build_equiv_class (bitset_t sbcset, re_charset_t *mbcset, int *equiv_class_alloc, const unsigned char *name)
static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, re_charset_t *mbcset, int *char_class_alloc, const unsigned char *class_name, reg_syntax_t syntax)
static reg_errcode_t build_equiv_class (bitset_t sbcset, const unsigned char *name)
static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, const unsigned char *class_name, reg_syntax_t syntax)
static bin_tree_tbuild_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, const unsigned char *class_name, const unsigned char *extra, int non_match, reg_errcode_t *err)
static bin_tree_tcreate_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, re_token_type_t type)
static bin_tree_tcreate_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, const re_token_t *token)
static bin_tree_tduplicate_tree (const bin_tree_t *src, re_dfa_t *dfa)
static void free_token (re_token_t *node)
static reg_errcode_t free_tree (void *extra, bin_tree_t *node)
static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node)
const char * re_compile_pattern (char *pattern, size_t length, struct re_pattern_buffer *bufp) const
 weak_alias (__re_compile_pattern, re_compile_pattern)
 weak_alias (__re_set_syntax, re_set_syntax)
 weak_alias (__re_compile_fastmap, re_compile_fastmap)
int regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
 weak_alias (__regcomp, regcomp)
 weak_alias (__regerror, regerror)
static void free_dfa_content (re_dfa_t *dfa)
void regfree (regex_t *preg)
 weak_alias (__regfree, regfree)
 libc_freeres_fn (free_mem)
static void internal_function init_word_char (re_dfa_t *dfa)
static reg_errcode_t
internal_function 
duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node, int root_node, unsigned int init_constraint)
static void internal_function fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax)
static int internal_function peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
static reg_errcode_t
internal_function 
build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc, bracket_elem_t *start_elem, bracket_elem_t *end_elem) build_range_exp(bitset_t sbcset
static void match_ctx_clean (re_match_context_t *mctx) internal_function
static void match_ctx_free (re_match_context_t *cache) internal_function
static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, int node, int str_idx, int from, int to) internal_function
static int search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx) internal_function
static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, int node, int str_idx) internal_function
static re_sub_match_last_tmatch_ctx_add_sublast (re_sub_match_top_t *subtop, int node, int str_idx) internal_function
static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, re_dfastate_t **limited_sts, int last_node, int last_str_idx) internal_function
static reg_errcode_t re_search_internal (const regex_t *preg, const char *string, int length, int start, int range, int stop, size_t nmatch, regmatch_t pmatch[], int eflags) internal_function
static int re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop, int ret_len) internal_function
static int re_search_stub (struct re_pattern_buffer *bufp, const char *string, int length, int start, int range, int stop, struct re_registers *regs, int ret_len) internal_function
static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, int nregs, int regs_allocated) internal_function
static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) internal_function
static int check_matching (re_match_context_t *mctx, int fl_longest_match, int *p_match_first) internal_function
static int check_halt_state_context (const re_match_context_t *mctx, const re_dfastate_t *state, int idx) internal_function
static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, regmatch_t *prev_idx_match, int cur_node, int cur_idx, int nmatch) internal_function
static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs, int str_idx, int dest_node, int nregs, regmatch_t *regs, re_node_set *eps_via_nodes) internal_function
static reg_errcode_t set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, regmatch_t *pmatch, int fl_backtrack) internal_function
static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs) internal_function
static int sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, int node_idx, int str_idx, int max_str_idx) internal_function
static reg_errcode_t sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx) internal_function
static reg_errcode_t build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx, int str_idx, re_node_set *cur_dest) internal_function
static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx, re_sift_context_t *sctx, int str_idx, re_node_set *dest_nodes) internal_function
static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes, const re_node_set *candidates) internal_function
static int check_dst_limits (const re_match_context_t *mctx, re_node_set *limits, int dst_node, int dst_idx, int src_node, int src_idx) internal_function
static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries, int subexp_idx, int from_node, int bkref_idx) internal_function
static int check_dst_limits_calc_pos (const re_match_context_t *mctx, int limit, int subexp_idx, int node, int str_idx, int bkref_idx) internal_function
static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes, const re_node_set *candidates, re_node_set *limits, struct re_backref_cache_entry *bkref_ents, int str_idx) internal_function
static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx, int str_idx, const re_node_set *candidates) internal_function
static reg_errcode_t merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst, re_dfastate_t **src, int num) internal_function
static re_dfastate_tfind_recover_state (reg_errcode_t *err, re_match_context_t *mctx) internal_function
static re_dfastate_ttransit_state (reg_errcode_t *err, re_match_context_t *mctx, re_dfastate_t *state) internal_function
static re_dfastate_tmerge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, re_dfastate_t *next_state) internal_function
static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes, int str_idx) internal_function
static re_dfastate_ttransit_state_sb (reg_errcode_t *err, re_match_context_t *mctx, re_dfastate_t *pstate) internal_function
static reg_errcode_t transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate) internal_function
static reg_errcode_t transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes) internal_function
static reg_errcode_t get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx) internal_function
static reg_errcode_t get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top, re_sub_match_last_t *sub_last, int bkref_node, int bkref_str) internal_function
static int find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, int subexp_idx, int type) internal_function
static reg_errcode_t check_arrival (re_match_context_t *mctx, state_array_t *path, int top_node, int top_str, int last_node, int last_str, int type) internal_function
static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx, re_node_set *cur_nodes, re_node_set *next_nodes) internal_function
static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes, int ex_subexp, int type) internal_function
static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes, int target, int ex_subexp, int type) internal_function
static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes, int cur_str, int subexp_num, int type) internal_function
static int build_trtable (const re_dfa_t *dfa, re_dfastate_t *state) internal_function
static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, const re_string_t *input, int idx) internal_function
static unsigned int find_collation_sequence_value (const unsigned char *mbs, size_t name_len) internal_function
static int group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state, re_node_set *states_node, bitset_t *states_ch) internal_function
static int check_node_accept (const re_match_context_t *mctx, const re_token_t *node, int idx) internal_function
static reg_errcode_t extend_buffers (re_match_context_t *mctx) internal_function
int regexec (regex_t *__restrict preg, const char *__restrict string, size_t nmatch, pmatch, int eflags) const
 versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4)
 __typeof__ (__regexec)
 compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0)
int re_match (struct re_pattern_buffer *bufp, const char *string, int length, int start, struct re_registers *regs)
 weak_alias (__re_match, re_match)
 weak_alias (__re_search, re_search)
 weak_alias (__re_match_2, re_match_2)
 weak_alias (__re_search_2, re_search_2)
void re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)
 weak_alias (__re_set_registers, re_set_registers)
static reg_errcode_t re_search_internal (regex_t *preg, const char *string, int length, int start, int range, int stop, size_t nmatch, pmatch, int eflags) const
static re_dfastate_t__attribute ((always_inline))
static int internal_function check_halt_node_context (const re_dfa_t *dfa, int node, unsigned int context)
static int internal_function proceed_next_node (const re_match_context_t *mctx, int nregs, regmatch_t *regs, int *pidx, int node, re_node_set *eps_via_nodes, struct re_fail_stack_t *fs)
static int internal_function pop_fail_stack (struct re_fail_stack_t *fs, int *pidx, int nregs, regmatch_t *regs, re_node_set *eps_via_nodes)
static reg_errcode_t
internal_function 
clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx)
static reg_errcode_t
internal_function 
sub_epsilon_src_nodes (const re_dfa_t *dfa, int node, re_node_set *dest_nodes, const re_node_set *candidates)
static reg_errcode_t
internal_function 
match_ctx_init (re_match_context_t *mctx, int eflags, int n)

Variables

const char __re_error_msgid[] attribute_hidden
static reg_errcode_t
internal_function
bracket_elem_t
start_elem


Typedef Documentation

typedef unsigned long int bitset_word_t

Definition at line 206 of file gkregex.c.

typedef bitset_word_t bitset_t[BITSET_WORDS]

Definition at line 213 of file gkregex.c.

Definition at line 214 of file gkregex.c.

Definition at line 215 of file gkregex.c.

typedef struct re_string_t re_string_t

Definition at line 444 of file gkregex.c.

typedef struct re_dfa_t re_dfa_t

Definition at line 448 of file gkregex.c.

typedef struct bin_tree_t bin_tree_t

Definition at line 529 of file gkregex.c.

Definition at line 539 of file gkregex.c.

typedef struct re_dfastate_t re_dfastate_t

Definition at line 587 of file gkregex.c.


Enumeration Type Documentation

enum bool

Enumerator:
false 
true 

Definition at line 113 of file gkregex.c.

Enumerator:
INSIDE_WORD 
WORD_FIRST 
WORD_LAST 
INSIDE_NOTWORD 
LINE_FIRST 
LINE_LAST 
BUF_FIRST 
BUF_LAST 
WORD_DELIM 
NOT_WORD_DELIM 

Definition at line 238 of file gkregex.c.

Enumerator:
NON_TYPE 
CHARACTER 
END_OF_RE 
SIMPLE_BRACKET 
OP_BACK_REF 
OP_PERIOD 
COMPLEX_BRACKET 
OP_UTF8_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 259 of file gkregex.c.

Enumerator:
SB_CHAR 
MB_CHAR 
EQUIV_CLASS 
COLL_SYM 
CHAR_CLASS 

Definition at line 744 of file gkregex.c.


Function Documentation

void gkfooo (  ) 

Definition at line 22 of file gkregex.c.

static reg_errcode_t internal_function re_string_realloc_buffers ( re_string_t pstr,
int  new_buf_len 
) [static]

static void internal_function build_wcs_buffer ( re_string_t pstr  )  [static]

static reg_errcode_t internal_function build_wcs_upper_buffer ( re_string_t pstr  )  [static]

static void internal_function build_upper_buffer ( re_string_t pstr  )  [static]

static void internal_function re_string_translate_buffer ( re_string_t pstr  )  [static]

static unsigned int internal_function re_string_context_at ( const re_string_t input,
int  idx,
int  eflags 
) [static]

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

Definition at line 767 of file gkregex.c.

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

Definition at line 775 of file gkregex.c.

Referenced by build_trtable(), and group_nodes_into_DFAstates().

Here is the caller graph for this function:

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

Definition at line 783 of file gkregex.c.

static int internal_function __attribute ( (pure)   )  [inline, static]

Definition at line 793 of file gkregex.c.

static void internal_function re_string_construct_common ( const char *  str,
int  len,
re_string_t pstr,
RE_TRANSLATE_TYPE  trans,
int  icase,
const re_dfa_t dfa 
) [static]

static re_dfastate_t *internal_function create_ci_newstate ( const re_dfa_t dfa,
const re_node_set nodes,
unsigned int  hash 
) [static]

static re_dfastate_t *internal_function create_cd_newstate ( const re_dfa_t dfa,
const re_node_set nodes,
unsigned int  context,
unsigned int  hash 
) [static]

static reg_errcode_t internal_function re_string_allocate ( re_string_t pstr,
const char *  str,
int  len,
int  init_len,
RE_TRANSLATE_TYPE  trans,
int  icase,
const re_dfa_t dfa 
) [static]

static reg_errcode_t internal_function re_string_construct ( re_string_t pstr,
const char *  str,
int  len,
RE_TRANSLATE_TYPE  trans,
int  icase,
const re_dfa_t dfa 
) [static]

static int internal_function re_string_skip_chars ( re_string_t pstr,
int  new_raw_idx,
wint_t *  last_wc 
) [static]

Definition at line 1330 of file gkregex.c.

References re_string_t::cur_state, re_string_t::len, re_string_t::raw_mbs, re_string_t::raw_mbs_idx, and re_string_t::valid_raw_len.

Referenced by re_string_reconstruct().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_string_reconstruct ( re_string_t pstr,
int  idx,
int  eflags 
) [static]

static void internal_function re_string_destruct ( re_string_t pstr  )  [static]

Definition at line 1746 of file gkregex.c.

References re_string_t::mbs, re_string_t::mbs_allocated, re_string_t::offsets, and re_string_t::wcs.

Referenced by re_compile_internal(), and re_search_internal().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_alloc ( re_node_set set,
int  size 
) [static]

Definition at line 1805 of file gkregex.c.

References REG_ESPACE, and REG_NOERROR.

Referenced by add_epsilon_src_nodes(), build_trtable(), calc_eclosure_iter(), check_arrival_expand_ecl(), register_state(), and transit_state_sb().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_init_1 ( re_node_set set,
int  elem 
) [static]

Definition at line 1817 of file gkregex.c.

References REG_ESPACE, and REG_NOERROR.

Referenced by check_arrival(), expand_bkref_cache(), group_nodes_into_DFAstates(), link_nfa_nodes(), re_node_set_insert(), and sift_states_backward().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_init_2 ( re_node_set set,
int  elem1,
int  elem2 
) [static]

Definition at line 1833 of file gkregex.c.

References REG_ESPACE, and REG_NOERROR.

Referenced by link_nfa_nodes().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_init_copy ( re_node_set dest,
const re_node_set src 
) [static]

static reg_errcode_t internal_function re_node_set_add_intersect ( re_node_set dest,
const re_node_set src1,
const re_node_set src2 
) [static]

Definition at line 1888 of file gkregex.c.

References re_node_set::alloc, re_node_set::elems, re_node_set::nelem, REG_ESPACE, and REG_NOERROR.

Referenced by add_epsilon_src_nodes(), and sub_epsilon_src_nodes().

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_init_union ( re_node_set dest,
const re_node_set src1,
const re_node_set src2 
) [static]

Definition at line 1979 of file gkregex.c.

References re_node_set::alloc, re_node_set::elems, re_node_set::nelem, re_node_set_init_copy(), REG_ESPACE, and REG_NOERROR.

Referenced by merge_state_array(), merge_state_with_log(), transit_state_bkref(), and transit_state_mb().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function re_node_set_merge ( re_node_set dest,
const re_node_set src 
) [static]

static int internal_function re_node_set_insert ( re_node_set set,
int  elem 
) [static]

Definition at line 2115 of file gkregex.c.

References re_node_set_init_1(), and REG_NOERROR.

Referenced by build_sifted_states(), calc_eclosure_iter(), check_arrival_add_next_nodes(), check_arrival_expand_ecl_sub(), duplicate_node_closure(), expand_bkref_cache(), group_nodes_into_DFAstates(), proceed_next_node(), and sift_states_bkref().

Here is the call graph for this function:

Here is the caller graph for this function:

static int internal_function re_node_set_insert_last ( re_node_set set,
int  elem 
) [static]

Definition at line 2172 of file gkregex.c.

Referenced by calc_inveclosure(), and register_state().

Here is the caller graph for this function:

static void internal_function re_node_set_remove_at ( re_node_set set,
int  idx 
) [static]

Definition at line 2232 of file gkregex.c.

Referenced by create_cd_newstate(), and sub_epsilon_src_nodes().

Here is the caller graph for this function:

static int internal_function re_dfa_add_node ( re_dfa_t dfa,
re_token_t  token 
) [static]

static unsigned int internal_function calc_state_hash ( const re_node_set nodes,
unsigned int  context 
) [inline, static]

Definition at line 2292 of file gkregex.c.

References re_node_set::elems, and re_node_set::nelem.

Referenced by re_acquire_state(), and re_acquire_state_context().

Here is the caller graph for this function:

static re_dfastate_t* internal_function re_acquire_state ( reg_errcode_t err,
const re_dfa_t dfa,
const re_node_set nodes 
) [static]

static re_dfastate_t* internal_function re_acquire_state_context ( reg_errcode_t err,
const re_dfa_t dfa,
const re_node_set nodes,
unsigned int  context 
) [static]

static reg_errcode_t register_state ( const re_dfa_t dfa,
re_dfastate_t newstate,
unsigned int  hash 
) [static]

static void free_state ( re_dfastate_t state  )  [static]

static reg_errcode_t re_compile_internal ( regex_t preg,
const char *  pattern,
size_t  length,
reg_syntax_t  syntax 
) [static]

static void re_compile_fastmap_iter ( regex_t bufp,
const re_dfastate_t init_state,
char *  fastmap 
) [static]

static reg_errcode_t init_dfa ( re_dfa_t dfa,
size_t  pat_len 
) [static]

Definition at line 3385 of file gkregex.c.

References calloc(), re_dfa_t::is_utf8, re_dfa_t::map_notascii, re_dfa_t::mb_cur_max, re_dfa_t::nodes, re_dfa_t::nodes_alloc, REG_ESPACE, REG_NOERROR, re_dfa_t::sb_char, re_dfa_t::state_hash_mask, re_dfa_t::state_table, and re_dfa_t::str_tree_storage_idx.

Referenced by re_compile_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

static void free_charset ( re_charset_t cset  )  [static]

static void free_workarea_compile ( regex_t preg  )  [static]

static reg_errcode_t create_initial_state ( re_dfa_t dfa  )  [static]

static void optimize_utf8 ( re_dfa_t dfa  )  [static]

static reg_errcode_t analyze ( regex_t preg  )  [static]

static reg_errcode_t preorder ( bin_tree_t root,
reg_errcode_t(fn(void *, bin_tree_t *))  ,
void *  extra 
) [static]

Definition at line 3760 of file gkregex.c.

References bin_tree_t::left, bin_tree_t::parent, REG_NOERROR, and bin_tree_t::right.

Referenced by analyze().

Here is the caller graph for this function:

static reg_errcode_t postorder ( bin_tree_t root,
reg_errcode_t(fn(void *, bin_tree_t *))  ,
void *  extra 
) [static]

Definition at line 3728 of file gkregex.c.

References bin_tree_t::left, bin_tree_t::parent, REG_NOERROR, and bin_tree_t::right.

Referenced by analyze(), and parse_dup_op().

Here is the caller graph for this function:

static reg_errcode_t optimize_subexps ( void *  extra,
bin_tree_t node 
) [static]

Definition at line 3793 of file gkregex.c.

References re_token_t::idx, bin_tree_t::left, OP_BACK_REF, re_token_t::opr, bin_tree_t::parent, REG_NOERROR, SUBEXP, re_dfa_t::subexp_map, bin_tree_t::token, re_token_t::type, and re_dfa_t::used_bkref_map.

Referenced by analyze().

Here is the caller graph for this function:

static reg_errcode_t lower_subexps ( void *  extra,
bin_tree_t node 
) [static]

Definition at line 3824 of file gkregex.c.

References bin_tree_t::left, lower_subexp(), bin_tree_t::parent, REG_NOERROR, bin_tree_t::right, SUBEXP, bin_tree_t::token, and re_token_t::type.

Referenced by analyze().

Here is the call graph for this function:

Here is the caller graph for this function:

static bin_tree_t * lower_subexp ( reg_errcode_t err,
regex_t preg,
bin_tree_t node 
) [static]

Definition at line 3846 of file gkregex.c.

References re_pattern_buffer::buffer, CONCAT, create_tree(), re_token_t::idx, bin_tree_t::left, re_pattern_buffer::no_sub, op, OP_CLOSE_SUBEXP, OP_OPEN_SUBEXP, re_token_t::opr, re_token_t::opt_subexp, REG_ESPACE, bin_tree_t::token, and re_dfa_t::used_bkref_map.

Referenced by lower_subexps().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t calc_first ( void *  extra,
bin_tree_t node 
) [static]

Definition at line 3883 of file gkregex.c.

References CONCAT, bin_tree_t::first, bin_tree_t::left, bin_tree_t::node_idx, re_dfa_add_node(), REG_ESPACE, REG_NOERROR, bin_tree_t::token, and re_token_t::type.

Referenced by analyze().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t calc_next ( void *  extra,
bin_tree_t node 
) [static]

Definition at line 3903 of file gkregex.c.

References CONCAT, bin_tree_t::first, bin_tree_t::left, bin_tree_t::next, OP_DUP_ASTERISK, REG_NOERROR, bin_tree_t::right, bin_tree_t::token, and re_token_t::type.

Referenced by analyze().

Here is the caller graph for this function:

static reg_errcode_t link_nfa_nodes ( void *  extra,
bin_tree_t node 
) [static]

static int duplicate_node ( re_dfa_t dfa,
int  org_idx,
unsigned int  constraint 
) [static]

Definition at line 4116 of file gkregex.c.

References ANCHOR, re_token_t::constraint, re_token_t::ctx_type, re_token_t::duplicated, re_dfa_t::nodes, re_token_t::opr, re_dfa_t::org_indices, re_dfa_add_node(), and re_token_t::type.

Referenced by duplicate_node_closure().

Here is the call graph for this function:

Here is the caller graph for this function:

static int search_duplicated_node ( const re_dfa_t dfa,
int  org_node,
unsigned int  constraint 
) [static]

Definition at line 4098 of file gkregex.c.

References re_token_t::constraint, re_token_t::duplicated, re_dfa_t::nodes, re_dfa_t::nodes_len, and re_dfa_t::org_indices.

Referenced by duplicate_node_closure().

Here is the caller graph for this function:

static reg_errcode_t calc_eclosure ( re_dfa_t dfa  )  [static]

Definition at line 4156 of file gkregex.c.

References assert, calc_eclosure_iter(), re_dfa_t::eclosures, incomplete, re_node_set::nelem, re_dfa_t::nodes_len, and REG_NOERROR.

Referenced by analyze().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t calc_eclosure_iter ( re_node_set new_set,
re_dfa_t dfa,
int  node,
int  root 
) [static]

static reg_errcode_t calc_inveclosure ( re_dfa_t dfa  )  [static]

Definition at line 4133 of file gkregex.c.

References re_dfa_t::eclosures, re_node_set::elems, re_dfa_t::inveclosures, re_node_set::nelem, re_dfa_t::nodes_len, re_node_set_insert_last(), REG_ESPACE, REG_NOERROR, and src.

Referenced by analyze().

Here is the call graph for this function:

Here is the caller graph for this function:

static int fetch_number ( re_string_t input,
re_token_t token,
reg_syntax_t  syntax 
) [static]

Referenced by parse_dup_op().

Here is the caller graph for this function:

static int internal_function peek_token ( re_token_t token,
re_string_t input,
reg_syntax_t  syntax 
) [static]

static bin_tree_t * parse ( re_string_t regexp,
regex_t preg,
reg_syntax_t  syntax,
reg_errcode_t err 
) [static]

Definition at line 4624 of file gkregex.c.

References re_pattern_buffer::buffer, CONCAT, create_tree(), END_OF_RE, fetch_token(), parse_reg_exp(), REG_ESPACE, REG_NOERROR, and re_dfa_t::syntax.

Referenced by re_compile_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

static bin_tree_t * parse_reg_exp ( re_string_t regexp,
regex_t preg,
re_token_t token,
reg_syntax_t  syntax,
int  nest,
reg_errcode_t err 
) [static]

Definition at line 4658 of file gkregex.c.

References re_pattern_buffer::buffer, create_tree(), END_OF_RE, fetch_token(), OP_ALT, OP_CLOSE_SUBEXP, parse_branch(), REG_ESPACE, REG_NOERROR, and re_token_t::type.

Referenced by parse(), and parse_sub_exp().

Here is the call graph for this function:

Here is the caller graph for this function:

static bin_tree_t * parse_branch ( re_string_t regexp,
regex_t preg,
re_token_t token,
reg_syntax_t  syntax,
int  nest,
reg_errcode_t err 
) [static]

Definition at line 4699 of file gkregex.c.

References re_pattern_buffer::buffer, CONCAT, create_tree(), END_OF_RE, OP_ALT, OP_CLOSE_SUBEXP, parse_expression(), REG_ESPACE, REG_NOERROR, and re_token_t::type.

Referenced by parse_reg_exp().

Here is the call graph for this function:

Here is the caller graph for this function:

static bin_tree_t * parse_expression ( re_string_t regexp,
regex_t preg,
re_token_t token,
reg_syntax_t  syntax,
int  nest,
reg_errcode_t err 
) [static]

static bin_tree_t * parse_sub_exp ( re_string_t regexp,
regex_t preg,
re_token_t token,
reg_syntax_t  syntax,
int  nest,
reg_errcode_t err 
) [static]

Definition at line 4955 of file gkregex.c.

References re_pattern_buffer::buffer, re_dfa_t::completed_bkref_map, create_tree(), fetch_token(), OP_CLOSE_SUBEXP, parse_reg_exp(), re_pattern_buffer::re_nsub, REG_EPAREN, REG_ESPACE, REG_NOERROR, SUBEXP, and re_token_t::type.

Referenced by parse_expression().

Here is the call graph for this function:

Here is the caller graph for this function:

static bin_tree_t * parse_dup_op ( bin_tree_t dup_elem,
re_string_t regexp,
re_dfa_t dfa,
re_token_t token,
reg_syntax_t  syntax,
reg_errcode_t err 
) [static]

static bin_tree_t* parse_bracket_exp ( re_string_t regexp,
re_dfa_t dfa,
re_token_t token,
reg_syntax_t  syntax,
reg_errcode_t err 
) [static]

Referenced by parse_expression().

Here is the caller graph for this function:

static reg_errcode_t parse_bracket_element ( bracket_elem_t elem,
re_string_t regexp,
re_token_t token,
int  token_len,
re_dfa_t dfa,
reg_syntax_t  syntax,
int  accept_hyphen 
) [static]

static reg_errcode_t parse_bracket_symbol ( bracket_elem_t elem,
re_string_t regexp,
re_token_t token 
) [static]

static reg_errcode_t build_equiv_class ( bitset_t  sbcset,
re_charset_t mbcset,
int equiv_class_alloc,
const unsigned char *  name 
) [static]

static reg_errcode_t build_charclass ( RE_TRANSLATE_TYPE  trans,
bitset_t  sbcset,
re_charset_t mbcset,
int char_class_alloc,
const unsigned char *  class_name,
reg_syntax_t  syntax 
) [static]

static reg_errcode_t build_equiv_class ( bitset_t  sbcset,
const unsigned char *  name 
) [static]

static reg_errcode_t build_charclass ( RE_TRANSLATE_TYPE  trans,
bitset_t  sbcset,
const unsigned char *  class_name,
reg_syntax_t  syntax 
) [static]

static bin_tree_t* build_charclass_op ( re_dfa_t dfa,
RE_TRANSLATE_TYPE  trans,
const unsigned char *  class_name,
const unsigned char *  extra,
int  non_match,
reg_errcode_t err 
) [static]

Referenced by parse_expression().

Here is the caller graph for this function:

static bin_tree_t* create_tree ( re_dfa_t dfa,
bin_tree_t left,
bin_tree_t right,
re_token_type_t  type 
) [static]

Referenced by lower_subexp(), parse(), parse_branch(), parse_dup_op(), parse_expression(), parse_reg_exp(), and parse_sub_exp().

Here is the caller graph for this function:

static bin_tree_t* create_token_tree ( re_dfa_t dfa,
bin_tree_t left,
bin_tree_t right,
const re_token_t token 
) [static]

Referenced by parse_expression().

Here is the caller graph for this function:

static bin_tree_t* duplicate_tree ( const bin_tree_t src,
re_dfa_t dfa 
) [static]

Referenced by parse_dup_op().

Here is the caller graph for this function:

static void free_token ( re_token_t node  )  [static]

Referenced by free_dfa_content().

Here is the caller graph for this function:

static reg_errcode_t free_tree ( void *  extra,
bin_tree_t node 
) [static]

static reg_errcode_t mark_opt_subexp ( void *  extra,
bin_tree_t node 
) [static]

Referenced by parse_dup_op().

Here is the caller graph for this function:

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

Definition at line 2789 of file gkregex.c.

References re_pattern_buffer::newline_anchor, re_pattern_buffer::no_sub, re_compile_internal(), and re_syntax_options.

Here is the call graph for this function:

weak_alias ( __re_compile_pattern  ,
re_compile_pattern   
)

Definition at line 2811 of file gkregex.c.

References re_syntax_options.

weak_alias ( __re_set_syntax  ,
re_set_syntax   
)

Definition at line 2839 of file gkregex.c.

References re_dfa_t::init_state, re_dfa_t::init_state_begbuf, re_dfa_t::init_state_nl, re_dfa_t::init_state_word, and re_compile_fastmap_iter().

Here is the call graph for this function:

weak_alias ( __re_compile_fastmap  ,
re_compile_fastmap   
)

Definition at line 2861 of file gkregex.c.

int regcomp ( regex_t *__restrict  preg,
const char *__restrict  pattern,
int  cflags 
)

Definition at line 3022 of file gkregex.c.

References re_compile_fastmap(), re_compile_internal(), REG_EPAREN, REG_ERPAREN, REG_ESPACE, and REG_NOERROR.

Referenced by gk_strstr_replace(), and match().

Here is the call graph for this function:

Here is the caller graph for this function:

weak_alias ( __regcomp  ,
regcomp   
)

Definition at line 3077 of file gkregex.c.

References abort(), and msg.

Here is the call graph for this function:

weak_alias ( __regerror  ,
regerror   
)

Definition at line 3125 of file gkregex.c.

static void free_dfa_content ( re_dfa_t dfa  )  [static]

void regfree ( regex_t preg  ) 

Definition at line 3193 of file gkregex.c.

References free_dfa_content().

Referenced by gk_strstr_replace(), and match().

Here is the call graph for this function:

Here is the caller graph for this function:

weak_alias ( __regfree  ,
regfree   
)

Definition at line 3209 of file gkregex.c.

libc_freeres_fn ( free_mem   ) 

Definition at line 3273 of file gkregex.c.

static void internal_function init_word_char ( re_dfa_t dfa  )  [static]

Definition at line 3483 of file gkregex.c.

References re_dfa_t::word_char, and re_dfa_t::word_ops_used.

Referenced by parse_expression().

Here is the caller graph for this function:

static reg_errcode_t internal_function duplicate_node_closure ( re_dfa_t dfa,
int  top_org_node,
int  top_clone_node,
int  root_node,
unsigned int  init_constraint 
) [static]

Definition at line 3987 of file gkregex.c.

References ANCHOR, re_token_t::ctx_type, duplicate_node(), re_dfa_t::edests, re_node_set::elems, re_node_set::nelem, re_dfa_t::nexts, re_dfa_t::nodes, OP_BACK_REF, re_token_t::opr, re_node_set_insert(), REG_ESPACE, REG_NOERROR, search_duplicated_node(), and re_token_t::type.

Referenced by calc_eclosure_iter().

Here is the call graph for this function:

Here is the caller graph for this function:

static void internal_function fetch_token ( re_token_t result,
re_string_t input,
reg_syntax_t  syntax 
) [static]

Definition at line 4279 of file gkregex.c.

References peek_token().

Referenced by parse(), parse_dup_op(), parse_expression(), parse_reg_exp(), and parse_sub_exp().

Here is the call graph for this function:

Here is the caller graph for this function:

static int internal_function peek_token_bracket ( re_token_t token,
re_string_t input,
reg_syntax_t  syntax 
) [static]

static reg_errcode_t internal_function build_range_exp ( bitset_t  sbcset,
re_charset_t mbcset,
int range_alloc,
bracket_elem_t start_elem,
bracket_elem_t end_elem 
) [static]

static void internal_function match_ctx_clean ( re_match_context_t mctx  )  [static]

Type Constraints

Definition at line 10511 of file gkregex.c.

References state_array_t::array, free(), re_sub_match_top_t::lasts, re_match_context_t::nbkref_ents, re_sub_match_top_t::nlasts, re_match_context_t::nsub_tops, re_sub_match_top_t::path, re_sub_match_last_t::path, and re_match_context_t::sub_tops.

Referenced by match_ctx_free(), and re_search_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

static void internal_function match_ctx_free ( re_match_context_t cache  )  [static]

Definition at line 10541 of file gkregex.c.

References re_match_context_t::bkref_ents, match_ctx_clean(), and re_match_context_t::sub_tops.

Referenced by re_search_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function match_ctx_add_entry ( re_match_context_t cache,
int  node,
int  str_idx,
int  from,
int  to 
) [static]

static int internal_function search_cur_bkref_entry ( const re_match_context_t mctx,
int  str_idx 
) [static]

Definition at line 10605 of file gkregex.c.

References re_match_context_t::bkref_ents, re_match_context_t::nbkref_ents, and re_backref_cache_entry::str_idx.

Referenced by check_dst_limits(), expand_bkref_cache(), get_subexp(), and sift_states_bkref().

Here is the caller graph for this function:

static reg_errcode_t internal_function match_ctx_add_subtop ( re_match_context_t mctx,
int  node,
int  str_idx 
) [static]

Definition at line 10628 of file gkregex.c.

References assert, re_match_context_t::asub_tops, calloc(), re_sub_match_top_t::node, re_match_context_t::nsub_tops, REG_ESPACE, REG_NOERROR, re_sub_match_top_t::str_idx, and re_match_context_t::sub_tops.

Referenced by check_subexp_matching_top().

Here is the call graph for this function:

Here is the caller graph for this function:

static re_sub_match_last_t *internal_function match_ctx_add_sublast ( re_sub_match_top_t subtop,
int  node,
int  str_idx 
) [static]

Definition at line 10658 of file gkregex.c.

References re_sub_match_top_t::alasts, calloc(), re_sub_match_top_t::lasts, re_sub_match_top_t::nlasts, re_sub_match_last_t::node, and re_sub_match_last_t::str_idx.

Referenced by get_subexp().

Here is the call graph for this function:

Here is the caller graph for this function:

static void internal_function sift_ctx_init ( re_sift_context_t sctx,
re_dfastate_t **  sifted_sts,
re_dfastate_t **  limited_sts,
int  last_node,
int  last_str_idx 
) [static]

static reg_errcode_t re_search_internal ( const regex_t preg,
const char *  string,
int  length,
int  start,
int  range,
int  stop,
size_t  nmatch,
regmatch_t  pmatch[],
int  eflags 
) [static]

Referenced by re_search_stub(), and regexec().

Here is the caller graph for this function:

static int re_search_2_stub ( struct re_pattern_buffer bufp,
const char *  string1,
int  length1,
const char *  string2,
int  length2,
int  start,
int  range,
struct re_registers regs,
int  stop,
int  ret_len 
) [static]

Referenced by weak_alias().

Here is the caller graph for this function:

static int re_search_stub ( struct re_pattern_buffer bufp,
const char *  string,
int  length,
int  start,
int  range,
int  stop,
struct re_registers regs,
int  ret_len 
) [static]

Definition at line 6775 of file gkregex.c.

References assert, re_registers::num_regs, re_compile_fastmap(), re_copy_regs(), re_search_internal(), REG_NOERROR, regmatch_t::rm_eo, and regmatch_t::rm_so.

Referenced by re_match(), and weak_alias().

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned re_copy_regs ( struct re_registers regs,
regmatch_t pmatch,
int  nregs,
int  regs_allocated 
) [static]

Definition at line 6864 of file gkregex.c.

References assert, regmatch_t::rm_eo, and regmatch_t::rm_so.

Referenced by re_search_stub().

Here is the caller graph for this function:

static reg_errcode_t prune_impossible_nodes ( re_match_context_t mctx  )  [static]

Definition at line 7303 of file gkregex.c.

References assert, check_halt_state_context(), re_sift_context_t::limits, merge_state_array(), re_dfa_t::nbackref, REG_ESPACE, REG_NOERROR, REG_NOMATCH, sift_ctx_init(), and sift_states_backward().

Referenced by re_search_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

static int internal_function check_matching ( re_match_context_t mctx,
int  fl_longest_match,
int p_match_first 
) [static]

static int internal_function check_halt_state_context ( const re_match_context_t mctx,
const re_dfastate_t state,
int  idx 
) [static]

static void internal_function update_regs ( const re_dfa_t dfa,
regmatch_t pmatch,
regmatch_t prev_idx_match,
int  cur_node,
int  cur_idx,
int  nmatch 
) [static]

static reg_errcode_t internal_function push_fail_stack ( struct re_fail_stack_t fs,
int  str_idx,
int  dest_node,
int  nregs,
regmatch_t regs,
re_node_set eps_via_nodes 
) [static]

Definition at line 7705 of file gkregex.c.

References re_fail_stack_t::alloc, re_fail_stack_ent_t::eps_via_nodes, re_fail_stack_ent_t::idx, re_fail_stack_ent_t::node, re_fail_stack_t::num, re_node_set_init_copy(), realloc(), REG_ESPACE, re_fail_stack_ent_t::regs, and re_fail_stack_t::stack.

Referenced by proceed_next_node().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function set_regs ( const regex_t preg,
const re_match_context_t mctx,
size_t  nmatch,
regmatch_t pmatch,
int  fl_backtrack 
) [static]

Definition at line 7752 of file gkregex.c.

References re_pattern_buffer::buffer, and re_fail_stack_ent_t::eps_via_nodes.

Referenced by re_search_internal().

Here is the caller graph for this function:

static reg_errcode_t internal_function free_fail_stack_return ( struct re_fail_stack_t fs  )  [static]

static int internal_function sift_states_iter_mb ( const re_match_context_t mctx,
re_sift_context_t sctx,
int  node_idx,
int  str_idx,
int  max_str_idx 
) [static]

Definition at line 8577 of file gkregex.c.

References check_node_accept_bytes(), re_match_context_t::dfa, re_match_context_t::input, re_dfa_t::nexts, and re_sift_context_t::sifted_states.

Referenced by build_sifted_states().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function sift_states_backward ( const re_match_context_t mctx,
re_sift_context_t sctx 
) [static]

static reg_errcode_t internal_function build_sifted_states ( const re_match_context_t mctx,
re_sift_context_t sctx,
int  str_idx,
re_node_set cur_dest 
) [static]

static reg_errcode_t internal_function update_cur_sifted_state ( const re_match_context_t mctx,
re_sift_context_t sctx,
int  str_idx,
re_node_set dest_nodes 
) [static]

static reg_errcode_t internal_function add_epsilon_src_nodes ( const re_dfa_t dfa,
re_node_set dest_nodes,
const re_node_set candidates 
) [static]

Definition at line 8168 of file gkregex.c.

References re_node_set::alloc, re_node_set::elems, re_dfastate_t::inveclosure, re_dfa_t::inveclosures, re_node_set::nelem, re_acquire_state(), re_node_set_add_intersect(), re_node_set_alloc(), re_node_set_merge(), REG_ESPACE, and REG_NOERROR.

Referenced by update_cur_sifted_state().

Here is the call graph for this function:

Here is the caller graph for this function:

static int internal_function check_dst_limits ( const re_match_context_t mctx,
re_node_set limits,
int  dst_node,
int  dst_idx,
int  src_node,
int  src_idx 
) [static]

static int internal_function check_dst_limits_calc_pos_1 ( const re_match_context_t mctx,
int  boundaries,
int  subexp_idx,
int  from_node,
int  bkref_idx 
) [static]

static int internal_function check_dst_limits_calc_pos ( const re_match_context_t mctx,
int  limit,
int  subexp_idx,
int  node,
int  str_idx,
int  bkref_idx 
) [static]

Definition at line 8359 of file gkregex.c.

References re_match_context_t::bkref_ents, check_dst_limits_calc_pos_1(), re_backref_cache_entry::subexp_from, and re_backref_cache_entry::subexp_to.

Referenced by check_dst_limits().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function check_subexp_limits ( const re_dfa_t dfa,
re_node_set dest_nodes,
const re_node_set candidates,
re_node_set limits,
struct re_backref_cache_entry bkref_ents,
int  str_idx 
) [static]

static reg_errcode_t internal_function sift_states_bkref ( const re_match_context_t mctx,
re_sift_context_t sctx,
int  str_idx,
const re_node_set candidates 
) [static]

static reg_errcode_t internal_function merge_state_array ( const re_dfa_t dfa,
re_dfastate_t **  dst,
re_dfastate_t **  src,
int  num 
) [static]

Definition at line 8093 of file gkregex.c.

References re_acquire_state(), re_node_set_init_union(), and REG_NOERROR.

Referenced by prune_impossible_nodes(), and sift_states_bkref().

Here is the call graph for this function:

Here is the caller graph for this function:

re_dfastate_t *internal_function find_recover_state ( reg_errcode_t err,
re_match_context_t mctx 
) [static]

Definition at line 8744 of file gkregex.c.

References re_match_context_t::input, max(), merge_state_with_log(), REG_NOERROR, re_match_context_t::state_log, and re_match_context_t::state_log_top.

Referenced by check_matching().

Here is the call graph for this function:

Here is the caller graph for this function:

static re_dfastate_t *internal_function transit_state ( reg_errcode_t err,
re_match_context_t mctx,
re_dfastate_t state 
) [static]

re_dfastate_t *internal_function merge_state_with_log ( reg_errcode_t err,
re_match_context_t mctx,
re_dfastate_t next_state 
) [static]

static reg_errcode_t internal_function check_subexp_matching_top ( re_match_context_t mctx,
re_node_set cur_nodes,
int  str_idx 
) [static]

Definition at line 8775 of file gkregex.c.

References re_match_context_t::dfa, re_node_set::elems, re_token_t::idx, match_ctx_add_subtop(), re_node_set::nelem, re_dfa_t::nodes, OP_OPEN_SUBEXP, re_token_t::opr, REG_NOERROR, re_token_t::type, and re_dfa_t::used_bkref_map.

Referenced by check_matching(), merge_state_with_log(), and transit_state_bkref().

Here is the call graph for this function:

Here is the caller graph for this function:

static re_dfastate_t * transit_state_sb ( reg_errcode_t err,
re_match_context_t mctx,
re_dfastate_t pstate 
) [static]

static reg_errcode_t internal_function transit_state_mb ( re_match_context_t mctx,
re_dfastate_t pstate 
) [static]

static reg_errcode_t internal_function transit_state_bkref ( re_match_context_t mctx,
const re_node_set nodes 
) [static]

static reg_errcode_t internal_function get_subexp ( re_match_context_t mctx,
int  bkref_node,
int  bkref_str_idx 
) [static]

static reg_errcode_t internal_function get_subexp_sub ( re_match_context_t mctx,
const re_sub_match_top_t sub_top,
re_sub_match_last_t sub_last,
int  bkref_node,
int  bkref_str 
) [static]

Definition at line 9181 of file gkregex.c.

References check_arrival(), clean_state_log_if_needed(), match_ctx_add_entry(), re_sub_match_last_t::node, OP_OPEN_SUBEXP, re_sub_match_last_t::path, REG_NOERROR, re_sub_match_top_t::str_idx, and re_sub_match_last_t::str_idx.

Referenced by get_subexp().

Here is the call graph for this function:

Here is the caller graph for this function:

static int internal_function find_subexp_node ( const re_dfa_t dfa,
const re_node_set nodes,
int  subexp_idx,
int  type 
) [static]

Definition at line 9210 of file gkregex.c.

References re_node_set::elems, re_token_t::idx, re_node_set::nelem, re_dfa_t::nodes, re_token_t::opr, and re_token_t::type.

Referenced by check_arrival_expand_ecl(), and get_subexp().

Here is the caller graph for this function:

static reg_errcode_t internal_function check_arrival ( re_match_context_t mctx,
state_array_t path,
int  top_node,
int  top_str,
int  last_node,
int  last_str,
int  type 
) [static]

static reg_errcode_t internal_function check_arrival_add_next_nodes ( re_match_context_t mctx,
int  str_idx,
re_node_set cur_nodes,
re_node_set next_nodes 
) [static]

static reg_errcode_t internal_function check_arrival_expand_ecl ( const re_dfa_t dfa,
re_node_set cur_nodes,
int  ex_subexp,
int  type 
) [static]

Definition at line 9472 of file gkregex.c.

References assert, check_arrival_expand_ecl_sub(), re_dfa_t::eclosures, re_node_set::elems, find_subexp_node(), re_node_set::nelem, re_node_set_alloc(), re_node_set_merge(), and REG_NOERROR.

Referenced by check_arrival(), and expand_bkref_cache().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function check_arrival_expand_ecl_sub ( const re_dfa_t dfa,
re_node_set dst_nodes,
int  target,
int  ex_subexp,
int  type 
) [static]

Definition at line 9525 of file gkregex.c.

References re_dfa_t::edests, re_node_set::elems, re_token_t::idx, re_node_set::nelem, re_dfa_t::nodes, OP_CLOSE_SUBEXP, re_token_t::opr, re_node_set_insert(), REG_ESPACE, REG_NOERROR, and re_token_t::type.

Referenced by check_arrival_expand_ecl().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function expand_bkref_cache ( re_match_context_t mctx,
re_node_set cur_nodes,
int  cur_str,
int  subexp_num,
int  type 
) [static]

static int internal_function build_trtable ( const re_dfa_t dfa,
re_dfastate_t state 
) [static]

static int internal_function check_node_accept_bytes ( const re_dfa_t dfa,
int  node_idx,
const re_string_t input,
int  idx 
) [static]

static unsigned int internal_function find_collation_sequence_value ( const unsigned char *  mbs,
size_t  name_len 
) [static]

Definition at line 10311 of file gkregex.c.

References int32_t.

Referenced by check_node_accept_bytes().

Here is the caller graph for this function:

static int internal_function group_nodes_into_DFAstates ( const re_dfa_t dfa,
const re_dfastate_t state,
re_node_set states_node,
bitset_t states_ch 
) [static]

static int internal_function check_node_accept ( const re_match_context_t mctx,
const re_token_t node,
int  idx 
) [static]

static reg_errcode_t internal_function extend_buffers ( re_match_context_t mctx  )  [static]

int regexec ( regex_t *__restrict  preg,
const char *__restrict  string,
size_t  nmatch,
pmatch  ,
int  eflags 
) const

Definition at line 6585 of file gkregex.c.

References length, re_search_internal(), REG_BADPAT, REG_NOERROR, regmatch_t::rm_eo, and regmatch_t::rm_so.

Referenced by __typeof__(), gk_strstr_replace(), match(), and weak_alias().

Here is the call graph for this function:

Here is the caller graph for this function:

versioned_symbol ( libc  ,
__regexec  ,
regexec  ,
GLIBC_2_3_4   
)

__typeof__ ( __regexec   ) 

Definition at line 6626 of file gkregex.c.

References regexec().

Here is the call graph for this function:

compat_symbol ( libc  ,
__compat_regexec  ,
regexec  ,
GLIBC_2_0   
)

int re_match ( struct re_pattern_buffer bufp,
const char *  string,
int  length,
int  start,
struct re_registers regs 
)

Definition at line 6671 of file gkregex.c.

References re_search_stub().

Here is the call graph for this function:

weak_alias ( __re_match  ,
re_match   
)

Definition at line 6680 of file gkregex.c.

References re_search_stub().

Here is the call graph for this function:

weak_alias ( __re_search  ,
re_search   
)

Definition at line 6693 of file gkregex.c.

References re_search_2_stub().

Here is the call graph for this function:

weak_alias ( __re_match_2  ,
re_match_2   
)

Definition at line 6707 of file gkregex.c.

References re_search_2_stub().

Here is the call graph for this function:

weak_alias ( __re_search_2  ,
re_search_2   
)

Definition at line 6721 of file gkregex.c.

References re_search_stub().

Here is the call graph for this function:

void re_set_registers ( struct re_pattern_buffer bufp,
struct re_registers regs,
unsigned  num_regs,
regoff_t starts,
regoff_t ends 
)

Definition at line 6933 of file gkregex.c.

References re_registers::end, re_registers::num_regs, and re_registers::start.

weak_alias ( __re_set_registers  ,
re_set_registers   
)

Definition at line 6954 of file gkregex.c.

References regexec().

Here is the call graph for this function:

static reg_errcode_t re_search_internal ( regex_t preg,
const char *  string,
int  length,
int  start,
int  range,
int  stop,
size_t  nmatch,
pmatch  ,
int  eflags 
) const [static]

static re_dfastate_t* __attribute ( (always_inline)   )  [inline, static]

static int internal_function check_halt_node_context ( const re_dfa_t dfa,
int  node,
unsigned int  context 
) [static]

Definition at line 7564 of file gkregex.c.

References re_token_t::constraint, END_OF_RE, re_dfa_t::nodes, re_token_t::type, and type.

Referenced by check_halt_state_context().

Here is the caller graph for this function:

static int internal_function proceed_next_node ( const re_match_context_t mctx,
int  nregs,
regmatch_t regs,
int pidx,
int  node,
re_node_set eps_via_nodes,
struct re_fail_stack_t fs 
) [static]

static int internal_function pop_fail_stack ( struct re_fail_stack_t fs,
int pidx,
int  nregs,
regmatch_t regs,
re_node_set eps_via_nodes 
) [static]

static reg_errcode_t internal_function clean_state_log_if_needed ( re_match_context_t mctx,
int  next_state_log_idx 
) [static]

Definition at line 8068 of file gkregex.c.

References re_string_t::bufs_len, extend_buffers(), re_match_context_t::input, re_string_t::len, REG_NOERROR, re_match_context_t::state_log, re_match_context_t::state_log_top, and re_string_t::valid_len.

Referenced by get_subexp(), get_subexp_sub(), and transit_state_mb().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function sub_epsilon_src_nodes ( const re_dfa_t dfa,
int  node,
re_node_set dest_nodes,
const re_node_set candidates 
) [static]

Definition at line 8193 of file gkregex.c.

References re_dfa_t::edests, re_node_set::elems, re_dfa_t::inveclosures, re_node_set::nelem, re_dfa_t::nodes, re_node_set_add_intersect(), re_node_set_remove_at(), REG_NOERROR, and re_token_t::type.

Referenced by check_subexp_limits().

Here is the call graph for this function:

Here is the caller graph for this function:

static reg_errcode_t internal_function match_ctx_init ( re_match_context_t mctx,
int  eflags,
int  n 
) [static]


Variable Documentation

const size_t __re_error_msgid_idx [] attribute_hidden

Definition at line 202 of file gkregex.c.

Definition at line 5138 of file gkregex.c.


Generated on Mon Sep 21 08:08:51 2020 for Charm++ by  doxygen 1.5.5