diff options
author | Karl Williamson <khw@cpan.org> | 2016-09-19 09:59:32 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-09-25 22:24:20 -0600 |
commit | 9f2abfdef8903cce0a7b12ce12788ce7e9f72ed1 (patch) | |
tree | d908a06dcda7d93207f2d332292afa86eac079e1 /proto.h | |
parent | 152c1f4b3a3b82886ecaa218d01d1a5a20f80f17 (diff) | |
download | perl-9f2abfdef8903cce0a7b12ce12788ce7e9f72ed1.tar.gz |
Add API Unicode handling functions
These functions are all extensions of the is_utf8_string_foo()
functions, that restrict the UTF-8 recognized as valid in various ways.
There are named ones for the two definitions that Unicode makes, and
foo_flags ones for more custom restrictions.
The named ones are implemented as tries, while the flags ones provide
complete generality
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -1328,6 +1328,15 @@ PERL_CALLCONV bool Perl_isIDFIRST_lazy(pTHX_ const char* p) __attribute__warn_unused_result__ __attribute__pure__; */ +PERL_STATIC_INLINE bool S_is_c9strict_utf8_string(const U8 *s, const STRLEN len) + __attribute__pure__; +#define PERL_ARGS_ASSERT_IS_C9STRICT_UTF8_STRING \ + assert(s) + +/* PERL_CALLCONV bool is_c9strict_utf8_string_loc(const U8 *s, const STRLEN len, const U8 **ep); */ +PERL_STATIC_INLINE bool S_is_c9strict_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el); +#define PERL_ARGS_ASSERT_IS_C9STRICT_UTF8_STRING_LOCLEN \ + assert(s) /* PERL_CALLCONV bool Perl_is_invariant_string(const U8* const s, const STRLEN len) __attribute__warn_unused_result__ __attribute__pure__; */ @@ -1335,6 +1344,15 @@ PERL_CALLCONV bool Perl_isIDFIRST_lazy(pTHX_ const char* p) PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX) __attribute__warn_unused_result__; +PERL_STATIC_INLINE bool S_is_strict_utf8_string(const U8 *s, const STRLEN len) + __attribute__pure__; +#define PERL_ARGS_ASSERT_IS_STRICT_UTF8_STRING \ + assert(s) + +/* PERL_CALLCONV bool is_strict_utf8_string_loc(const U8 *s, const STRLEN len, const U8 **ep); */ +PERL_STATIC_INLINE bool S_is_strict_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el); +#define PERL_ARGS_ASSERT_IS_STRICT_UTF8_STRING_LOCLEN \ + assert(s) PERL_CALLCONV bool Perl_is_uni_alnum(pTHX_ UV c) __attribute__deprecated__ __attribute__warn_unused_result__ @@ -1614,14 +1632,23 @@ PERL_STATIC_INLINE bool Perl_is_utf8_string(const U8 *s, const STRLEN len) #define PERL_ARGS_ASSERT_IS_UTF8_STRING \ assert(s) +PERL_STATIC_INLINE bool S_is_utf8_string_flags(const U8 *s, const STRLEN len, const U32 flags) + __attribute__pure__; +#define PERL_ARGS_ASSERT_IS_UTF8_STRING_FLAGS \ + assert(s) + #ifndef NO_MATHOMS PERL_CALLCONV bool Perl_is_utf8_string_loc(const U8 *s, const STRLEN len, const U8 **ep); #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC \ assert(s); assert(ep) #endif +/* PERL_CALLCONV bool is_utf8_string_loc_flags(const U8 *s, const STRLEN len, const U8 **ep, const U32 flags); */ PERL_STATIC_INLINE bool Perl_is_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el); #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN \ assert(s) +PERL_STATIC_INLINE bool S_is_utf8_string_loclen_flags(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el, const U32 flags); +#define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN_FLAGS \ + assert(s) PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ const U8 *p) __attribute__deprecated__ __attribute__warn_unused_result__; |