summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-09-25 22:04:08 -0600
committerKarl Williamson <khw@cpan.org>2016-09-25 22:24:20 -0600
commit8bc127bf58304a1e46a3e33d30b0b8b6f21abb07 (patch)
treee19a856cb909b92fa7bd5a7c68dd1bc2fce270b0 /embed.h
parent9f2abfdef8903cce0a7b12ce12788ce7e9f72ed1 (diff)
downloadperl-8bc127bf58304a1e46a3e33d30b0b8b6f21abb07.tar.gz
Add is_utf8_fixed_width_buf_flags() and use it
This encodes a simple pattern that may not be immediately obvious to someone needing it. If you have a fixed-size buffer that is full of purportedly UTF-8 bytes, is it valid or not? It's easy to do, as shown in this commit. The file test operators -T and -B can be simpified by using this function.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 6485397f8d..31d054857b 100644
--- a/embed.h
+++ b/embed.h
@@ -285,6 +285,7 @@
#define is_utf8_char Perl_is_utf8_char
#define is_utf8_cntrl(a) Perl_is_utf8_cntrl(aTHX_ a)
#define is_utf8_digit(a) Perl_is_utf8_digit(aTHX_ a)
+#define is_utf8_fixed_width_buf_loclen_flags S_is_utf8_fixed_width_buf_loclen_flags
#define is_utf8_graph(a) Perl_is_utf8_graph(aTHX_ a)
#define is_utf8_idcont(a) Perl_is_utf8_idcont(aTHX_ a)
#define is_utf8_idfirst(a) Perl_is_utf8_idfirst(aTHX_ a)