From: Nicholas Clark Date: Sun, 18 Oct 2009 16:06:55 +0000 (+0100) Subject: Generate prototypes for utf16_textfilter and utf16rev_textfilter using embed.fnc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a28af015d589214a604c671d2bc6eb78eba99218;p=p5sagit%2Fp5-mst-13.2.git Generate prototypes for utf16_textfilter and utf16rev_textfilter using embed.fnc --- diff --git a/embed.fnc b/embed.fnc index bb2a4d9..7bbb91a 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1793,6 +1793,10 @@ s |void |update_debugger_info|NULLOK SV *orig_sv \ |NULLOK const char *const buf|STRLEN len sR |char* |skipspace |NN char *s sR |char* |swallow_bom |NN U8 *s +#ifndef PERL_NO_UTF16_FILTER +s |I32 |utf16_textfilter|int idx|NN SV *sv|int maxlen +s |I32 |utf16rev_textfilter|int idx|NN SV *sv|int maxlen +#endif s |void |checkcomma |NN const char *s|NN const char *name \ |NN const char *what s |bool |feature_is_enabled|NN const char *const name|STRLEN namelen diff --git a/embed.h b/embed.h index d896d79..7e69fec 100644 --- a/embed.h +++ b/embed.h @@ -1580,6 +1580,14 @@ #define update_debugger_info S_update_debugger_info #define skipspace S_skipspace #define swallow_bom S_swallow_bom +#endif +#ifndef PERL_NO_UTF16_FILTER +#ifdef PERL_CORE +#define utf16_textfilter S_utf16_textfilter +#define utf16rev_textfilter S_utf16rev_textfilter +#endif +#endif +#ifdef PERL_CORE #define checkcomma S_checkcomma #define feature_is_enabled S_feature_is_enabled #define force_ident S_force_ident @@ -3947,6 +3955,14 @@ #define update_debugger_info(a,b,c) S_update_debugger_info(aTHX_ a,b,c) #define skipspace(a) S_skipspace(aTHX_ a) #define swallow_bom(a) S_swallow_bom(aTHX_ a) +#endif +#ifndef PERL_NO_UTF16_FILTER +#ifdef PERL_CORE +#define utf16_textfilter(a,b,c) S_utf16_textfilter(aTHX_ a,b,c) +#define utf16rev_textfilter(a,b,c) S_utf16rev_textfilter(aTHX_ a,b,c) +#endif +#endif +#ifdef PERL_CORE #define checkcomma(a,b,c) S_checkcomma(aTHX_ a,b,c) #define feature_is_enabled(a,b) S_feature_is_enabled(aTHX_ a,b) #define force_ident(a,b) S_force_ident(aTHX_ a,b) diff --git a/proto.h b/proto.h index 186bf40..69a6852 100644 --- a/proto.h +++ b/proto.h @@ -5764,6 +5764,18 @@ STATIC char* S_swallow_bom(pTHX_ U8 *s) #define PERL_ARGS_ASSERT_SWALLOW_BOM \ assert(s) +#ifndef PERL_NO_UTF16_FILTER +STATIC I32 S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen) + __attribute__nonnull__(pTHX_2); +#define PERL_ARGS_ASSERT_UTF16_TEXTFILTER \ + assert(sv) + +STATIC I32 S_utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen) + __attribute__nonnull__(pTHX_2); +#define PERL_ARGS_ASSERT_UTF16REV_TEXTFILTER \ + assert(sv) + +#endif STATIC void S_checkcomma(pTHX_ const char *s, const char *name, const char *what) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) diff --git a/toke.c b/toke.c index 0b4ff5c..e41cef6 100644 --- a/toke.c +++ b/toke.c @@ -101,11 +101,6 @@ S_pending_ident(pTHX); static const char ident_too_long[] = "Identifier too long"; -#ifndef PERL_NO_UTF16_FILTER -static I32 utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen); -static I32 utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen); -#endif - #ifdef PERL_MAD # define CURMAD(slot,sv) if (PL_madskills) { curmad(slot,sv); sv = 0; } # define NEXTVAL_NEXTTOKE PL_nexttoke[PL_curforce].next_val @@ -12711,7 +12706,7 @@ S_swallow_bom(pTHX_ U8 *s) U8 *news; I32 newlen; - filter_add(utf16rev_textfilter, NULL); + filter_add(S_utf16rev_textfilter, NULL); Newx(news, (PL_bufend - (char*)s) * 3 / 2 + 1, U8); utf16_to_utf8_reversed(s, news, PL_bufend - (char*)s - 1, @@ -12746,7 +12741,7 @@ S_swallow_bom(pTHX_ U8 *s) U8 *news; I32 newlen; - filter_add(utf16_textfilter, NULL); + filter_add(S_utf16_textfilter, NULL); Newx(news, (PL_bufend - (char*)s) * 3 / 2 + 1, U8); utf16_to_utf8(s, news, PL_bufend - (char*)s, @@ -12808,14 +12803,14 @@ S_swallow_bom(pTHX_ U8 *s) #ifndef PERL_NO_UTF16_FILTER static I32 -utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen) +S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen) { dVAR; const STRLEN old = SvCUR(sv); const I32 count = FILTER_READ(idx+1, sv, maxlen); DEBUG_P(PerlIO_printf(Perl_debug_log, "utf16_textfilter(%p): %d %d (%d)\n", - FPTR2DPTR(void *, utf16_textfilter), + FPTR2DPTR(void *, S_utf16_textfilter), idx, maxlen, (int) count)); if (count) { U8* tmps; @@ -12831,7 +12826,7 @@ utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen) } static I32 -utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen) +S_utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen) { dVAR; const STRLEN old = SvCUR(sv);