Skip to content

Commit e6e110f

Browse files
committed
Add utf8_to_uv_error(s)
This is just utf8n_to_uvchr_error() with a more convenient API that is harder to misuse. New code should use this new function instead of the old.
1 parent 0187f3d commit e6e110f

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

embed.fnc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,6 +3733,13 @@ AMdip |UV |utf8_to_uvchr_buf \
37333733
|NN const U8 *s \
37343734
|NN const U8 *send \
37353735
|NULLOK STRLEN *retlen
3736+
ATmp |bool |utf8_to_uv_errors \
3737+
|NN const U8 * const s \
3738+
|NN const U8 * const e \
3739+
|NN UV *cp_p \
3740+
|NULLOK Size_t *advance_p \
3741+
|const U32 flags \
3742+
|NULLOK U32 *errors
37363743
ATip |bool |utf8_to_uv_msgs|NN const U8 * const s0 \
37373744
|NN const U8 *e \
37383745
|NN UV *cp_p \

embed.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@
862862
# define utf8_to_bytes_new_pv(a,b,c) Perl_utf8_to_bytes_new_pv(aTHX,a,b,c)
863863
# define utf8_to_bytes_overwrite(a,b) Perl_utf8_to_bytes_overwrite(aTHX,a,b)
864864
# define utf8_to_bytes_temp_pv(a,b) Perl_utf8_to_bytes_temp_pv(aTHX,a,b)
865+
# define utf8_to_uv_errors Perl_utf8_to_uv_errors
865866
# define utf8_to_uv_msgs Perl_utf8_to_uv_msgs
866867
# define utf8_to_uv_msgs_helper_ Perl_utf8_to_uv_msgs_helper_
867868
# define utf8n_to_uvchr Perl_utf8n_to_uvchr

proto.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ typedef enum {
159159
#define Perl_utf8n_to_uvchr_error(s, len, lenp, flags, errors) \
160160
Perl_utf8n_to_uvchr_msgs(s, len, lenp, flags, errors, 0)
161161

162+
#define Perl_utf8_to_uv_errors( s, e, cp_p, advance_p, flags, errors) \
163+
Perl_utf8_to_uv_msgs( s, e, cp_p, advance_p, flags, errors, 0)
164+
162165
#define utf16_to_utf8(p, d, bytelen, newlen) \
163166
utf16_to_utf8_base(p, d, bytelen, newlen, 0, 1)
164167
#define utf16_to_utf8_reversed(p, d, bytelen, newlen) \

0 commit comments

Comments
 (0)