summaryrefslogtreecommitdiff
path: root/ext/Encode/bin
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-10-22 13:12:48 +0000
committerNicholas Clark <nick@ccl4.org>2005-10-22 13:12:48 +0000
commit7dd03145f7521e677db128080742a33214229568 (patch)
tree73370c902a6d57458b9052da2af8aa6898c585a7 /ext/Encode/bin
parent6472dca1ce130971bdb208d64ccb9758afc367d0 (diff)
downloadperl-7dd03145f7521e677db128080742a33214229568.tar.gz
use more 'const' in the Encode data structures.
p4raw-id: //depot/perl@25823
Diffstat (limited to 'ext/Encode/bin')
-rw-r--r--ext/Encode/bin/enc2xs7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/Encode/bin/enc2xs b/ext/Encode/bin/enc2xs
index ae2a166c34..82ff01c0ce 100644
--- a/ext/Encode/bin/enc2xs
+++ b/ext/Encode/bin/enc2xs
@@ -276,16 +276,19 @@ if ($doC)
#my @info = ($e2u->{Cname},$u2e->{Cname},$rsym,length($rep),$min_el,$max_el);
my $replen = 0;
$replen++ while($rep =~ /\G\\x[0-9A-Fa-f]/g);
- my @info = ($e2u->{Cname},$u2e->{Cname},qq((U8 *)"$rep"),$replen,$min_el,$max_el);
my $sym = "${enc}_encoding";
$sym =~ s/\W+/_/g;
+ my @info = ($e2u->{Cname},$u2e->{Cname},"${sym}_rep_character",$replen,
+ $min_el,$max_el);
+ print C "static const U8 ${sym}_rep_character[] = \"$rep\";\n";
+ print C "static const char ${sym}_enc_name[] = \"$enc\";\n\n";
print C "const encode_t $sym = \n";
# This is to make null encoding work -- dankogai
for (my $i = (scalar @info) - 1; $i >= 0; --$i){
$info[$i] ||= 1;
}
# end of null tweak -- dankogai
- print C " {",join(',',@info,"{\"$enc\",(const char *)0}"),"};\n\n";
+ print C " {",join(',',@info,"{${sym}_enc_name,(const char *)0}"),"};\n\n";
}
foreach my $enc (sort cmp_name keys %encoding)