From 29358591f48f23e0a71c52dc13c9c1f453235ca4 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 12 Sep 2016 15:02:22 -0400 Subject: Add -g option to xx --- .bin/xx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to '.bin/xx.c') diff --git a/.bin/xx.c b/.bin/xx.c index 153ba74e..3aac12f6 100755 --- a/.bin/xx.c +++ b/.bin/xx.c @@ -10,12 +10,15 @@ exec cc -Weverything -Wno-vla -o ~/.bin/xx $0 int main(int argc, char **argv) { size_t cols = 16; + size_t group = 8; char *path = NULL; - while (getopt(argc, argv, "c:") > 0) + while (getopt(argc, argv, "c:g:") > 0) if (optopt == 'c') { cols = (size_t) strtol(optarg, NULL, 10); if (!cols) return EXIT_FAILURE; + } else if (optopt == 'g') { + group = (size_t) strtol(optarg, NULL, 10); } else return EXIT_FAILURE; if (argc > optind) path = argv[optind]; @@ -29,8 +32,12 @@ int main(int argc, char **argv) uint8_t buf[cols]; for (;;) { size_t n = fread(buf, 1, sizeof(buf), file); - for (size_t i = 0; i < n; ++i) + + for (size_t i = 0; i < n; ++i) { + if (group && i && !(i % group)) printf(" "); printf("%02x ", buf[i]); + } + printf("\n"); if (n < sizeof(buf)) break; } -- cgit 1.4.1 ow=1'>commit diff
path: root/bin/freecell.c (unfollow)
Commit message (Collapse)Author
28 hoursCope with not having an EXIF infoJune McEnroe
28 hoursResize using target pixel counts for consistencyJune McEnroe
This will resize film scans to about the same size as for the digital photos.
31 hoursAdd The Girl Who Was Convinced...June McEnroe
Not much there. The illustrations are very nice though.
2 daysAdd photos from May 31June McEnroe
2 daysUse monospace on photo pagesJune McEnroe
2 daysPut lens and (future) film at the tops of photo pagesJune McEnroe
2024-05-22Remove use of sysexits.hJune McEnroe
2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe
2024-05-21Fix = precedence in whenJune McEnroe