13 all_ascii(const uint8_t *p, size_t n)
15 for (size_t i = 0; i < n; i++)
16 if (p[i] < 32 || p[i] > 126)
22 try_find(const char *target, size_t target_len)
24 const uint8_t *pos = (const uint8_t *) memmem (data, n, target, target_len);
25 return pos ? pos - data : 0;
29 try_find_tail(const char *target, size_t target_len)
31 size_t pos = try_find(target, target_len);
32 return pos ? pos + target_len : 0;
36 find(const char *target, size_t target_len)
38 size_t pos = try_find(target, target_len);
41 fprintf (stderr, "not found\n");
48 find_tail(const char *target, size_t target_len)
50 size_t pos = try_find_tail(target, target_len);
53 fprintf (stderr, "not found\n");
62 #define STR(x) XSTR(x)
63 #define WHERE __FILE__":" STR(__LINE__)
69 memcpy(&x, &data[pos], 4);
78 memcpy(&x, &data[pos], 8);
93 match_u32_assert(uint32_t x, const char *where)
95 unsigned int y = get_u32();
98 fprintf(stderr, "%s: 0x%x: expected i%u, got i%u\n", where, pos - 4, x, y);
102 #define match_u32_assert(x) match_u32_assert(x, WHERE)
105 match_byte(uint8_t b)
107 if (pos < n && data[pos] == b)
117 match_byte_assert(uint8_t b, const char *where)
121 fprintf(stderr, "%s: 0x%x: expected %02x, got %02x\n", where, pos, b, data[pos]);
125 #define match_byte_assert(b) match_byte_assert(b, WHERE)
128 get_string(const char *where)
131 /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/
132 /*&& all_ascii(&data[pos + 4], data[pos])*/)
134 int len = data[pos] + data[pos + 1] * 256;
135 char *s = malloc(len + 1);
137 memcpy(s, &data[pos + 4], len);
144 fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
148 #define get_string() get_string(WHERE)
153 if (match_byte (0x31))
157 match_u32_assert (0);
158 int subn = get_u32 ();
159 printf ("nested %d bytes", subn);
162 else if (match_u32 (1))
164 printf("(footnote %d) ", get_u32());
165 match_byte_assert (0);
166 match_byte_assert (0);
167 int subn = get_u32 ();
168 printf ("nested %d bytes", subn);
171 else if (match_u32 (2))
173 printf("(special 2)");
174 match_byte_assert(0);
175 match_byte_assert(0);
177 match_byte_assert(0);
178 match_byte_assert(0);
179 int subn = get_u32 ();
180 printf ("nested %d bytes", subn);
186 printf("(special 3)");
187 match_byte_assert(0);
188 match_byte_assert(0);
189 match_byte_assert(1);
190 match_byte_assert(0);
191 int subn = get_u32 ();
192 printf ("nested %d bytes, ", subn);
195 printf ("nested %d bytes, ", subn);
200 match_byte_assert (0x58);
204 dump_value(int level)
206 for (int i = 0; i <= level; i++)
215 char *s1 = get_string();
217 char *s2 = get_string();
218 char *s3 = get_string();
220 printf("strings \"%s\", \"%s\" and \"%s\"", s1, s2, s3);
222 printf("string \"%s\" and \"%s\"", s1, s2);
233 else if (match_byte (5))
235 match_byte_assert (0x58);
236 printf ("variable \"%s\"", get_string());
238 if (!match_byte(1) && !match_byte(2))
239 match_byte_assert(3);
245 else if (match_byte (2))
251 match_byte_assert (0x58);
253 value = get_double ();
255 vallab = get_string ();
256 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
257 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
258 if (!match_byte (1) && !match_byte(2))
259 match_byte_assert (3);
268 else if (match_byte (4))
271 char *var, *vallab, *value;
273 match_byte_assert (0x58);
275 vallab = get_string ();
277 if (!match_byte(1) && !match_byte(2))
278 match_byte_assert (3);
279 value = get_string ();
280 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
281 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
287 else if (match_byte (1))
294 value = get_double ();
295 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
305 char *base = get_string();
307 printf ("\"%s\" with %d variables:\n", base, x);
310 for (int i = 0; i < x; i++)
312 dump_value (level+1);
318 for (int i = 0; i < x; i++)
322 for (int j = 0; j <= level; j++)
324 printf("variable %d has %d values:\n", i, y);
325 for (int j = 0; j < y; j++)
329 char *a = get_string();
330 match_byte_assert(0x58);
331 char *b = get_string();
332 char *c = get_string();
333 for (int k = 0; k <= level + 1; k++)
335 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
343 dump_value (level+1);
352 dump_dim_value(int level)
354 for (int i = 0; i <= level; i++)
360 if (match_byte (0x31))
363 printf("(footnote %d) ", get_u32());
364 match_byte_assert (0);
365 match_byte_assert (0);
366 int subn = get_u32 ();
367 printf ("nested %d bytes", subn);
371 match_byte_assert (0x58);
373 printf("string \"%s\"", get_string());
375 match_byte_assert (1);
381 else if (match_byte (5))
383 match_byte_assert (0x58);
384 printf ("variable \"%s\"", get_string());
387 match_byte_assert(3);
389 else if (match_byte (2))
395 match_byte_assert (0x58);
397 value = get_double ();
399 vallab = get_string ();
400 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
401 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
403 match_u32_assert (2);
406 else if (match_byte (1))
411 match_byte_assert (0x58);
413 value = get_double ();
414 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
426 if (match_byte (0x31))
428 match_u32_assert (0);
429 match_u32_assert (0);
431 printf ("nested %d bytes", subn);
435 match_byte_assert(0x58);
436 printf ("; \"%s\", substitutions:", get_string());
437 int total_subs = get_u32();
441 total_subs = (total_subs - 1) + x;
442 match_u32_assert (0);
444 printf (" (total %d)", total_subs);
446 for (int i = 0; i < total_subs; i++)
449 dump_value (level + 1);
455 dump_category(int level)
465 else if (match_u32 (1))
472 else if (match_byte (1))
476 match_u32_assert (1);
482 match_u32_assert (0);
486 int n_categories = get_u32();
487 if (n_categories > 0)
488 printf (", %d subcategories:", n_categories);
490 for (int i = 0; i < n_categories; i++)
491 dump_category (level + 1);
498 printf("next dim\n");
503 match_byte_assert(0x58);
505 printf("string \"%s\": ", get_string());
506 match_byte(1) || match_byte(0);
511 /* This byte is usually 0x02 but 0x00 and 0x75 (!) have also been spotted. */
514 if (!match_byte(0) && !match_byte(1))
515 match_byte_assert(2);
519 match_byte_assert(1);
529 n_categories = get_u32();
530 printf("%d nested categories\n", n_categories);
531 for (int i = 0; i < n_categories; i++)
540 printf ("%u dimensions\n", n_dims);
541 for (int i = 0; i < n_dims; i++)
549 dump_data_value_31(void)
551 if (match_byte (0x31))
558 match_u32_assert (0);
559 int subn = get_u32 ();
560 printf ("nested %d bytes", subn);
563 else if (match_u32 (1))
565 printf("(footnote %d) ", get_u32());
566 match_byte_assert (0);
567 match_byte_assert (0);
568 int subn = get_u32 ();
569 printf ("nested %d bytes", subn);
572 else if (match_u32 (2))
574 printf("(special 2)");
575 match_byte_assert(0);
576 match_byte_assert(0);
578 match_byte_assert(0);
579 match_byte_assert(0);
580 int subn = get_u32 ();
581 printf ("nested %d bytes", subn);
587 printf("(special 3)");
588 match_byte_assert(0);
589 match_byte_assert(0);
590 match_byte_assert(1);
591 match_byte_assert(0);
592 int subn = get_u32 ();
593 printf ("nested %d bytes, ", subn);
596 printf ("nested %d bytes, ", subn);
601 match_byte_assert (0x58);
609 for (int i = 0; i < 3 + n_dims; i++)
611 printf ("data intro:");
612 for (int i = 0; i < 3 + n_dims; i++)
616 fprintf (stderr,"data intro (%d dims):", n_dims);
617 for (int i = 0; i < 3+n_dims; i++)
618 fprintf (stderr," %d", get_u32());
619 fprintf(stderr,"\n");
622 printf ("%d data values, starting at %08x\n", x, pos);
623 for (int i = 0; i < x; i++)
625 printf("%08x, index %d:\n", pos, get_u32());
636 dump_data_value_31();
638 value = get_double ();
639 printf (" value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
641 else if (match_byte (3))
644 dump_data_value_31();
646 printf("string \"%s\"", get_string());
649 else if (match_byte (2))
655 match_byte_assert (0x58);
657 value = get_double ();
659 vallab = get_string ();
660 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
661 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
662 if (!match_byte (1) && !match_byte(2))
663 match_byte_assert (3);
665 else if (match_byte (4))
668 char *var, *vallab, *value;
670 match_byte_assert (0x58);
672 vallab = get_string ();
674 if (!match_byte(1) && !match_byte(2))
675 match_byte_assert (3);
676 value = get_string ();
677 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
678 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
680 else if (match_byte (5))
682 match_byte_assert (0x58);
683 printf ("variable \"%s\"", get_string());
685 if (!match_byte(1) && !match_byte(2))
686 match_byte_assert(3);
694 dump_data_value_31();
695 char *base = get_string();
697 printf ("\"%s\"; %d variables:\n", base, x);
698 for (int i = 0; i < x; i++)
705 for (int j = 0; j <= 0; j++)
707 printf("variable %d has %d values:\n", i, y);
708 for (int j = 0; j < y; j++)
715 dump_data_value_31();
717 value = get_double ();
718 printf (" value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
720 else if (match_byte(3))
722 char *a = get_string();
723 match_byte_assert(0x58);
724 char *b = get_string();
725 char *c = get_string();
726 for (int k = 0; k <= 1; k++)
728 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
734 else if (match_byte(5))
736 match_byte_assert (0x58);
737 printf ("variable \"%s\"", get_string());
739 if (!match_byte(1) && !match_byte(2))
740 match_byte_assert(3);
757 dump_title_value_31(int level)
759 if (match_byte (0x31))
763 match_u32_assert (0);
764 int subn = get_u32 ();
765 printf ("nested %d bytes", subn);
768 else if (match_u32 (1))
770 printf("(footnote %d) ", get_u32());
771 match_byte_assert (0);
772 match_byte_assert (0);
773 int subn = get_u32 ();
774 printf ("nested %d bytes", subn);
777 else if (match_u32 (2))
779 printf("(special 2)");
780 match_byte_assert(0);
781 match_byte_assert(0);
784 match_byte_assert(0);
785 match_byte_assert(0);
786 int subn = get_u32 ();
787 printf ("nested %d bytes", subn);
793 printf("(special 3)");
794 match_byte_assert(0);
795 match_byte_assert(0);
796 match_byte_assert(1);
797 match_byte_assert(0);
798 int subn = get_u32 ();
799 printf ("nested %d bytes, ", subn);
802 printf ("nested %d bytes, ", subn);
807 match_byte_assert (0x58);
811 dump_title_value(int level)
813 for (int i = 0; i <= level; i++)
824 dump_title_value_31(level);
826 printf("string \"%s\"", get_string());
837 else if (match_byte (5))
839 dump_title_value_31(level);
840 printf ("variable \"%s\"", get_string());
842 if (!match_byte(1) && !match_byte(2))
843 match_byte_assert(3);
845 else if (match_byte (2))
851 match_byte_assert (0x58);
853 value = get_double ();
855 vallab = get_string ();
856 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
857 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
858 if (!match_byte (1) && !match_byte(2))
859 match_byte_assert (3);
868 else if (match_byte (4))
871 char *var, *vallab, *value;
873 match_byte_assert (0x58);
875 vallab = get_string ();
877 if (!match_byte(1) && !match_byte(2))
878 match_byte_assert (3);
879 value = get_string ();
880 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
881 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
887 else if (match_byte (1))
892 dump_title_value_31(level);
894 value = get_double ();
895 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
904 dump_title_value_31(level);
906 char *base = get_string();
908 printf ("\"%s\" with %d variables:\n", base, x);
909 for (int i = 0; i < x; i++)
916 for (int j = 0; j <= level; j++)
918 printf("variable %d has %d values:\n", i, y);
919 for (int j = 0; j < y; j++)
924 char *a = get_string();
925 match_byte_assert(0x58);
926 char *b = get_string();
927 char *c = get_string();
928 for (int k = 0; k <= level + 1; k++)
930 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
933 dump_title_value (level+1);
941 dump_footnote_value(int level)
943 for (int i = 0; i <= level; i++)
953 if (match_byte (0x31))
957 printf("(footnote %d) ", get_u32());
958 match_byte_assert (0);
959 match_byte_assert (0);
960 int subn = get_u32 ();
961 printf ("nested %d bytes", subn);
964 else if (match_u32 (2))
966 printf("(special 2)");
967 match_byte_assert(0);
968 match_byte_assert(0);
970 match_byte_assert(0);
971 match_byte_assert(0);
972 int subn = get_u32 ();
973 printf ("nested %d bytes", subn);
979 printf("(special 3)");
980 match_byte_assert(0);
981 match_byte_assert(0);
982 match_byte_assert(1);
983 match_byte_assert(0);
984 int subn = get_u32 ();
985 printf ("nested %d bytes, ", subn);
988 printf ("nested %d bytes, ", subn);
993 match_byte_assert (0x58);
995 printf("string \"%s\"", get_string());
997 match_byte_assert (1);
999 else if (match_byte (5))
1001 match_byte_assert (0x58);
1002 printf ("variable \"%s\"", get_string());
1004 if (!match_byte(1) && !match_byte(2))
1005 match_byte_assert(3);
1007 else if (match_byte (2))
1009 unsigned int format;
1013 match_byte_assert (0x58);
1014 format = get_u32 ();
1015 value = get_double ();
1016 var = get_string ();
1017 vallab = get_string ();
1018 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
1019 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
1020 if (!match_byte (1) && !match_byte(2))
1021 match_byte_assert (3);
1030 else if (match_byte (4))
1032 unsigned int format;
1033 char *var, *vallab, *value;
1035 match_byte_assert (0x58);
1036 format = get_u32 ();
1037 vallab = get_string ();
1038 var = get_string ();
1039 if (!match_byte(1) && !match_byte(2))
1040 match_byte_assert (3);
1041 value = get_string ();
1042 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
1043 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
1049 else if (match_byte (1))
1051 unsigned int format;
1054 if (match_byte (0x31))
1058 printf("(footnote %d) ", get_u32());
1059 match_byte_assert (0);
1060 match_byte_assert (0);
1061 int subn = get_u32 ();
1062 printf ("nested %d bytes", subn);
1067 match_byte_assert (0x58);
1068 format = get_u32 ();
1069 value = get_double ();
1070 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
1072 else if (match_byte (0x31))
1076 printf("(footnote %d) ", get_u32());
1077 match_byte_assert (0);
1078 match_byte_assert (0);
1079 int subn = get_u32 ();
1080 printf ("nested %d bytes", subn);
1085 match_u32_assert (0);
1086 match_u32_assert (0);
1087 int subn = get_u32 ();
1088 printf ("nested %d bytes", subn);
1091 char *base = get_string();
1093 printf ("\"%s\"; %d variables:\n", base, x);
1094 for (int i = 0; i < x; i++)
1100 match_u32_assert(0);
1101 for (int j = 0; j <= level; j++)
1103 printf("variable %d has %d values:\n", i, y);
1104 for (int j = 0; j < y; j++)
1108 char *a = get_string();
1109 match_byte_assert(0x58);
1110 char *b = get_string();
1111 char *c = get_string();
1112 for (int k = 0; k <= level + 1; k++)
1114 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
1116 match_byte_assert(0);
1119 dump_footnote_value (level+1);
1127 match_byte_assert (0x58);
1128 char *base = get_string();
1130 printf ("\"%s\" with %d variables:\n", base, x);
1131 for (int i = 0; i < x; i++)
1137 match_u32_assert(0);
1138 for (int j = 0; j <= level; j++)
1140 printf("variable %d has %d values:\n", i, y);
1141 for (int j = 0; j < y; j++)
1145 char *a = get_string();
1146 match_byte_assert(0x58);
1147 char *b = get_string();
1148 char *c = get_string();
1149 for (int k = 0; k <= level + 1; k++)
1151 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
1152 match_byte_assert(0);
1155 dump_footnote_value (level+1);
1166 dump_title_value(0); putchar('\n');
1167 dump_title_value(0); putchar('\n');
1168 match_byte_assert(0x31);
1169 dump_title_value(0); putchar('\n');
1171 match_byte_assert(0x58);
1172 if (match_byte(0x31))
1174 dump_footnote_value(0); putchar('\n');
1177 match_byte_assert(0x58);
1180 int n_footnotes = get_u32();
1181 if (n_footnotes >= 20)
1183 fprintf(stderr, "%08x: %d footnotes\n", pos - 4, n_footnotes);
1187 printf("------\n%d footnotes\n", n_footnotes);
1188 if (n_footnotes < 20)
1190 for (int i = 0; i < n_footnotes; i++)
1192 printf("footnote %d:\n", i);
1193 dump_footnote_value(0);
1200 unsigned int format;
1203 if (match_byte (0x31))
1207 printf("(footnote %d) ", get_u32());
1208 match_byte_assert (0);
1209 match_byte_assert (0);
1210 int subn = get_u32 ();
1211 printf ("nested %d bytes", subn);
1216 match_byte_assert (0x58);
1217 format = get_u32 ();
1218 value = get_double ();
1219 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
1226 else if (match_byte (0x31))
1228 match_byte_assert(3);
1230 match_byte_assert(0x58);
1231 match_u32_assert(0);
1236 match_byte_assert (0x58);
1237 printf("(%d)\n", get_u32());
1243 find_dimensions(void)
1246 const char dimensions[] = "-,,,.\0";
1247 int x = try_find_tail(dimensions, sizeof dimensions - 1);
1252 const char dimensions[] = "-,,, .\0";
1253 return find_tail(dimensions, sizeof dimensions - 1);
1259 printf("fonts: offset=%08x\n", pos);
1261 for (int i = 1; i <= 8; i++)
1263 printf("%08x: font %d, ", pos, i);
1264 match_byte_assert(i);
1265 match_byte_assert(0x31);
1266 printf("%s, ", get_string());
1267 match_byte_assert(0);
1268 match_byte_assert(0);
1269 if (!match_byte(0x40) && !match_byte(0x20) && !match_byte(0x80) && !match_byte(0x10))
1270 match_byte_assert(0x50);
1271 if (!match_byte(0x41))
1272 match_byte_assert(0x51);
1274 printf ("%s, ", get_string());
1275 printf ("%s, ", get_string());
1276 match_u32_assert(0);
1277 match_u32_assert(0);
1286 match_u32_assert(240);
1289 match_u32_assert(18);
1296 match_u32_assert(142);
1300 int count = get_u32();
1303 char *encoding = get_string();
1304 printf("encoding=%s\n", encoding);
1307 match_u32_assert(UINT32_MAX);
1309 match_byte_assert(1);
1310 match_byte_assert(0);
1312 match_byte_assert(1);
1313 if (!match_byte(0x99) && !match_byte(0x98))
1314 match_byte_assert(0x97);
1315 match_byte_assert(7);
1316 match_byte_assert(0);
1317 match_byte_assert(0);
1318 if (match_byte('.'))
1319 match_byte_assert(',');
1322 match_byte_assert(',');
1323 if (!match_byte('.'))
1324 match_byte_assert(' ');
1326 match_u32_assert(5);
1327 for (int i = 0; i < 5; i++)
1330 if (pos != find_dimensions())
1331 fprintf (stderr, "%08x / %08x\n", pos, find_dimensions());
1335 main(int argc, char *argv[])
1340 if (isatty(STDIN_FILENO))
1342 fprintf(stderr, "redirect stdin from a .bin file\n");
1345 if (fstat(STDIN_FILENO, &s))
1357 if (read(STDIN_FILENO, data, n) != n)
1365 if (!strcmp(argv[1], "title0"))
1368 if (match_byte (0x03)
1369 || (match_byte (0x05) && match_byte (0x58)))
1370 printf ("%s\n", get_string());
1372 printf ("<unknown>\n");
1375 else if (!strcmp(argv[1], "title"))
1380 else if (!strcmp(argv[1], "titleraw"))
1382 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1384 n = find(fonts, sizeof fonts - 1);
1386 else if (!strcmp(argv[1], "fonts"))
1388 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1389 const char styles[] = "\xf0\0\0\0";
1390 start = find(fonts, sizeof fonts - 1);
1391 n = find(styles, sizeof styles - 1);
1393 else if (!strcmp(argv[1], "styles"))
1395 const char styles[] = "\xf0\0\0\0";
1396 const char dimensions[] = "-,,,.\0";
1397 start = find(styles, sizeof styles - 1);
1398 n = find(dimensions, sizeof dimensions - 1) + sizeof dimensions - 1;
1400 else if (!strcmp(argv[1], "dimensions") || !strcmp(argv[1], "all"))
1403 match_byte_assert(1);
1404 match_byte_assert(0);
1405 match_u32_assert(3);
1406 match_byte_assert(1);
1408 match_byte_assert(1);
1409 match_byte_assert(0);
1410 match_byte_assert(0);
1412 match_byte_assert(1);
1414 match_byte_assert(0);
1415 match_byte_assert(0);
1416 match_byte_assert(0);
1420 printf("\n\ndata:\n");
1423 match_byte_assert (1);
1426 fprintf (stderr, "%x / %x\n", pos, n);
1433 fprintf (stderr, "unknown section %s\n", argv[1]);
1440 for (size_t i = start; i < n; )
1447 && i + 4 + data[i] + data[i + 1] * 256 <= n
1448 && all_ascii(&data[i + 4], data[i] + data[i + 1] * 256))
1450 fputs("\n\"", stdout);
1451 fwrite(&data[i + 4], 1, data[i] + data[i + 1] * 256, stdout);
1452 fputs("\" ", stdout);
1454 i += 4 + data[i] + data[i + 1] * 256;
1456 else if (i + 12 <= n
1457 && data[i + 1] == 40
1459 && data[i + 3] == 0)
1463 memcpy (&d, &data[i + 4], 8);
1464 printf ("F40.%d(%.*f)\n", data[i], data[i], d);
1467 else if (i + 12 <= n
1468 && data[i + 1] == 40
1469 && data[i + 2] == 31
1470 && data[i + 3] == 0)
1474 memcpy (&d, &data[i + 4], 8);
1475 printf ("PCT40.%d(%.*f)\n", data[i], data[i], d);
1479 && (data[i] && data[i] != 88 && data[i] != 0x41)
1484 printf ("i%d ", data[i]);
1489 printf("%02x ", data[i]);