From: Jarkko Hietaniemi Date: Tue, 19 Mar 2002 21:40:49 +0000 (+0000) Subject: [PATCH] proper fallback for I18N::Langinfo X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=806f21cf8ca845798756d580028dd3e146916995;p=p5sagit%2Fp5-mst-13.2.git [PATCH] proper fallback for I18N::Langinfo From: Nicholas Clark Date: Tue, 19 Mar 2002 22:37:08 +0000 Message-ID: <20020319223707.GE311@Bagpuss.unfortu.net> Subject: Re: [PATCH] proper fallback for I18N::Langinfo From: Nicholas Clark Date: Tue, 19 Mar 2002 22:39:55 +0000 Message-ID: <20020319223954.G94831@plum.flirble.org> p4raw-id: //depot/perl@15341 --- diff --git a/MANIFEST b/MANIFEST index 880d0bf..1802397 100644 --- a/MANIFEST +++ b/MANIFEST @@ -397,7 +397,8 @@ ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines ext/GDBM_File/hints/sco.pl Hint for GDBM_File for named architecture ext/GDBM_File/Makefile.PL GDBM extension makefile writer ext/GDBM_File/typemap GDBM extension interface types -ext/I18N/Langinfo/fallback.xs I18N::Langinfo +ext/I18N/Langinfo/fallback/const-c.inc I18N::Langinfo +ext/I18N/Langinfo/fallback/const-xs.inc I18N::Langinfo ext/I18N/Langinfo/Langinfo.pm I18N::Langinfo ext/I18N/Langinfo/Langinfo.t I18N::Langinfo ext/I18N/Langinfo/Langinfo.xs I18N::Langinfo diff --git a/ext/I18N/Langinfo/fallback.xs b/ext/I18N/Langinfo/fallback.xs deleted file mode 100644 index 16ae6e8..0000000 --- a/ext/I18N/Langinfo/fallback.xs +++ /dev/null @@ -1,88 +0,0 @@ -void -constant(sv) - PREINIT: -#ifdef dXSTARG - dXSTARG; /* Faster if we have it. */ -#else - dTARGET; -#endif - STRLEN len; - int type; - IV iv; - /* NV nv; Uncomment this if you need to return NVs */ - /* const char *pv; Uncomment this if you need to return PVs */ - INPUT: - SV * sv; - const char * s = SvPV(sv, len); - PPCODE: - /* Change this to constant(aTHX_ s, len, &iv, &nv); - if you need to return both NVs and IVs */ - type = constant(aTHX_ s, len, &iv); - /* Return 1 or 2 items. First is error message, or undef if no error. - Second, if present, is found value */ - switch (type) { - case PERL_constant_NOTFOUND: - sv = sv_2mortal(newSVpvf("%s is not a valid I18N::Langinfo macro", s)); - PUSHs(sv); - break; - case PERL_constant_NOTDEF: - sv = sv_2mortal(newSVpvf( - "Your vendor has not defined I18N::Langinfo macro %s, used", s)); - PUSHs(sv); - break; - case PERL_constant_ISIV: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHi(iv); - break; - /* Uncomment this if you need to return NOs - case PERL_constant_ISNO: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHs(&PL_sv_no); - break; */ - /* Uncomment this if you need to return NVs - case PERL_constant_ISNV: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHn(nv); - break; */ - /* Uncomment this if you need to return PVs - case PERL_constant_ISPV: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHp(pv, strlen(pv)); - break; */ - /* Uncomment this if you need to return PVNs - case PERL_constant_ISPVN: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHp(pv, iv); - break; */ - /* Uncomment this if you need to return SVs - case PERL_constant_ISSV: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHs(sv); - break; */ - /* Uncomment this if you need to return UNDEFs - case PERL_constant_ISUNDEF: - break; */ - /* Uncomment this if you need to return UVs - case PERL_constant_ISUV: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHu((UV)iv); - break; */ - /* Uncomment this if you need to return YESs - case PERL_constant_ISYES: - EXTEND(SP, 1); - PUSHs(&PL_sv_undef); - PUSHs(&PL_sv_yes); - break; */ - default: - sv = sv_2mortal(newSVpvf( - "Unexpected return type %d while processing I18N::Langinfo macro %s, used", - type, s)); - PUSHs(sv); - }