Mercurial > hg > toybox
comparison toys/posix/sed.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 | 6df4ccc0acbe |
children | 786841fdb1e0 |
comparison
equal
deleted
inserted
replaced
673:c102f31a753e | 674:7e846e281e38 |
---|---|
16 | 16 |
17 Stream EDitor, transforms text by appling commands to each line | 17 Stream EDitor, transforms text by appling commands to each line |
18 of input. | 18 of input. |
19 */ | 19 */ |
20 | 20 |
21 #define FOR_sed | |
21 #include "toys.h" | 22 #include "toys.h" |
22 #include "lib/xregcomp.h" | 23 #include "lib/xregcomp.h" |
23 | 24 |
24 DEFINE_GLOBALS( | 25 GLOBALS( |
25 struct arg_list *commands; | 26 struct arg_list *commands; |
26 ) | 27 ) |
27 | |
28 #define TT this.sed | |
29 | 28 |
30 struct sed_command { | 29 struct sed_command { |
31 // Doubly linked list of commands. | 30 // Doubly linked list of commands. |
32 struct sed_command *next, *prev; | 31 struct sed_command *next, *prev; |
33 | 32 |