Skip to content

Commit

Permalink
Merge pull request #20 from rurban/remap-symname
Browse files Browse the repository at this point in the history
Remap symname [RT #94221]
  • Loading branch information
dankogai committed Mar 28, 2014
2 parents 87d0624 + 408358d commit 6565370
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 23 deletions.
7 changes: 5 additions & 2 deletions Byte/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions CN/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions EBCDIC/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
2 changes: 1 addition & 1 deletion Encode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package Encode;
use strict;
use warnings;
our $VERSION = sprintf "%d.%02d", q$Revision: 2.57 $ =~ /(\d+)/g;
our $VERSION = sprintf "%d.%02d", q$Revision: 2.58 $ =~ /(\d+)/g;
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
Expand Down
7 changes: 5 additions & 2 deletions Encode.xs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ UNIMPLEMENTED(_encoded_bytes_to_utf8, I32)
UTF8_ALLOW_LONG))

void
Encode_XSEncoding(pTHX_ encode_t * enc)
Encode_XSEncoding(pTHX_ encode_t * enc, char * name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))), stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i]) {
Expand Down
7 changes: 5 additions & 2 deletions Encode/Makefile_PL.e2x
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ END
print XS <<"END";

static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions JP/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions KR/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions Symbol/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
7 changes: 5 additions & 2 deletions TW/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ END
print XS <<"END";
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down
11 changes: 7 additions & 4 deletions bin/enc2xs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use warnings;
use Getopt::Std;
use Config;
my @orig_ARGV = @ARGV;
our $VERSION = do { my @r = (q$Revision: 2.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our $VERSION = do { my @r = (q$Revision: 2.10 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };

# These may get re-ordered.
# RAW is a do_now as inserted by &enter
Expand Down Expand Up @@ -301,7 +301,7 @@ if ($doC)
my $sym = "${enc}_encoding";
$sym =~ s/\W+/_/g;
print H "extern encode_t $sym;\n";
print D " Encode_XSEncoding(aTHX_ &$sym);\n";
print D " Encode_XSEncoding(aTHX_ &$sym, \"$sym\");\n";
}

if ($cname =~ /(\w+)\.xs$/)
Expand All @@ -310,12 +310,15 @@ if ($doC)
print C <<'END';
static void
Encode_XSEncoding(pTHX_ encode_t *enc)
Encode_XSEncoding(pTHX_ encode_t *enc, char *name)
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
SV *iv = newSViv(PTR2IV(enc));
SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
SvFLAGS(iv) |= SVp_POK;
SvPVX(iv) = name;
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
Expand Down

0 comments on commit 6565370

Please sign in to comment.