Mercurial > hg > toybox
comparison toys/other/catv.c @ 674:7e846e281e38
New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 08 Oct 2012 00:02:30 -0500 |
parents | 0ee40175a307 |
children | 786841fdb1e0 |
comparison
equal
deleted
inserted
replaced
673:c102f31a753e | 674:7e846e281e38 |
---|---|
21 -e Mark each newline with $ | 21 -e Mark each newline with $ |
22 -t Show tabs as ^I | 22 -t Show tabs as ^I |
23 -v Don't use ^x or M-x escapes. | 23 -v Don't use ^x or M-x escapes. |
24 */ | 24 */ |
25 | 25 |
26 #define FOR_catv | |
26 #include "toys.h" | 27 #include "toys.h" |
27 | |
28 #define FLAG_v 4 | |
29 #define FLAG_t 2 | |
30 #define FLAG_e 1 | |
31 | 28 |
32 // Callback function for loopfiles() | 29 // Callback function for loopfiles() |
33 | 30 |
34 static void do_catv(int fd, char *name) | 31 static void do_catv(int fd, char *name) |
35 { | 32 { |