summaryrefslogtreecommitdiffstats
path: root/master/tools.patch
blob: b618df55b8d3c64b2aed8d63ed44ccfc47abb5b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/tools/to_h.c b/tools/to_h.c
new file mode 100644
index 0000000..915437c
--- /dev/null
+++ b/tools/to_h.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+
+int
+main (int argc, char *argv)
+{
+  unsigned i, n;
+  unsigned char c;
+  int fd;
+
+  fd = open ("DEBUGOUTPUT", 0);
+
+
+  while (read (fd, &c, 1) == 1)
+    {
+      n = c;
+      printf ("    0x%02x, ", c);
+
+      for (i = 1; i < n; ++i)
+        {
+          if (!(i % 16))
+            {
+              printf ("\n");
+              printf ("        ");
+            }
+          read (fd, &c, 1);
+          printf ("0x%02x, ", c);
+        }
+      printf ("\n");
+    }
+}