| 3373 | } |
| 3374 | |
| 3375 | static void hex_dump_internal(void *avcl, FILE *f, int level, uint8_t *buf, int size) |
| 3376 | { |
| 3377 | int len, i, j, c; |
| 3378 | #undef fprintf |
| 3379 | #define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
| 3380 | |
| 3381 | for(i=0;i<size;i+=16) { |
| 3382 | len = size - i; |
| 3383 | if (len > 16) |
| 3384 | len = 16; |
| 3385 | PRINT("%08x ", i); |
| 3386 | for(j=0;j<16;j++) { |
| 3387 | if (j < len) |
| 3388 | PRINT(" %02x", buf[i+j]); |
| 3389 | else |
| 3390 | PRINT(" "); |
| 3391 | } |
| 3392 | PRINT(" "); |
| 3393 | for(j=0;j<len;j++) { |
| 3394 | c = buf[i+j]; |
| 3395 | if (c < ' ' || c > '~') |
| 3396 | c = '.'; |
| 3397 | PRINT("%c", c); |
| 3398 | } |
| 3399 | PRINT("\n"); |
| 3400 | } |
| 3401 | #undef PRINT |
| 3402 | } |
| 3403 | |
| 3404 | void av_hex_dump(FILE *f, uint8_t *buf, int size) |
| 3405 | { |
no outgoing calls
no test coverage detected