| 16 | |
| 17 | #if defined(LTC_TEST) && defined(LTC_TEST_DBG) |
| 18 | static void _print_hex(const char* what, const void* v, const unsigned long l) |
| 19 | { |
| 20 | const unsigned char* p = v; |
| 21 | unsigned long x, y = 0, z; |
| 22 | fprintf(stderr, "%s contents: \n", what); |
| 23 | for (x = 0; x < l; ) { |
| 24 | fprintf(stderr, "%02X ", p[x]); |
| 25 | if (!(++x % 16) || x == l) { |
| 26 | if((x % 16) != 0) { |
| 27 | z = 16 - (x % 16); |
| 28 | if(z >= 8) |
| 29 | fprintf(stderr, " "); |
| 30 | for (; z != 0; --z) { |
| 31 | fprintf(stderr, " "); |
| 32 | } |
| 33 | } |
| 34 | fprintf(stderr, " | "); |
| 35 | for(; y < x; y++) { |
| 36 | if((y % 8) == 0) |
| 37 | fprintf(stderr, " "); |
| 38 | if(isgraph(p[y])) |
| 39 | fprintf(stderr, "%c", p[y]); |
| 40 | else |
| 41 | fprintf(stderr, "."); |
| 42 | } |
| 43 | fprintf(stderr, "\n"); |
| 44 | } |
| 45 | else if((x % 8) == 0) { |
| 46 | fprintf(stderr, " "); |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | /** |
no outgoing calls
no test coverage detected