*: 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!
This commit is contained in:
Denis Vlasenko
2009-04-21 11:09:40 +00:00
parent 8b814b4a34
commit 5e34ff29bc
102 changed files with 1312 additions and 1308 deletions

View File

@@ -10,10 +10,10 @@
#include "libbb.h"
enum {
USE_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,)
USE_FEATURE_PIDOF_OMIT( OPTBIT_OMIT ,)
OPT_SINGLE = USE_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0,
OPT_OMIT = USE_FEATURE_PIDOF_OMIT( (1<<OPTBIT_OMIT )) + 0,
IF_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,)
IF_FEATURE_PIDOF_OMIT( OPTBIT_OMIT ,)
OPT_SINGLE = IF_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0,
OPT_OMIT = IF_FEATURE_PIDOF_OMIT( (1<<OPTBIT_OMIT )) + 0,
};
int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -28,8 +28,8 @@ int pidof_main(int argc UNUSED_PARAM, char **argv)
/* do unconditional option parsing */
opt = getopt32(argv, ""
USE_FEATURE_PIDOF_SINGLE ("s")
USE_FEATURE_PIDOF_OMIT("o:", &omits));
IF_FEATURE_PIDOF_SINGLE ("s")
IF_FEATURE_PIDOF_OMIT("o:", &omits));
#if ENABLE_FEATURE_PIDOF_OMIT
/* fill omit list. */

View File

@@ -25,9 +25,9 @@ enum { MAX_WIDTH = 2*1024 };
#if ENABLE_SELINUX
#define SELINUX_O_PREFIX "label,"
#define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" USE_FEATURE_PS_TIME(",time") ",args")
#define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args")
#else
#define DEFAULT_O_STR ("pid,user" USE_FEATURE_PS_TIME(",time") ",args")
#define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args")
#endif
typedef struct {
@@ -425,7 +425,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
{
procps_status_t *p;
llist_t* opt_o = NULL;
USE_SELINUX(int opt;)
IF_SELINUX(int opt;)
// POSIX:
// -a Write information for all processes associated with terminals
@@ -439,7 +439,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
// Select which columns to display
/* We allow (and ignore) most of the above. FIXME */
opt_complementary = "o::";
USE_SELINUX(opt =) getopt32(argv, "Zo:aAdefl", &opt_o);
IF_SELINUX(opt =) getopt32(argv, "Zo:aAdefl", &opt_o);
if (opt_o) {
do {
parse_o(llist_pop(&opt_o));
@@ -486,8 +486,8 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
procps_status_t *p = NULL;
int len;
SKIP_SELINUX(const) int use_selinux = 0;
USE_SELINUX(int i;)
IF_NOT_SELINUX(const) int use_selinux = 0;
IF_SELINUX(int i;)
#if !ENABLE_FEATURE_PS_WIDE
enum { terminal_width = 79 };
#else
@@ -498,7 +498,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
#if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX
#if ENABLE_FEATURE_PS_WIDE
opt_complementary = "-:ww";
USE_SELINUX(i =) getopt32(argv, USE_SELINUX("Z") "w", &w_count);
IF_SELINUX(i =) getopt32(argv, IF_SELINUX("Z") "w", &w_count);
/* if w is given once, GNU ps sets the width to 132,
* if w is given more than once, it is "unlimited"
*/

View File

@@ -889,7 +889,7 @@ int top_main(int argc UNUSED_PARAM, char **argv)
int lines_rem;
unsigned interval;
char *str_interval, *str_iterations;
SKIP_FEATURE_TOPMEM(const) unsigned scan_mask = TOP_MASK;
IF_NOT_FEATURE_TOPMEM(const) unsigned scan_mask = TOP_MASK;
#if ENABLE_FEATURE_USE_TERMIOS
struct termios new_settings;
struct pollfd pfd[1];
@@ -1054,11 +1054,11 @@ int top_main(int argc UNUSED_PARAM, char **argv)
if (c == 'q')
break;
if (c == 'n') {
USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
sort_function[0] = pid_sort;
}
if (c == 'm') {
USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
sort_function[0] = mem_sort;
#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
sort_function[1] = pcpu_sort;
@@ -1067,13 +1067,13 @@ int top_main(int argc UNUSED_PARAM, char **argv)
}
#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
if (c == 'p') {
USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
sort_function[0] = pcpu_sort;
sort_function[1] = mem_sort;
sort_function[2] = time_sort;
}
if (c == 't') {
USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;)
sort_function[0] = time_sort;
sort_function[1] = mem_sort;
sort_function[2] = pcpu_sort;