about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/regex_internal.c9
-rw-r--r--posix/regexec.c45
2 files changed, 54 insertions, 0 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 1ff6329312..a0b3fa7a6c 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -127,6 +127,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
 /* Helper functions for re_string_allocate, and re_string_construct.  */
 
 static reg_errcode_t
+internal_function
 re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
 {
 #ifdef RE_ENABLE_I18N
@@ -159,6 +160,7 @@ re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
 
 
 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)
@@ -190,6 +192,7 @@ re_string_construct_common (const char *str, int len, re_string_t *pstr,
    built and starts from PSTR->VALID_LEN.  */
 
 static void
+internal_function
 build_wcs_buffer (re_string_t *pstr)
 {
 #ifdef _LIBC
@@ -257,6 +260,7 @@ build_wcs_buffer (re_string_t *pstr)
    but for REG_ICASE.  */
 
 static int
+internal_function
 build_wcs_upper_buffer (re_string_t *pstr)
 {
   mbstate_t prev_st;
@@ -507,6 +511,7 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
    This function is used in case of REG_ICASE.  */
 
 static void
+internal_function
 build_upper_buffer (re_string_t *pstr)
 {
   int char_idx, end_idx;
@@ -529,6 +534,7 @@ build_upper_buffer (re_string_t *pstr)
 /* Apply TRANS to the buffer in PSTR.  */
 
 static void
+internal_function
 re_string_translate_buffer (re_string_t *pstr)
 {
   int buf_idx, end_idx;
@@ -826,6 +832,7 @@ re_string_destruct (re_string_t *pstr)
 /* Return the context at IDX in INPUT.  */
 
 static unsigned int
+internal_function
 re_string_context_at (const re_string_t *input, int idx, int eflags)
 {
   int c;
@@ -1511,6 +1518,7 @@ free_state (re_dfastate_t *state)
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
+internal_function
 create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
 		    unsigned int hash)
 {
@@ -1560,6 +1568,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
    Return the new state if succeeded, otherwise return NULL.  */
 
 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)
 {
diff --git a/posix/regexec.c b/posix/regexec.c
index 05da8f060a..bdfa3550a7 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -1064,6 +1064,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
    index of the buffer.  */
 
 static int
+internal_function
 check_matching (re_match_context_t *mctx, int fl_longest_match,
 		int *p_match_first)
 {
@@ -1214,6 +1215,7 @@ check_halt_node_context (const re_dfa_t *dfa, int node, unsigned int context)
    match the context, return the node.  */
 
 static int
+internal_function
 check_halt_state_context (const re_match_context_t *mctx,
 			  const re_dfastate_t *state, int idx)
 {
@@ -1335,6 +1337,7 @@ proceed_next_node (const re_match_context_t *mctx, int nregs, regmatch_t *regs,
 }
 
 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)
 {
@@ -1381,6 +1384,7 @@ pop_fail_stack (struct re_fail_stack_t *fs, int *pidx, int nregs,
    pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch.  */
 
 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)
 {
@@ -1487,6 +1491,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
 }
 
 static reg_errcode_t
+internal_function
 free_fail_stack_return (struct re_fail_stack_t *fs)
 {
   if (fs)
@@ -1503,6 +1508,7 @@ free_fail_stack_return (struct re_fail_stack_t *fs)
 }
 
 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)
 {
@@ -1574,6 +1580,7 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
   ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
 
 static reg_errcode_t
+internal_function
 sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
 {
   reg_errcode_t err;
@@ -1631,6 +1638,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
 }
 
 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)
 {
@@ -1717,6 +1725,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx)
 }
 
 static reg_errcode_t
+internal_function
 merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
 		   re_dfastate_t **src, int num)
 {
@@ -1743,6 +1752,7 @@ merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
 }
 
 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)
@@ -1790,6 +1800,7 @@ update_cur_sifted_state (const re_match_context_t *mctx,
 }
 
 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)
 {
@@ -1863,6 +1874,7 @@ sub_epsilon_src_nodes (const re_dfa_t *dfa, int node, re_node_set *dest_nodes,
 }
 
 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)
 {
@@ -1898,6 +1910,7 @@ check_dst_limits (const re_match_context_t *mctx, re_node_set *limits,
 }
 
 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)
 {
@@ -1978,6 +1991,7 @@ check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
 }
 
 static int
+internal_function
 check_dst_limits_calc_pos (const re_match_context_t *mctx, int limit,
 			   int subexp_idx, int from_node, int str_idx,
 			   int bkref_idx)
@@ -2007,6 +2021,7 @@ check_dst_limits_calc_pos (const re_match_context_t *mctx, int limit,
    which are against limitations from DEST_NODES. */
 
 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)
@@ -2094,6 +2109,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
 }
 
 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)
 {
@@ -2193,6 +2209,7 @@ sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
 
 #ifdef RE_ENABLE_I18N
 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)
 {
@@ -2222,6 +2239,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
    update the destination of STATE_LOG.  */
 
 static re_dfastate_t *
+internal_function
 transit_state (reg_errcode_t *err, re_match_context_t *mctx,
 	       re_dfastate_t *state)
 {
@@ -2279,6 +2297,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
 
 /* Update the state_log if we need */
 re_dfastate_t *
+internal_function
 merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
 		      re_dfastate_t *next_state)
 {
@@ -2357,6 +2376,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
    multi-byte match, then look in the log for a state
    from which to restart matching.  */
 re_dfastate_t *
+internal_function
 find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
 {
   re_dfastate_t *cur_state;
@@ -2387,6 +2407,7 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
    correspoding back references.  */
 
 static reg_errcode_t
+internal_function
 check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
 			   int str_idx)
 {
@@ -2459,6 +2480,7 @@ transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
 
 #ifdef RE_ENABLE_I18N
 static reg_errcode_t
+internal_function
 transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2528,6 +2550,7 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
 #endif /* RE_ENABLE_I18N */
 
 static reg_errcode_t
+internal_function
 transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2641,6 +2664,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
    delay these checking for prune_impossible_nodes().  */
 
 static reg_errcode_t
+internal_function
 get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2789,6 +2813,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx)
    and SUB_LAST.  */
 
 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)
 {
@@ -2817,6 +2842,7 @@ get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
 	 E.g. RE: (a){2}  */
 
 static int
+internal_function
 find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
 		  int subexp_idx, int type)
 {
@@ -2838,6 +2864,7 @@ find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
    Return REG_NOERROR if it can arrive, or REG_NOMATCH otherwise.  */
 
 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)
 {
@@ -2998,6 +3025,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, int top_node,
 	 Can't we unify them?  */
 
 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)
 {
@@ -3076,6 +3104,7 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx,
 */
 
 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)
 {
@@ -3128,6 +3157,7 @@ check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
    problematic append it to DST_NODES.  */
 
 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)
 {
@@ -3171,6 +3201,7 @@ check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
    in MCTX->BKREF_ENTS.  */
 
 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)
 {
@@ -3259,6 +3290,7 @@ expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
    Return 1 if succeeded, otherwise return NULL.  */
 
 static int
+internal_function
 build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
 {
   reg_errcode_t err;
@@ -3485,6 +3517,7 @@ out_free:
    to DEST_CH[i].  This function return the number of destinations.  */
 
 static int
+internal_function
 group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
 			    re_node_set *dests_node, bitset_t *dests_ch)
 {
@@ -3674,6 +3707,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
    can only accept one byte.  */
 
 static int
+internal_function
 check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
 			 const re_string_t *input, int str_idx)
 {
@@ -3909,6 +3943,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
 
 # ifdef _LIBC
 static unsigned int
+internal_function
 find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
 {
   uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
@@ -3971,6 +4006,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
    byte of the INPUT.  */
 
 static int
+internal_function
 check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
 		   int idx)
 {
@@ -4020,6 +4056,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
 /* Extend the buffers, if the buffers have run out.  */
 
 static reg_errcode_t
+internal_function
 extend_buffers (re_match_context_t *mctx)
 {
   reg_errcode_t ret;
@@ -4078,6 +4115,7 @@ extend_buffers (re_match_context_t *mctx)
 /* Initialize MCTX.  */
 
 static reg_errcode_t
+internal_function
 match_ctx_init (re_match_context_t *mctx, int eflags, int n)
 {
   mctx->eflags = eflags;
@@ -4105,6 +4143,7 @@ match_ctx_init (re_match_context_t *mctx, int eflags, int n)
    of the input, or changes the input string.  */
 
 static void
+internal_function
 match_ctx_clean (re_match_context_t *mctx)
 {
   int st_idx;
@@ -4134,6 +4173,7 @@ match_ctx_clean (re_match_context_t *mctx)
 /* Free all the memory associated with MCTX.  */
 
 static void
+internal_function
 match_ctx_free (re_match_context_t *mctx)
 {
   /* First, free all the memory associated with MCTX->SUB_TOPS.  */
@@ -4148,6 +4188,7 @@ match_ctx_free (re_match_context_t *mctx)
 */
 
 static reg_errcode_t
+internal_function
 match_ctx_add_entry (re_match_context_t *mctx, int node, int str_idx, int from,
 		     int to)
 {
@@ -4196,6 +4237,7 @@ match_ctx_add_entry (re_match_context_t *mctx, int node, int str_idx, int from,
    found.  Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX.  */
 
 static int
+internal_function
 search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx)
 {
   int left, right, mid, last;
@@ -4218,6 +4260,7 @@ search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx)
    at STR_IDX.  */
 
 static reg_errcode_t
+internal_function
 match_ctx_add_subtop (re_match_context_t *mctx, int node, int str_idx)
 {
 #ifdef DEBUG
@@ -4247,6 +4290,7 @@ match_ctx_add_subtop (re_match_context_t *mctx, int node, int str_idx)
    at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP.  */
 
 static re_sub_match_last_t *
+internal_function
 match_ctx_add_sublast (re_sub_match_top_t *subtop, int node, int str_idx)
 {
   re_sub_match_last_t *new_entry;
@@ -4273,6 +4317,7 @@ match_ctx_add_sublast (re_sub_match_top_t *subtop, int node, int str_idx)
 }
 
 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)
 {