summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenis Vlasenko2009-04-21 11:09:40 +0000
committerDenis Vlasenko2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /miscutils
parent8b814b4a349e2262c0ad25793b05206a14651ebb (diff)
downloadbusybox-5e34ff29bcc870936ab18172f438a34d042d4e03.zip
busybox-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/crond.c6
-rw-r--r--miscutils/eject.c2
-rw-r--r--miscutils/hdparm.c46
-rw-r--r--miscutils/less.c6
4 files changed, 30 insertions, 30 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 804fe0b..f0b64fe 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -162,11 +162,11 @@ int crond_main(int argc UNUSED_PARAM, char **argv)
INIT_G();
/* "-b after -f is ignored", and so on for every pair a-b */
- opt_complementary = "f-b:b-f:S-L:L-S" USE_FEATURE_CROND_D(":d-l")
+ opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l")
":l+:d+"; /* -l and -d have numeric param */
- opt = getopt32(argv, "l:L:fbSc:" USE_FEATURE_CROND_D("d:"),
+ opt = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"),
&LogLevel, &LogFile, &CDir
- USE_FEATURE_CROND_D(,&LogLevel));
+ IF_FEATURE_CROND_D(,&LogLevel));
/* both -d N and -l N set the same variable: LogLevel */
if (!(opt & OPT_f)) {
diff --git a/miscutils/eject.c b/miscutils/eject.c
index ff3976e..94a36c0 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -89,7 +89,7 @@ int eject_main(int argc UNUSED_PARAM, char **argv)
const char *device;
opt_complementary = "?1:t--T:T--t";
- flags = getopt32(argv, "tT" USE_FEATURE_EJECT_SCSI("s"));
+ flags = getopt32(argv, "tT" IF_FEATURE_EJECT_SCSI("s"));
device = argv[optind] ? argv[optind] : "/dev/cdrom";
/* We used to do "umount <device>" here, but it was buggy
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index de5d68a..f963888 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -293,15 +293,15 @@ struct globals {
unsigned long doorlock;
unsigned long apmmode;
#endif
- USE_FEATURE_HDPARM_GET_IDENTITY( smallint get_IDentity;)
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( smallint set_busstate, get_busstate;)
- USE_FEATURE_HDPARM_HDIO_DRIVE_RESET( smallint perform_reset;)
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( smallint perform_tristate;)
- USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(smallint unregister_hwif;)
- USE_FEATURE_HDPARM_HDIO_SCAN_HWIF( smallint scan_hwif;)
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( unsigned long busstate;)
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( unsigned long tristate;)
- USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(unsigned long hwif;)
+ IF_FEATURE_HDPARM_GET_IDENTITY( smallint get_IDentity;)
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( smallint set_busstate, get_busstate;)
+ IF_FEATURE_HDPARM_HDIO_DRIVE_RESET( smallint perform_reset;)
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( smallint perform_tristate;)
+ IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(smallint unregister_hwif;)
+ IF_FEATURE_HDPARM_HDIO_SCAN_HWIF( smallint scan_hwif;)
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( unsigned long busstate;)
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF( unsigned long tristate;)
+ IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(unsigned long hwif;)
#if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF
unsigned long hwif_data;
unsigned long hwif_ctrl;
@@ -1960,12 +1960,12 @@ static void parse_xfermode(int flag, smallint *get, smallint *set, int *value)
/*------- getopt short options --------*/
static const char hdparm_options[] ALIGN1 =
"gfu::n::p:r::m::c::k::a::B:tT"
- USE_FEATURE_HDPARM_GET_IDENTITY("iI")
- USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
+ IF_FEATURE_HDPARM_GET_IDENTITY("iI")
+ IF_FEATURE_HDPARM_HDIO_GETSET_DMA("d::")
#ifdef HDIO_DRIVE_CMD
"S:D:P:X:K:A:L:W:CyYzZ"
#endif
- USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:")
+ IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:")
#ifdef HDIO_GET_QDMA
#ifdef HDIO_SET_QDMA
"Q:"
@@ -1973,9 +1973,9 @@ static const char hdparm_options[] ALIGN1 =
"Q"
#endif
#endif
- USE_FEATURE_HDPARM_HDIO_DRIVE_RESET("w")
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF("x::b:")
- USE_FEATURE_HDPARM_HDIO_SCAN_HWIF("R:");
+ IF_FEATURE_HDPARM_HDIO_DRIVE_RESET("w")
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF("x::b:")
+ IF_FEATURE_HDPARM_HDIO_SCAN_HWIF("R:");
/*-------------------------------------*/
/* our main() routine: */
@@ -1987,12 +1987,12 @@ int hdparm_main(int argc, char **argv)
while ((c = getopt(argc, argv, hdparm_options)) >= 0) {
flagcount++;
- USE_FEATURE_HDPARM_GET_IDENTITY(get_IDentity |= (c == 'I'));
- USE_FEATURE_HDPARM_GET_IDENTITY(get_identity |= (c == 'i'));
+ IF_FEATURE_HDPARM_GET_IDENTITY(get_IDentity |= (c == 'I'));
+ IF_FEATURE_HDPARM_GET_IDENTITY(get_identity |= (c == 'i'));
get_geom |= (c == 'g');
do_flush |= (c == 'f');
if (c == 'u') parse_opts(&get_unmask, &set_unmask, &unmask, 0, 1);
- USE_FEATURE_HDPARM_HDIO_GETSET_DMA(if (c == 'd') parse_opts(&get_dma, &set_dma, &dma, 0, 9));
+ IF_FEATURE_HDPARM_HDIO_GETSET_DMA(if (c == 'd') parse_opts(&get_dma, &set_dma, &dma, 0, 9));
if (c == 'n') parse_opts(&get_nowerr, &set_nowerr, &nowerr, 0, 1);
parse_xfermode((c == 'p'), &noisy_piomode, &set_piomode, &piomode);
if (c == 'r') parse_opts(&get_readonly, &set_readonly, &readonly, 0, 1);
@@ -2018,7 +2018,7 @@ int hdparm_main(int argc, char **argv)
reread_partn |= (c == 'z');
get_seagate = set_seagate |= (c == 'Z');
#endif
- USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(if (c == 'U') parse_opts(NULL, &unregister_hwif, &hwif, 0, INT_MAX));
+ IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(if (c == 'U') parse_opts(NULL, &unregister_hwif, &hwif, 0, INT_MAX));
#ifdef HDIO_GET_QDMA
if (c == 'Q') {
#ifdef HDIO_SET_QDMA
@@ -2028,9 +2028,9 @@ int hdparm_main(int argc, char **argv)
#endif
}
#endif
- USE_FEATURE_HDPARM_HDIO_DRIVE_RESET(perform_reset = (c == 'r'));
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'x') parse_opts(NULL, &perform_tristate, &tristate, 0, 1));
- USE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'b') parse_opts(&get_busstate, &set_busstate, &busstate, 0, 2));
+ IF_FEATURE_HDPARM_HDIO_DRIVE_RESET(perform_reset = (c == 'r'));
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'x') parse_opts(NULL, &perform_tristate, &tristate, 0, 1));
+ IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(if (c == 'b') parse_opts(&get_busstate, &set_busstate, &busstate, 0, 2));
#if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF
if (c == 'R') {
parse_opts(NULL, &scan_hwif, &hwif_data, 0, INT_MAX);
@@ -2045,7 +2045,7 @@ int hdparm_main(int argc, char **argv)
/* When no flags are given (flagcount = 0), -acdgkmnru is assumed. */
if (!flagcount) {
get_mult = get_io32bit = get_unmask = get_keep = get_readonly = get_readahead = get_geom = 1;
- USE_FEATURE_HDPARM_HDIO_GETSET_DMA(get_dma = 1);
+ IF_FEATURE_HDPARM_HDIO_GETSET_DMA(get_dma = 1);
}
argv += optind;
diff --git a/miscutils/less.c b/miscutils/less.c
index 27855bb..702c4a8 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -145,7 +145,7 @@ struct globals {
current_file = 1; \
eof_error = 1; \
terminated = 1; \
- USE_FEATURE_LESS_REGEXP(wanted_match = -1;) \
+ IF_FEATURE_LESS_REGEXP(wanted_match = -1;) \
} while (0)
/* flines[] are lines read from stdin, each in malloc'ed buffer.
@@ -326,7 +326,7 @@ static void read_lines(void)
if (option_mask32 & FLAG_N)
w -= 8;
- USE_FEATURE_LESS_REGEXP(again0:)
+ IF_FEATURE_LESS_REGEXP(again0:)
p = current_line = ((char*)xmalloc(w + 4)) + 4;
max_fline += last_terminated;
@@ -1509,7 +1509,7 @@ int less_main(int argc, char **argv)
/* TODO: -x: do not interpret backspace, -xx: tab also */
/* -xxx: newline also */
/* -w N: assume width N (-xxx -w 32: hex viewer of sorts) */
- getopt32(argv, "EMmN~I" USE_FEATURE_LESS_DASHCMD("S"));
+ getopt32(argv, "EMmN~I" IF_FEATURE_LESS_DASHCMD("S"));
argc -= optind;
argv += optind;
num_files = argc;