From: Ben Pfaff Date: Sun, 2 Nov 2014 00:01:09 +0000 (-0700) Subject: Successfully interpret data in most files whose data begin with 0 1 1 0 1. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e852929bd8eae4bb323063a77c357a1462c43be6;p=pspp Successfully interpret data in most files whose data begin with 0 1 1 0 1. --- diff --git a/dump.c b/dump.c index 28c0ca3bbc..7dd86feb89 100644 --- a/dump.c +++ b/dump.c @@ -271,7 +271,20 @@ dump_value(int level) unsigned int format; double value; - match_byte_assert (0x58); + if (match_byte (0x31)) + { + if (match_u32 (1)) + { + printf("(footnote %d) ", get_u32()); + match_byte_assert (0); + match_byte_assert (0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + } + else + match_byte_assert (0x58); format = get_u32 (); value = get_double (); printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff); @@ -641,6 +654,103 @@ dump_dims(void) } } +static void +dump_data(void) +{ + if (!match_u32 (0) || !match_u32 (1) || !match_u32(1) || !match_u32(0) || !match_u32(1)) + { + printf ("skipping data\n"); + return; + } +#if 0 + fprintf (stderr,"data intro:"); + for (int i = 0; i < 5; i++) + fprintf (stderr," %d", get_u32()); + fprintf(stderr,"\n"); +#endif + int x = get_u32(); + printf ("%d data values, starting at %08x\n", x, pos); + for (int i = 0; i < x; i++) + { + printf("%08x, index %d:\n", pos, get_u32()); + match_u32_assert(0); + if (match_byte (1)) + { + unsigned int format; + double value; + + if (match_byte (0x31)) + { + if (match_u32 (1)) + { + printf("(footnote %d) ", get_u32()); + match_byte_assert (0); + match_byte_assert (0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + } + else + match_byte_assert (0x58); + format = get_u32 (); + value = get_double (); + printf (" value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff); + } + else if (match_byte (3)) + { + get_string(); + if (match_byte (0x31)) + { + if (match_u32 (1)) + { + printf("(footnote %d) ", get_u32()); + match_byte_assert (0); + match_byte_assert (0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + else if (match_u32 (2)) + { + printf("(special 2)"); + match_byte_assert(0); + match_byte_assert(0); + match_u32_assert(1); + match_byte_assert(0); + match_byte_assert(0); + int subn = get_u32 (); + printf ("nested %d bytes", subn); + pos += subn; + } + else + { + match_u32_assert(3); + printf("(special 3)"); + match_byte_assert(0); + match_byte_assert(0); + match_byte_assert(1); + match_byte_assert(0); + int subn = get_u32 (); + printf ("nested %d bytes, ", subn); + pos += subn; + subn = get_u32 (); + printf ("nested %d bytes, ", subn); + pos += subn; + } + } + else + match_byte_assert (0x58); + get_string(); + printf("string \"%s\"", get_string()); + match_byte (0); + } + else + dump_value(0); + putchar('\n'); + } +} + int main(int argc, char *argv[]) { @@ -717,7 +827,8 @@ main(int argc, char *argv[]) pos = start; dump_dims (); - return 0; + dump_data (); + start = pos; } else { diff --git a/notes b/notes index 44336aad9c..fa51260284 100644 --- a/notes +++ b/notes @@ -1398,6 +1398,42 @@ web/bf0de88830dd9a93323cfb8d7501f342/00000000075_lightTableData.bin (Default Mul 03 "Sig." 58 "significance_level" "Significance" i1 i2 i4 00 00 00 00 00 00 00 00 +Data +---- + +williams/00000000053_lightTableData.bin: + + i0 i1 i1 i0 i1 i4 + + i0 i0 01 31 i1 i0 00 00 i11: (i5: ("" 58) 58 58) F40.3(0.760) + i1 i0 01 58 F40.3(0.578) + i2 i0 01 58 F40.3(0.573) + i3 i0 01 58 F40.3(0.666) + +germano/Crosstabs/00000000014_lightTableData.bin: + + 00 00 00 00 00 00 00 00 i2 i1 i2 00 00 00 00 i1 432 + i0 i0 03 + "<5 " i49 00 i1 + "a" i11 i5 00 00 00 00 58 58 58 00 00 00 00 + "<5 " 00 i96 00 00 00 00 03 + "<5 " i49 00 i1 + "a" i11 i5 00 00 00 00 58 58 58 00 00 00 00 + "<5 " 00 i192 00 00 00 00 03 + "<5 " i49 00 i1 + "a" i11 i5 00 00 00 00 58 58 58 00 00 00 00 + "<5 " 00 20 i1 00 00 00 03 + "<5 " i49 00 i1 + +web/c6b0660f7afccdb067f766a44ded21ab/00000000038_lightTableData.bin (Rotated Factor Matrix): + + i315 i0 03 " " 58 "" "" 00 + i1 i0 03 " " 58 "" "" 00 + i6 i0 03 + " " 58 00 00 00 00 + " " 00 i11 00 00 00 00 03 + " " 58 00 00 00 00 + Data: tdump21 (germano/Crosstabs.pdf) -------------