summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-01-02 18:48:54 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-01-02 18:48:54 +0100
commit579138af03a3e060aad293b046bafd9b0ca623c1 (patch)
tree4e7ff5778b28bd43e4b686a93c3d39405c0d5195 /bin
parent4c4a2c705525eadb356d2cc0e3d98361992698e9 (diff)
tibtoa: Added string support
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tibtoa7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/tibtoa b/bin/tibtoa
index d4c4262..f4176dc 100755
--- a/bin/tibtoa
+++ b/bin/tibtoa
@@ -640,6 +640,7 @@ sub header_type($) {
when(0x00) { return('var') }
when(0x01) { return('list') }
when(0x02) { return('matrix') }
+ when(0x04) { return('string') }
when(0x05) { return('program') }
default { return(sprintf('0x%02x', $_)) }
}
@@ -651,6 +652,7 @@ sub header_name($) {
given (header_type($header)) {
when('var') { $name = substr($header, 0x3c, 1) }
when('matrix') { $name = substr($header, 0x3d, 1) }
+ when('string') { $name = (ord(substr($header, 0x3d, 1)) + 1) % 10 }
when('program') {
$name = substr($header, 0x3c, 10);
$name =~ s/\x00/ /g;
@@ -799,6 +801,11 @@ if ($header{type} eq 'program') {
print ' | ';
}
}
+} elsif ($header{type} eq 'string') {
+ while($offset < $length) {
+ print substr($program, $offset++, 1);
+ }
+ print "\n";
} else {
print STDERR "file type not supported\n";
}