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());
377 else if (match_byte (5))
379 match_byte_assert (0x58);
380 printf ("variable \"%s\"", get_string());
383 match_byte_assert(3);
385 else if (match_byte (2))
391 match_byte_assert (0x58);
393 value = get_double ();
395 vallab = get_string ();
396 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
397 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
399 match_u32_assert (2);
402 else if (match_byte (1))
407 match_byte_assert (0x58);
409 value = get_double ();
410 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
422 if (match_byte (0x31))
424 match_u32_assert (0);
425 match_u32_assert (0);
427 printf ("nested %d bytes", subn);
431 match_byte_assert(0x58);
432 printf ("; \"%s\", substitutions:", get_string());
433 int total_subs = get_u32();
437 total_subs = (total_subs - 1) + x;
438 match_u32_assert (0);
440 printf (" (total %d)", total_subs);
442 for (int i = 0; i < total_subs; i++)
445 dump_value (level + 1);
451 dump_category(int level)
461 else if (match_u32 (1))
468 else if (match_byte (1))
472 match_u32_assert (1);
478 match_u32_assert (0);
482 int n_categories = get_u32();
483 if (n_categories > 0)
484 printf (", %d subcategories:", n_categories);
486 for (int i = 0; i < n_categories; i++)
487 dump_category (level + 1);
494 printf("next dim\n");
498 /* This byte is usually 0x02 but 0x00 and 0x75 (!) have also been spotted. */
501 if (!match_byte(0) && !match_byte(1))
502 match_byte_assert(2);
506 match_byte_assert(1);
516 n_categories = get_u32();
517 printf("%d nested categories\n", n_categories);
518 for (int i = 0; i < n_categories; i++)
527 printf ("%u dimensions\n", n_dims);
528 for (int i = 0; i < n_dims; i++)
536 dump_data_value_31(void)
538 if (match_byte (0x31))
545 match_u32_assert (0);
546 int subn = get_u32 ();
547 printf ("nested %d bytes", subn);
550 else if (match_u32 (1))
552 printf("(footnote %d) ", get_u32());
553 match_byte_assert (0);
554 match_byte_assert (0);
555 int subn = get_u32 ();
556 printf ("nested %d bytes", subn);
559 else if (match_u32 (2))
561 printf("(special 2)");
562 match_byte_assert(0);
563 match_byte_assert(0);
565 match_byte_assert(0);
566 match_byte_assert(0);
567 int subn = get_u32 ();
568 printf ("nested %d bytes", subn);
574 printf("(special 3)");
575 match_byte_assert(0);
576 match_byte_assert(0);
577 match_byte_assert(1);
578 match_byte_assert(0);
579 int subn = get_u32 ();
580 printf ("nested %d bytes, ", subn);
583 printf ("nested %d bytes, ", subn);
588 match_byte_assert (0x58);
596 for (int i = 0; i < 3 + n_dims; i++)
598 printf ("data intro:");
599 for (int i = 0; i < 3 + n_dims; i++)
603 fprintf (stderr,"data intro (%d dims):", n_dims);
604 for (int i = 0; i < 3+n_dims; i++)
605 fprintf (stderr," %d", get_u32());
606 fprintf(stderr,"\n");
609 printf ("%d data values, starting at %08x\n", x, pos);
610 for (int i = 0; i < x; i++)
612 printf("%08x, index %d:\n", pos, get_u32());
623 dump_data_value_31();
625 value = get_double ();
626 printf (" value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
628 else if (match_byte (3))
631 dump_data_value_31();
633 printf("string \"%s\"", get_string());
636 else if (match_byte (2))
642 match_byte_assert (0x58);
644 value = get_double ();
646 vallab = get_string ();
647 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
648 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
649 if (!match_byte (1) && !match_byte(2))
650 match_byte_assert (3);
652 else if (match_byte (4))
655 char *var, *vallab, *value;
657 match_byte_assert (0x58);
659 vallab = get_string ();
661 if (!match_byte(1) && !match_byte(2))
662 match_byte_assert (3);
663 value = get_string ();
664 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
665 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
667 else if (match_byte (5))
669 match_byte_assert (0x58);
670 printf ("variable \"%s\"", get_string());
672 if (!match_byte(1) && !match_byte(2))
673 match_byte_assert(3);
681 dump_data_value_31();
682 char *base = get_string();
684 printf ("\"%s\"; %d variables:\n", base, x);
685 for (int i = 0; i < x; i++)
692 for (int j = 0; j <= 0; j++)
694 printf("variable %d has %d values:\n", i, y);
695 for (int j = 0; j < y; j++)
702 dump_data_value_31();
704 value = get_double ();
705 printf (" value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
707 else if (match_byte(3))
709 char *a = get_string();
710 match_byte_assert(0x58);
711 char *b = get_string();
712 char *c = get_string();
713 for (int k = 0; k <= 1; k++)
715 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
721 else if (match_byte(5))
723 match_byte_assert (0x58);
724 printf ("variable \"%s\"", get_string());
726 if (!match_byte(1) && !match_byte(2))
727 match_byte_assert(3);
744 dump_title_value_31(int level)
746 if (match_byte (0x31))
750 match_u32_assert (0);
751 int subn = get_u32 ();
752 printf ("nested %d bytes", subn);
755 else if (match_u32 (1))
757 printf("(footnote %d) ", get_u32());
758 match_byte_assert (0);
759 match_byte_assert (0);
760 int subn = get_u32 ();
761 printf ("nested %d bytes", subn);
764 else if (match_u32 (2))
766 printf("(special 2)");
767 match_byte_assert(0);
768 match_byte_assert(0);
771 match_byte_assert(0);
772 match_byte_assert(0);
773 int subn = get_u32 ();
774 printf ("nested %d bytes", subn);
780 printf("(special 3)");
781 match_byte_assert(0);
782 match_byte_assert(0);
783 match_byte_assert(1);
784 match_byte_assert(0);
785 int subn = get_u32 ();
786 printf ("nested %d bytes, ", subn);
789 printf ("nested %d bytes, ", subn);
794 match_byte_assert (0x58);
798 dump_title_value(int level)
800 for (int i = 0; i <= level; i++)
811 dump_title_value_31(level);
813 printf("string \"%s\"", get_string());
824 else if (match_byte (5))
826 dump_title_value_31(level);
827 printf ("variable \"%s\"", get_string());
829 if (!match_byte(1) && !match_byte(2))
830 match_byte_assert(3);
832 else if (match_byte (2))
838 match_byte_assert (0x58);
840 value = get_double ();
842 vallab = get_string ();
843 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
844 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
845 if (!match_byte (1) && !match_byte(2))
846 match_byte_assert (3);
855 else if (match_byte (4))
858 char *var, *vallab, *value;
860 match_byte_assert (0x58);
862 vallab = get_string ();
864 if (!match_byte(1) && !match_byte(2))
865 match_byte_assert (3);
866 value = get_string ();
867 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
868 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
874 else if (match_byte (1))
879 dump_title_value_31(level);
881 value = get_double ();
882 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
891 dump_title_value_31(level);
893 char *base = get_string();
895 printf ("\"%s\" with %d variables:\n", base, x);
896 for (int i = 0; i < x; i++)
903 for (int j = 0; j <= level; j++)
905 printf("variable %d has %d values:\n", i, y);
906 for (int j = 0; j < y; j++)
911 char *a = get_string();
912 match_byte_assert(0x58);
913 char *b = get_string();
914 char *c = get_string();
915 for (int k = 0; k <= level + 1; k++)
917 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
920 dump_title_value (level+1);
928 dump_footnote_value(int level)
930 for (int i = 0; i <= level; i++)
940 if (match_byte (0x31))
944 printf("(footnote %d) ", get_u32());
945 match_byte_assert (0);
946 match_byte_assert (0);
947 int subn = get_u32 ();
948 printf ("nested %d bytes", subn);
951 else if (match_u32 (2))
953 printf("(special 2)");
954 match_byte_assert(0);
955 match_byte_assert(0);
957 match_byte_assert(0);
958 match_byte_assert(0);
959 int subn = get_u32 ();
960 printf ("nested %d bytes", subn);
966 printf("(special 3)");
967 match_byte_assert(0);
968 match_byte_assert(0);
969 match_byte_assert(1);
970 match_byte_assert(0);
971 int subn = get_u32 ();
972 printf ("nested %d bytes, ", subn);
975 printf ("nested %d bytes, ", subn);
980 match_byte_assert (0x58);
982 printf("string \"%s\"", get_string());
984 match_byte_assert (1);
986 else if (match_byte (5))
988 match_byte_assert (0x58);
989 printf ("variable \"%s\"", get_string());
991 if (!match_byte(1) && !match_byte(2))
992 match_byte_assert(3);
994 else if (match_byte (2))
1000 match_byte_assert (0x58);
1001 format = get_u32 ();
1002 value = get_double ();
1003 var = get_string ();
1004 vallab = get_string ();
1005 printf ("value %g format %d(%d.%d) var \"%s\" vallab \"%s\"",
1006 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
1007 if (!match_byte (1) && !match_byte(2))
1008 match_byte_assert (3);
1017 else if (match_byte (4))
1019 unsigned int format;
1020 char *var, *vallab, *value;
1022 match_byte_assert (0x58);
1023 format = get_u32 ();
1024 vallab = get_string ();
1025 var = get_string ();
1026 if (!match_byte(1) && !match_byte(2))
1027 match_byte_assert (3);
1028 value = get_string ();
1029 printf ("value \"%s\" format %d(%d.%d) var \"%s\" vallab \"%s\"",
1030 value, format >> 16, (format >> 8) & 0xff, format & 0xff, var, vallab);
1036 else if (match_byte (1))
1038 unsigned int format;
1041 if (match_byte (0x31))
1045 printf("(footnote %d) ", get_u32());
1046 match_byte_assert (0);
1047 match_byte_assert (0);
1048 int subn = get_u32 ();
1049 printf ("nested %d bytes", subn);
1054 match_byte_assert (0x58);
1055 format = get_u32 ();
1056 value = get_double ();
1057 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
1059 else if (match_byte (0x31))
1063 printf("(footnote %d) ", get_u32());
1064 match_byte_assert (0);
1065 match_byte_assert (0);
1066 int subn = get_u32 ();
1067 printf ("nested %d bytes", subn);
1072 match_u32_assert (0);
1073 match_u32_assert (0);
1074 int subn = get_u32 ();
1075 printf ("nested %d bytes", subn);
1078 char *base = get_string();
1080 printf ("\"%s\"; %d variables:\n", base, x);
1081 for (int i = 0; i < x; i++)
1087 match_u32_assert(0);
1088 for (int j = 0; j <= level; j++)
1090 printf("variable %d has %d values:\n", i, y);
1091 for (int j = 0; j < y; j++)
1095 char *a = get_string();
1096 match_byte_assert(0x58);
1097 char *b = get_string();
1098 char *c = get_string();
1099 for (int k = 0; k <= level + 1; k++)
1101 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
1103 match_byte_assert(0);
1106 dump_footnote_value (level+1);
1114 match_byte_assert (0x58);
1115 char *base = get_string();
1117 printf ("\"%s\" with %d variables:\n", base, x);
1118 for (int i = 0; i < x; i++)
1124 match_u32_assert(0);
1125 for (int j = 0; j <= level; j++)
1127 printf("variable %d has %d values:\n", i, y);
1128 for (int j = 0; j < y; j++)
1132 char *a = get_string();
1133 match_byte_assert(0x58);
1134 char *b = get_string();
1135 char *c = get_string();
1136 for (int k = 0; k <= level + 1; k++)
1138 printf ("\"%s\", \"%s\", \"%s\"", a, b, c);
1139 match_byte_assert(0);
1142 dump_footnote_value (level+1);
1153 dump_title_value(0); putchar('\n');
1154 dump_title_value(0); putchar('\n');
1155 match_byte_assert(0x31);
1156 dump_title_value(0); putchar('\n');
1158 match_byte_assert(0x58);
1159 if (match_byte(0x31))
1161 dump_footnote_value(0); putchar('\n');
1164 match_byte_assert(0x58);
1167 int n_footnotes = get_u32();
1168 if (n_footnotes >= 20)
1170 fprintf(stderr, "%08x: %d footnotes\n", pos - 4, n_footnotes);
1174 printf("------\n%d footnotes\n", n_footnotes);
1175 if (n_footnotes < 20)
1177 for (int i = 0; i < n_footnotes; i++)
1179 printf("footnote %d:\n", i);
1180 dump_footnote_value(0);
1187 unsigned int format;
1190 if (match_byte (0x31))
1194 printf("(footnote %d) ", get_u32());
1195 match_byte_assert (0);
1196 match_byte_assert (0);
1197 int subn = get_u32 ();
1198 printf ("nested %d bytes", subn);
1203 match_byte_assert (0x58);
1204 format = get_u32 ();
1205 value = get_double ();
1206 printf ("value %g format %d(%d.%d)", value, format >> 16, (format >> 8) & 0xff, format & 0xff);
1213 else if (match_byte (0x31))
1215 match_byte_assert(3);
1217 match_byte_assert(0x58);
1218 match_u32_assert(0);
1223 match_byte_assert (0x58);
1224 printf("(%d)\n", get_u32());
1230 find_dimensions(void)
1233 const char dimensions[] = "-,,,.\0";
1234 int x = try_find_tail(dimensions, sizeof dimensions - 1);
1239 const char dimensions[] = "-,,, .\0";
1240 return find_tail(dimensions, sizeof dimensions - 1);
1246 printf("fonts: offset=%08x\n", pos);
1248 for (int i = 1; i <= 8; i++)
1250 printf("%08x: font %d, ", pos, i);
1251 match_byte_assert(i);
1252 match_byte_assert(0x31);
1253 printf("%s, ", get_string());
1254 match_byte_assert(0);
1255 match_byte_assert(0);
1256 if (!match_byte(0x40) && !match_byte(0x20) && !match_byte(0x80) && !match_byte(0x10))
1257 match_byte_assert(0x50);
1258 if (!match_byte(0x41))
1259 match_byte_assert(0x51);
1261 printf ("%s, ", get_string());
1262 printf ("%s, ", get_string());
1263 match_u32_assert(0);
1264 match_u32_assert(0);
1273 match_u32_assert(240);
1276 match_u32_assert(18);
1283 match_u32_assert(142);
1287 int count = get_u32();
1290 char *encoding = get_string();
1291 printf("encoding=%s\n", encoding);
1294 match_u32_assert(UINT32_MAX);
1296 match_byte_assert(1);
1297 match_byte_assert(0);
1299 match_byte_assert(1);
1300 if (!match_byte(0x99) && !match_byte(0x98))
1301 match_byte_assert(0x97);
1302 match_byte_assert(7);
1303 match_byte_assert(0);
1304 match_byte_assert(0);
1305 if (match_byte('.'))
1306 match_byte_assert(',');
1309 match_byte_assert(',');
1310 if (!match_byte('.'))
1311 match_byte_assert(' ');
1313 match_u32_assert(5);
1314 for (int i = 0; i < 5; i++)
1317 if (pos != find_dimensions())
1318 fprintf (stderr, "%08x / %08x\n", pos, find_dimensions());
1322 main(int argc, char *argv[])
1327 if (isatty(STDIN_FILENO))
1329 fprintf(stderr, "redirect stdin from a .bin file\n");
1332 if (fstat(STDIN_FILENO, &s))
1344 if (read(STDIN_FILENO, data, n) != n)
1352 if (!strcmp(argv[1], "title0"))
1355 if (match_byte (0x03)
1356 || (match_byte (0x05) && match_byte (0x58)))
1357 printf ("%s\n", get_string());
1359 printf ("<unknown>\n");
1362 else if (!strcmp(argv[1], "title"))
1367 else if (!strcmp(argv[1], "titleraw"))
1369 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1371 n = find(fonts, sizeof fonts - 1);
1373 else if (!strcmp(argv[1], "fonts"))
1375 const char fonts[] = "\x01\x31\x09\0\0\0SansSerif";
1376 const char styles[] = "\xf0\0\0\0";
1377 start = find(fonts, sizeof fonts - 1);
1378 n = find(styles, sizeof styles - 1);
1380 else if (!strcmp(argv[1], "styles"))
1382 const char styles[] = "\xf0\0\0\0";
1383 const char dimensions[] = "-,,,.\0";
1384 start = find(styles, sizeof styles - 1);
1385 n = find(dimensions, sizeof dimensions - 1) + sizeof dimensions - 1;
1387 else if (!strcmp(argv[1], "dimensions") || !strcmp(argv[1], "all"))
1390 match_byte_assert(1);
1391 match_byte_assert(0);
1392 match_u32_assert(3);
1393 match_byte_assert(1);
1395 match_byte_assert(1);
1396 match_byte_assert(0);
1397 match_byte_assert(0);
1399 match_byte_assert(1);
1401 match_byte_assert(0);
1402 match_byte_assert(0);
1403 match_byte_assert(0);
1407 printf("\n\ndata:\n");
1410 match_byte_assert (1);
1413 fprintf (stderr, "%x / %x\n", pos, n);
1420 fprintf (stderr, "unknown section %s\n", argv[1]);
1427 for (size_t i = start; i < n; )
1434 && i + 4 + data[i] + data[i + 1] * 256 <= n
1435 && all_ascii(&data[i + 4], data[i] + data[i + 1] * 256))
1437 fputs("\n\"", stdout);
1438 fwrite(&data[i + 4], 1, data[i] + data[i + 1] * 256, stdout);
1439 fputs("\" ", stdout);
1441 i += 4 + data[i] + data[i + 1] * 256;
1443 else if (i + 12 <= n
1444 && data[i + 1] == 40
1446 && data[i + 3] == 0)
1450 memcpy (&d, &data[i + 4], 8);
1451 printf ("F40.%d(%.*f)\n", data[i], data[i], d);
1454 else if (i + 12 <= n
1455 && data[i + 1] == 40
1456 && data[i + 2] == 31
1457 && data[i + 3] == 0)
1461 memcpy (&d, &data[i + 4], 8);
1462 printf ("PCT40.%d(%.*f)\n", data[i], data[i], d);
1466 && (data[i] && data[i] != 88 && data[i] != 0x41)
1471 printf ("i%d ", data[i]);
1476 printf("%02x ", data[i]);