Skip to content

Commit 16d0f3c

Browse files
committed
Add utf8_to_uv_flags()
This is just utf8n_to_uvchr() with a more convenient API that is harder to misuse. New code should use this new function instead of the old.
1 parent e6e110f commit 16d0f3c

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

embed.fnc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,6 +3740,12 @@ ATmp |bool |utf8_to_uv_errors \
37403740
|NULLOK Size_t *advance_p \
37413741
|const U32 flags \
37423742
|NULLOK U32 *errors
3743+
ATmp |bool |utf8_to_uv_flags \
3744+
|NN const U8 * const s \
3745+
|NN const U8 * const e \
3746+
|NN UV *cp_p \
3747+
|NULLOK Size_t *advance_p \
3748+
|const U32 flag
37433749
ATip |bool |utf8_to_uv_msgs|NN const U8 * const s0 \
37443750
|NN const U8 *e \
37453751
|NN UV *cp_p \

embed.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@
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)
865865
# define utf8_to_uv_errors Perl_utf8_to_uv_errors
866+
# define utf8_to_uv_flags Perl_utf8_to_uv_flags
866867
# define utf8_to_uv_msgs Perl_utf8_to_uv_msgs
867868
# define utf8_to_uv_msgs_helper_ Perl_utf8_to_uv_msgs_helper_
868869
# 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ 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_flags( s, e, cp_p, advance_p, flags) \
163+
Perl_utf8_to_uv_errors( s, e, cp_p, advance_p, flags, 0)
162164
#define Perl_utf8_to_uv_errors( s, e, cp_p, advance_p, flags, errors) \
163165
Perl_utf8_to_uv_msgs( s, e, cp_p, advance_p, flags, errors, 0)
164166

0 commit comments

Comments
 (0)