]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_head.c
p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
[16.git] / src / lib / 16_head.c
index 20321e284916b85b02863f16a5133ae2240b7d76..5764183bf8dad641d6e9b97d8ecfc3ed7cd53bc7 100755 (executable)
@@ -172,3 +172,20 @@ byte dirchar(byte in)
        }\r
        return out;\r
 }\r
+\r
+//from: http://stackoverflow.com/questions/5349896/print-a-struct-in-c\r
+void print_mem(void const *vp, size_t n)\r
+{\r
+       size_t i;\r
+       unsigned char const *p = vp;\r
+       for (i=0; i<n; i++)\r
+       {\r
+               printf("%02x", p[i]);\r
+               //printf("%c", p[i]);\r
+               if(!((i)%16)) printf("\n");\r
+               else printf(" ");\r
+               //printf("%u%%40=%u\n", i, i%40);\r
+       }\r
+       putchar('\n');\r
+       printf("\nstruct size is %zu bytes\n", n);\r
+};\r