summaryrefslogtreecommitdiff
path: root/genpacksizetables.pl
diff options
context:
space:
mode:
authorTon Hospel <perl5-porters@ton.iguana.be>2005-03-06 18:29:38 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-03-08 17:53:50 +0000
commitf337b084e4f053c4222a0b9a773a9e12c0232e6d (patch)
tree1292203ca74046d2df21ce05bb8f8289ea14bc8d /genpacksizetables.pl
parentc478aefb95db58c5f937ab7c70bba552d23df9b2 (diff)
downloadperl-f337b084e4f053c4222a0b9a773a9e12c0232e6d.tar.gz
Encoding neutral unpack
Message-Id: <d0fi6i$k06$1@post.home.lunix> p4raw-id: //depot/perl@24010
Diffstat (limited to 'genpacksizetables.pl')
-rwxr-xr-xgenpacksizetables.pl24
1 files changed, 14 insertions, 10 deletions
diff --git a/genpacksizetables.pl b/genpacksizetables.pl
index e63a3aa5dd..0fffe9b959 100755
--- a/genpacksizetables.pl
+++ b/genpacksizetables.pl
@@ -4,13 +4,16 @@
use strict;
use Encode;
-my @lines = grep {!/^#/} <DATA>;
+my @lines = grep {
+ s/#.*//;
+ /\S/;
+} <DATA>;
sub addline {
- my ($arrays, $chrmap, $letter, $arrayname, $spare, $nocsum, $size,
+ my ($arrays, $chrmap, $letter, $arrayname, $unpredictable, $nocsum, $size,
$condition) = @_;
my $line = "/* $letter */ $size";
- $line .= " | PACK_SIZE_SPARE" if $spare;
+ $line .= " | PACK_SIZE_UNPREDICTABLE" if $unpredictable;
$line .= " | PACK_SIZE_CANNOT_CSUM" if $nocsum;
$line .= ",";
# And then the hack
@@ -24,7 +27,7 @@ sub output_tables {
my $chrmap = shift;
foreach (@_) {
- my ($letter, $shriek, $spare, $nocsum, $size, $condition)
+ my ($letter, $shriek, $unpredictable, $nocsum, $size, $condition)
= /^([A-Za-z])(!?)\t(\S*)\t(\S*)\t([^\t\n]+)(?:\t+(.*))?$/;
die "Can't parse '$_'" unless $size;
@@ -36,7 +39,7 @@ sub output_tables {
}
addline (\%arrays, $chrmap, $letter, $shriek ? 'shrieking' : 'normal',
- $spare, $nocsum, $size, $condition);
+ $unpredictable, $nocsum, $size, $condition);
}
my %earliest;
@@ -100,11 +103,12 @@ output_tables (\%ebcdicmap, @lines);
print "#endif\n";
__DATA__
-#Symbol spare nocsum size
+#Symbol unpredictable
+# nocsum size
c char
-C unsigned char
-W unsigned char
-U char
+C * unsigned char
+W * unsigned char
+U * char
s! short
s =SIZE16
S! unsigned short
@@ -128,7 +132,7 @@ V! =SIZE32 PERL_PACK_CAN_SHRIEKSIGN
N! =SIZE32 PERL_PACK_CAN_SHRIEKSIGN
L =SIZE32
p * char *
-w * char
+w * * char
q Quad_t HAS_QUAD
Q Uquad_t HAS_QUAD
f float