#ifndef DEBUG_H #define DEBUG_H #include #include extern FILE *DUMP; /* Define this variable somewhere (eg with DUMP = stderr). */ static inline void debug_dump_lanes(const char *header, size_t len, const uint8_t buf[len], int indent) { fprintf(DUMP, "%s\n", header); for (size_t line=0; line %zu]", line, b, line*8+b); */ fprintf(DUMP, "%02x ", buf[line*8+b]); } fprintf(DUMP, "\n"); } size_t rest = len%8; if (rest != 0) { fprintf(DUMP, "%*s[0x%02zx] ", indent, "", len-rest); for (size_t b=0; b