logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: d20cc967c695e15d55cc4cfd197b00003f096e0e
parent 7ece8e7ec02bc251c7a297771cdd3538bfc24fcb
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  2 Jun 2021 09:54:53 +0200

bin/xcd: Put colors in the plain-text area as well

Diffstat:

Mbin/xcd.c78++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
Atest-bin/xcd.fixture19+++++++++++++++++++
Mtest-bin/xcd.t122+++----------------------------------------------------------------------------
3 files changed, 77 insertions(+), 142 deletions(-)

diff --git a/bin/xcd.c b/bin/xcd.c @@ -10,26 +10,58 @@ #include <string.h> /* memset() */ #define LANODAN_XCD_RESET printf(""); -#define LANODAN_XCD_PRINT printf(" >%s<", line); -void -rainbow(double freq, unsigned char i) +struct rgb +{ + uint8_t red, green, blue; +}; + +struct rgb +rgb_char(unsigned char i) { + double freq = 0.018; + if(i == 0) { - printf(""); + return (struct rgb){64, 64, 64}; } else { - uint8_t red, green, blue; + struct rgb color; double pi = 3.14159; - red = sin(freq * i + 0 * pi / 3) * 127 + 128; - green = sin(freq * i + 2 * pi / 3) * 127 + 128; - blue = sin(freq * i + 4 * pi / 3) * 127 + 128; + color.red = sin(freq * i + 0 * pi / 3) * 127 + 128; + color.green = sin(freq * i + 2 * pi / 3) * 127 + 128; + color.blue = sin(freq * i + 4 * pi / 3) * 127 + 128; + + return color; + } +} + +void +print_hex_rgb(unsigned char c) +{ + struct rgb color = rgb_char(c); + printf("[38;2;%d;%d;%dm%02hhx ", color.red, color.green, color.blue, c); +} + +void +print_plain_rgb(unsigned char *line, size_t len) +{ + unsigned char c; - printf("[38;2;%02d;%02d;%02dm", red, green, blue); + LANODAN_XCD_RESET + printf(" >"); + + for(size_t i = 0; i < len; i++) + { + c = line[i]; + struct rgb color = rgb_char(c); + printf("[38;2;%d;%d;%dm%c", color.red, color.green, color.blue, isprint(c) ? c : '.'); } + + LANODAN_XCD_RESET + printf("<"); } int @@ -37,34 +69,32 @@ main(void) { int cols = 0; int line_width = 16; - double freq = 0.018; char line[line_width]; unsigned char c; unsigned int bytes = 0; + struct rgb pos_rgb; memset(&line, 0, line_width); LANODAN_XCD_RESET - rainbow(freq, bytes); - printf("%06x ", bytes); + pos_rgb = rgb_char(bytes); + printf("[38;2;%d;%d;%dm%06x ", pos_rgb.red, pos_rgb.green, pos_rgb.blue, bytes); while(fread(&c, 1, 1, stdin) > 0) { if(cols >= line_width) { - cols = 0; - - LANODAN_XCD_RESET - LANODAN_XCD_PRINT + print_plain_rgb(&line, (size_t)cols); memset(&line, 0, line_width); - rainbow(freq, bytes); - printf("\n%06x ", bytes); + pos_rgb = rgb_char(bytes); + printf("\n[38;2;%d;%d;%dm%06x ", pos_rgb.red, pos_rgb.green, pos_rgb.blue, bytes); + + cols = 0; } - rainbow(freq, c); - printf("%02hhx ", c); - line[cols] = isprint(c) ? c : '.'; + print_hex_rgb(c); + line[cols] = c; cols++; bytes++; @@ -75,10 +105,10 @@ main(void) printf(" "); LANODAN_XCD_RESET - LANODAN_XCD_PRINT + print_plain_rgb(&line, (size_t)cols); - rainbow(freq, bytes); - printf("\n%06x\n", bytes); + pos_rgb = rgb_char(bytes); + printf("\n[38;2;%d;%d;%dm%06x\n", pos_rgb.red, pos_rgb.green, pos_rgb.blue, bytes); LANODAN_XCD_RESET return 0; diff --git a/test-bin/xcd.fixture b/test-bin/xcd.fixture @@ -0,0 +1,18 @@ +000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f  >................< +000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f  >................< +000020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f  > !"#$%&'()*+,-./< +000030 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f  >0123456789:;<=>?< +000040 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f  >@ABCDEFGHIJKLMNO< +000050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f  >PQRSTUVWXYZ[\]^_< +000060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f  >`abcdefghijklmno< +000070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f  >pqrstuvwxyz{|}~.< +000080 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f  >................< +000090 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f  >................< +0000a0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af  >................< +0000b0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf  >................< +0000c0 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf  >................< +0000d0 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df  >................< +0000e0 e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef  >................< +0000f0 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff  >................< +000100 ++ \ No newline at end of file diff --git a/test-bin/xcd.t b/test-bin/xcd.t @@ -10,127 +10,13 @@ q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj EOF ) | ../bin/xcd > xcd.out || exit 1 -# Original xcd.out output -( -base64 -d <<EOF -G1swbRtbNDg7MjswOzA7MG0bWzM4OzI7NjQ7NjQ7NjRtMDAwMDAwIBtbMzg7Mjs2NDs2NDs2NG0w -MCAbWzM4OzI7MTMwOzIzNjsxNm0wMSAbWzM4OzI7MTMyOzIzNTsxNW0wMiAbWzM4OzI7MTM0OzIz -NDsxNG0wMyAbWzM4OzI7MTM3OzIzMzsxM20wNCAbWzM4OzI7MTM5OzIzMTsxMm0wNSAbWzM4OzI7 -MTQxOzIzMDsxMW0wNiAbWzM4OzI7MTQzOzIyOTs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g -G1szODsyOzIyOzExOTsyNDFtZTUgG1szODsyOzIxOzEyMTsyNDBtZTYgG1szODsyOzIwOzEyNDsy -MzltZTcgG1szODsyOzE4OzEyNjsyMzhtZTggG1szODsyOzE3OzEyODsyMzdtZTkgG1szODsyOzE2 -OzEzMDsyMzZtZWEgG1szODsyOzE1OzEzMzsyMzVtZWIgG1szODsyOzE0OzEzNTsyMzRtZWMgG1sz -ODsyOzEzOzEzNzsyMzJtZWQgG1szODsyOzEyOzE0MDsyMzFtZWUgG1szODsyOzExOzE0MjsyMzBt -ZWYgG1swbRtbNDg7MjswOzA7MG0gPi4uLi4uLi4uLi4uLi4uLi48G1szODsyOzEwOzE0NDsyMjht -CjAwMDBmMCAbWzM4OzI7MTA7MTQ0OzIyOG1mMCAbWzM4OzI7MDk7MTQ2OzIyN21mMSAbWzM4OzI7 -MDg7MTQ5OzIyNW1mMiAbWzM4OzI7MDg7MTUxOzIyNG1mMyAbWzM4OzI7MDc7MTUzOzIyMm1mNCAb -WzM4OzI7MDY7MTU1OzIyMW1mNSAbWzM4OzI7MDY7MTU4OzIxOW1mNiAbWzM4OzI7MDU7MTYwOzIx -OG1mNyAbWzM4OzI7MDQ7MTYyOzIxNm1mOCAbWzM4OzI7MDQ7MTY0OzIxNG1mOSAbWzM4OzI7MDM7 -MTY2OzIxM21mYSAbWzM4OzI7MDM7MTY5OzIxMW1mYiAbWzM4OzI7MDI7MTcxOzIwOW1mYyAbWzM4 -OzI7MDI7MTczOzIwOG1mZCAbWzM4OzI7MDI7MTc1OzIwNm1mZSAbWzM4OzI7MDE7MTc3OzIwNG1m -ZiAbWzBtG1s0ODsyOzA7MDswbSA+Li4uLi4uLi4uLi4uLi4uLjwbWzM4OzI7NjQ7NjQ7NjRtCjAw -MDEwMAobWzBtG1s0ODsyOzA7MDswbQ== -EOF -) | diff - xcd.out +diff xcd.fixture xcd.out if [[ $? -eq 0 ]] then + echo "OK: xcd" rm xcd.out else - echo "Test failed!" + echo "" + echo "FAILED: xcd" fi