EMs |void |add_alternate |NN AV** alternate_ptr|NN U8* string|STRLEN len
EMsR |SV* |_new_invlist_C_array|NN UV* list
: Not used currently: EXMs |bool |_invlistEQ |NN SV* const a|NN SV* const b|bool complement_b
-EMiR |bool |_invlist_contains_cp|NN SV* const invlist|const UV cp
#endif
Ap |I32 |pregexec |NN REGEXP * const prog|NN char* stringarg \
|NN char* strend|NN char* strbeg|I32 minend \
EiMR |UV* |_invlist_array_init |NN SV* const invlist|const bool will_have_0
EiMR |UV* |invlist_array |NN SV* const invlist
EsM |void |invlist_extend |NN SV* const invlist|const UV len
-EiMR |UV* |_get_invlist_len_addr |NN SV* invlist
EiMR |UV* |get_invlist_zero_addr |NN SV* invlist
-EiMR |UV |_invlist_len |NN SV* const invlist
EiMR |UV |invlist_max |NN SV* const invlist
EiM |void |invlist_set_len |NN SV* const invlist|const UV len
EiM |void |invlist_trim |NN SV* const invlist
EiMR |UV* |get_invlist_version_id_addr |NN SV* invlist
EiM |void |invlist_iterinit|NN SV* invlist
EsMR |bool |invlist_iternext|NN SV* invlist|NN UV* start|NN UV* end
-EXpMR |IV |_invlist_search |NN SV* const invlist|const UV cp
EiMR |UV |invlist_highest|NN SV* const invlist
#endif
#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C)
|I32 none|bool return_if_undef|NULLOK SV* invlist \
|bool passed_in_invlist_has_user_defined_property
EXMpR |SV* |_invlist_contents|NN SV* const invlist
+EiMR |UV* |_get_invlist_len_addr |NN SV* invlist
+EiMR |UV |_invlist_len |NN SV* const invlist
+EMiR |bool |_invlist_contains_cp|NN SV* const invlist|const UV cp
+EXpMR |IV |_invlist_search |NN SV* const invlist|const UV cp
EXMpR |bool |_is_swash_user_defined|NN SV* const swash
EXMpR |SV* |_get_swash_invlist|NN SV* const swash
#endif
# endif
# if defined(PERL_IN_REGCOMP_C)
#define _append_range_to_invlist(a,b,c) S__append_range_to_invlist(aTHX_ a,b,c)
-#define _get_invlist_len_addr(a) S__get_invlist_len_addr(aTHX_ a)
#define _invlist_array_init(a,b) S__invlist_array_init(aTHX_ a,b)
-#define _invlist_contains_cp(a,b) S__invlist_contains_cp(aTHX_ a,b)
-#define _invlist_len(a) S__invlist_len(aTHX_ a)
-#define _invlist_search(a,b) Perl__invlist_search(aTHX_ a,b)
#define _new_invlist_C_array(a) S__new_invlist_C_array(aTHX_ a)
#define add_alternate(a,b,c) S_add_alternate(aTHX_ a,b,c)
#define add_cp_to_invlist(a,b) S_add_cp_to_invlist(aTHX_ a,b)
# endif
# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
#define _core_swash_init(a,b,c,d,e,f,g,h) Perl__core_swash_init(aTHX_ a,b,c,d,e,f,g,h)
+#define _get_invlist_len_addr(a) S__get_invlist_len_addr(aTHX_ a)
#define _get_swash_invlist(a) Perl__get_swash_invlist(aTHX_ a)
+#define _invlist_contains_cp(a,b) S__invlist_contains_cp(aTHX_ a,b)
#define _invlist_contents(a) Perl__invlist_contents(aTHX_ a)
+#define _invlist_len(a) S__invlist_len(aTHX_ a)
+#define _invlist_search(a,b) Perl__invlist_search(aTHX_ a,b)
#define _is_swash_user_defined(a) Perl__is_swash_user_defined(aTHX_ a)
# endif
# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C)
#if defined(PERL_IN_UTF8_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C)
+#define INVLIST_LEN_OFFSET 0 /* Number of elements in the inversion list */
+#define INVLIST_ITER_OFFSET 1 /* Current iteration position */
+
+/* This is a combination of a version and data structure type, so that one
+ * being passed in can be validated to be an inversion list of the correct
+ * vintage. When the structure of the header is changed, a new random number
+ * in the range 2**31-1 should be generated and the new() method changed to
+ * insert that at this location. Then, if an auxiliary program doesn't change
+ * correspondingly, it will be discovered immediately */
+#define INVLIST_VERSION_ID_OFFSET 2
+#define INVLIST_VERSION_ID 1064334010
+
+/* For safety, when adding new elements, remember to #undef them at the end of
+ * the inversion list code section */
+
+#define INVLIST_ZERO_OFFSET 3 /* 0 or 1; must be last element in header */
+/* The UV at position ZERO contains either 0 or 1. If 0, the inversion list
+ * contains the code point U+00000, and begins here. If 1, the inversion list
+ * doesn't contain U+0000, and it begins at the next UV in the array.
+ * Inverting an inversion list consists of adding or removing the 0 at the
+ * beginning of it. By reserving a space for that 0, inversion can be made
+ * very fast */
+
+#define HEADER_LENGTH (INVLIST_ZERO_OFFSET + 1)
+
+/* An element is in an inversion list iff its index is even numbered: 0, 2, 4,
+ * etc */
+#define ELEMENT_RANGE_MATCHES_INVLIST(i) (! ((i) & 1))
+#define PREV_RANGE_MATCHES_INVLIST(i) (! ELEMENT_RANGE_MATCHES_INVLIST(i))
+
+PERL_STATIC_INLINE UV*
+S__get_invlist_len_addr(pTHX_ SV* invlist)
+{
+ /* Return the address of the UV that contains the current number
+ * of used elements in the inversion list */
+
+ PERL_ARGS_ASSERT__GET_INVLIST_LEN_ADDR;
+
+ return (UV *) (SvPVX(invlist) + (INVLIST_LEN_OFFSET * sizeof (UV)));
+}
+
+PERL_STATIC_INLINE UV
+S__invlist_len(pTHX_ SV* const invlist)
+{
+ /* Returns the current number of elements stored in the inversion list's
+ * array */
+
+ PERL_ARGS_ASSERT__INVLIST_LEN;
+
+ return *_get_invlist_len_addr(invlist);
+}
+
+PERL_STATIC_INLINE bool
+S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp)
+{
+ /* Does <invlist> contain code point <cp> as part of the set? */
+
+ IV index = _invlist_search(invlist, cp);
+
+ PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP;
+
+ return index >= 0 && ELEMENT_RANGE_MATCHES_INVLIST(index);
+}
+
#endif
#define PERL_ARGS_ASSERT__APPEND_RANGE_TO_INVLIST \
assert(invlist)
-PERL_STATIC_INLINE UV* S__get_invlist_len_addr(pTHX_ SV* invlist)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT__GET_INVLIST_LEN_ADDR \
- assert(invlist)
-
PERL_STATIC_INLINE UV* S__invlist_array_init(pTHX_ SV* const invlist, const bool will_have_0)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT__INVLIST_ARRAY_INIT \
assert(invlist)
-PERL_STATIC_INLINE bool S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP \
- assert(invlist)
-
-PERL_STATIC_INLINE UV S__invlist_len(pTHX_ SV* const invlist)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT__INVLIST_LEN \
- assert(invlist)
-
-PERL_CALLCONV IV Perl__invlist_search(pTHX_ SV* const invlist, const UV cp)
- __attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT__INVLIST_SEARCH \
- assert(invlist)
-
STATIC SV* S__new_invlist_C_array(pTHX_ UV* list)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT__CORE_SWASH_INIT \
assert(pkg); assert(name); assert(listsv)
+PERL_STATIC_INLINE UV* S__get_invlist_len_addr(pTHX_ SV* invlist)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__GET_INVLIST_LEN_ADDR \
+ assert(invlist)
+
PERL_CALLCONV SV* Perl__get_swash_invlist(pTHX_ SV* const swash)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT__GET_SWASH_INVLIST \
assert(swash)
+PERL_STATIC_INLINE bool S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP \
+ assert(invlist)
+
PERL_CALLCONV SV* Perl__invlist_contents(pTHX_ SV* const invlist)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT__INVLIST_CONTENTS \
assert(invlist)
+PERL_STATIC_INLINE UV S__invlist_len(pTHX_ SV* const invlist)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__INVLIST_LEN \
+ assert(invlist)
+
+PERL_CALLCONV IV Perl__invlist_search(pTHX_ SV* const invlist, const UV cp)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__INVLIST_SEARCH \
+ assert(invlist)
+
PERL_CALLCONV bool Perl__is_swash_user_defined(pTHX_ SV* const swash)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
* Some of the methods should always be private to the implementation, and some
* should eventually be made public */
-#define INVLIST_LEN_OFFSET 0 /* Number of elements in the inversion list */
-#define INVLIST_ITER_OFFSET 1 /* Current iteration position */
-
-/* This is a combination of a version and data structure type, so that one
- * being passed in can be validated to be an inversion list of the correct
- * vintage. When the structure of the header is changed, a new random number
- * in the range 2**31-1 should be generated and the new() method changed to
- * insert that at this location. Then, if an auxiliary program doesn't change
- * correspondingly, it will be discovered immediately */
-#define INVLIST_VERSION_ID_OFFSET 2
-#define INVLIST_VERSION_ID 1064334010
-
-/* For safety, when adding new elements, remember to #undef them at the end of
- * the inversion list code section */
-
-#define INVLIST_ZERO_OFFSET 3 /* 0 or 1; must be last element in header */
-/* The UV at position ZERO contains either 0 or 1. If 0, the inversion list
- * contains the code point U+00000, and begins here. If 1, the inversion list
- * doesn't contain U+0000, and it begins at the next UV in the array.
- * Inverting an inversion list consists of adding or removing the 0 at the
- * beginning of it. By reserving a space for that 0, inversion can be made
- * very fast */
-
-#define HEADER_LENGTH (INVLIST_ZERO_OFFSET + 1)
-
-/* Internally things are UVs */
+/* The header definitions are in F<inline_invlist.c> */
+
#define TO_INTERNAL_SIZE(x) ((x + HEADER_LENGTH) * sizeof(UV))
#define FROM_INTERNAL_SIZE(x) ((x / sizeof(UV)) - HEADER_LENGTH)
+ *get_invlist_zero_addr(invlist));
}
-PERL_STATIC_INLINE UV*
-S__get_invlist_len_addr(pTHX_ SV* invlist)
-{
- /* Return the address of the UV that contains the current number
- * of used elements in the inversion list */
-
- PERL_ARGS_ASSERT__GET_INVLIST_LEN_ADDR;
-
- return (UV *) (SvPVX(invlist) + (INVLIST_LEN_OFFSET * sizeof (UV)));
-}
-PERL_STATIC_INLINE UV
-S__invlist_len(pTHX_ SV* const invlist)
-{
- /* Returns the current number of elements stored in the inversion list's
- * array */
-
- PERL_ARGS_ASSERT__INVLIST_LEN;
-
- return *_get_invlist_len_addr(invlist);
-}
-
PERL_STATIC_INLINE void
S_invlist_set_len(pTHX_ SV* const invlist, const UV len)
{
SvPV_shrink_to_cur((SV *) invlist);
}
-/* An element is in an inversion list iff its index is even numbered: 0, 2, 4,
- * etc */
-#define ELEMENT_RANGE_MATCHES_INVLIST(i) (! ((i) & 1))
-#define PREV_RANGE_MATCHES_INVLIST(i) (! ELEMENT_RANGE_MATCHES_INVLIST(i))
-
#define _invlist_union_complement_2nd(a, b, output) _invlist_union_maybe_complement_2nd(a, b, TRUE, output)
STATIC void
#endif
-PERL_STATIC_INLINE bool
-S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp)
-{
- /* Does <invlist> contain code point <cp> as part of the set? */
-
- IV index = _invlist_search(invlist, cp);
-
- PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP;
-
- return index >= 0 && ELEMENT_RANGE_MATCHES_INVLIST(index);
-}
-
PERL_STATIC_INLINE SV*
S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) {
return _add_range_to_invlist(invlist, cp, cp);