Mercurial > hg > toybox
comparison toys/other/modinfo.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 | 2986aa63a021 |
children | 786841fdb1e0 |
comparison
equal
deleted
inserted
replaced
673:c102f31a753e | 674:7e846e281e38 |
---|---|
12 default y | 12 default y |
13 help | 13 help |
14 usage: modinfo [-0] [-F field] [modulename...] | 14 usage: modinfo [-0] [-F field] [modulename...] |
15 */ | 15 */ |
16 | 16 |
17 #define FOR_modinfo | |
17 #include "toys.h" | 18 #include "toys.h" |
18 | 19 |
19 #define FLAG_0 (1 << 0) | 20 GLOBALS( |
20 | |
21 DEFINE_GLOBALS( | |
22 char *field; | 21 char *field; |
23 ) | 22 ) |
24 #define TT this.modinfo | |
25 | 23 |
26 static const char *modinfo_tags[] = { | 24 static const char *modinfo_tags[] = { |
27 "alias", "license", "description", "author", "vermagic", | 25 "alias", "license", "description", "author", "vermagic", |
28 "srcversion", "intree", "parm", "depends", | 26 "srcversion", "intree", "parm", "depends", |
29 }; | 27 }; |