summaryrefslogtreecommitdiff
path: root/posix/regex_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'posix/regex_internal.h')
-rw-r--r--posix/regex_internal.h83
1 files changed, 9 insertions, 74 deletions
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 681be1f52b..d1447a4d5e 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -145,9 +145,6 @@ typedef const bitset_word_t *re_const_bitset_ptr_t;
#define bitset_empty(set) memset (set, '\0', sizeof (bitset_t))
#define bitset_set_all(set) memset (set, '\xff', sizeof (bitset_t))
#define bitset_copy(dest,src) memcpy (dest, src, sizeof (bitset_t))
-static inline void bitset_not (bitset_t set);
-static inline void bitset_merge (bitset_t dest, const bitset_t src);
-static inline void bitset_mask (bitset_t dest, const bitset_t src);
#define PREV_WORD_CONSTRAINT 0x0001
#define PREV_NOTWORD_CONSTRAINT 0x0002
@@ -380,45 +377,18 @@ typedef struct re_dfa_t re_dfa_t;
# endif
#endif
-#ifndef RE_NO_INTERNAL_PROTOTYPES
-static reg_errcode_t 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)
- internal_function;
-static reg_errcode_t re_string_construct (re_string_t *pstr, const char *str,
- int len, RE_TRANSLATE_TYPE trans,
- int icase, const re_dfa_t *dfa)
- internal_function;
-static reg_errcode_t re_string_reconstruct (re_string_t *pstr, int idx,
- int eflags) internal_function;
static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
int new_buf_len)
internal_function;
-# ifdef RE_ENABLE_I18N
+#ifdef RE_ENABLE_I18N
static void build_wcs_buffer (re_string_t *pstr) internal_function;
static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
-# endif /* RE_ENABLE_I18N */
+#endif /* RE_ENABLE_I18N */
static void build_upper_buffer (re_string_t *pstr) internal_function;
static void re_string_translate_buffer (re_string_t *pstr) internal_function;
-static void re_string_destruct (re_string_t *pstr) internal_function;
-# ifdef RE_ENABLE_I18N
-static int re_string_elem_size_at (const re_string_t *pstr, int idx)
- internal_function __attribute ((pure));
-static inline int re_string_char_size_at (const re_string_t *pstr, int idx)
- internal_function __attribute ((pure));
-static inline wint_t re_string_wchar_at (const re_string_t *pstr, int idx)
- internal_function __attribute ((pure));
-# endif /* RE_ENABLE_I18N */
static unsigned int re_string_context_at (const re_string_t *input, int idx,
int eflags)
internal_function __attribute ((pure));
-static unsigned char re_string_peek_byte_case (const re_string_t *pstr,
- int idx)
- internal_function __attribute ((pure));
-static unsigned char re_string_fetch_byte_case (re_string_t *pstr)
- internal_function __attribute ((pure));
-#endif
#define re_string_peek_byte(pstr, offset) \
((pstr)->mbs[(pstr)->cur_idx + offset])
#define re_string_fetch_byte(pstr) \
@@ -677,46 +647,11 @@ struct re_dfa_t
__libc_lock_define (, lock)
};
-#ifndef RE_NO_INTERNAL_PROTOTYPES
-static reg_errcode_t re_node_set_alloc (re_node_set *set, int size) internal_function;
-static reg_errcode_t re_node_set_init_1 (re_node_set *set, int elem) internal_function;
-static reg_errcode_t re_node_set_init_2 (re_node_set *set, int elem1,
- int elem2) internal_function;
#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
-static reg_errcode_t re_node_set_init_copy (re_node_set *dest,
- const re_node_set *src) internal_function;
-static reg_errcode_t re_node_set_add_intersect (re_node_set *dest,
- const re_node_set *src1,
- const re_node_set *src2) internal_function;
-static reg_errcode_t re_node_set_init_union (re_node_set *dest,
- const re_node_set *src1,
- const re_node_set *src2) internal_function;
-static reg_errcode_t re_node_set_merge (re_node_set *dest,
- const re_node_set *src) internal_function;
-static int re_node_set_insert (re_node_set *set, int elem) internal_function;
-static int re_node_set_insert_last (re_node_set *set,
- int elem) internal_function;
-static int re_node_set_compare (const re_node_set *set1,
- const re_node_set *set2)
- internal_function __attribute ((pure));
-static int re_node_set_contains (const re_node_set *set, int elem)
- internal_function __attribute ((pure));
-static void re_node_set_remove_at (re_node_set *set, int idx) internal_function;
#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)
-static int re_dfa_add_node (re_dfa_t *dfa, re_token_t token) internal_function;
-static re_dfastate_t *re_acquire_state (reg_errcode_t *err, const
- re_dfa_t *dfa,
- const re_node_set *nodes)
- internal_function;
-static re_dfastate_t *re_acquire_state_context (reg_errcode_t *err,
- const re_dfa_t *dfa,
- const re_node_set *nodes,
- unsigned int context) internal_function;
-static void free_state (re_dfastate_t *state) internal_function;
-#endif
typedef enum
@@ -765,10 +700,10 @@ bitset_mask (bitset_t dest, const bitset_t src)
dest[bitset_i] &= src[bitset_i];
}
-#if defined RE_ENABLE_I18N && !defined RE_NO_INTERNAL_PROTOTYPES
+#ifdef RE_ENABLE_I18N
/* Inline functions for re_string. */
static inline int
-internal_function
+internal_function __attribute ((pure))
re_string_char_size_at (const re_string_t *pstr, int idx)
{
int byte_idx;
@@ -781,7 +716,7 @@ re_string_char_size_at (const re_string_t *pstr, int idx)
}
static inline wint_t
-internal_function
+internal_function __attribute ((pure))
re_string_wchar_at (const re_string_t *pstr, int idx)
{
if (pstr->mb_cur_max == 1)
@@ -790,14 +725,14 @@ re_string_wchar_at (const re_string_t *pstr, int idx)
}
static int
-internal_function
+internal_function __attribute ((pure))
re_string_elem_size_at (const re_string_t *pstr, int idx)
{
-#ifdef _LIBC
+# ifdef _LIBC
const unsigned char *p, *extra;
const int32_t *table, *indirect;
int32_t tmp;
-# include <locale/weight.h>
+# include <locale/weight.h>
uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
if (nrules != 0)
@@ -812,7 +747,7 @@ re_string_elem_size_at (const re_string_t *pstr, int idx)
return p - pstr->mbs - idx;
}
else
-#endif /* _LIBC */
+# endif /* _LIBC */
return 1;
}
#endif /* RE_ENABLE_I18N */