summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko2009-04-21 11:09:40 +0000
committerDenis Vlasenko2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /libbb
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 'libbb')
-rw-r--r--libbb/appletlib.c16
-rw-r--r--libbb/lineedit.c14
-rw-r--r--libbb/mtab_file.c2
-rw-r--r--libbb/procps.c2
-rw-r--r--libbb/read.c4
-rw-r--r--libbb/xconnect.c10
-rw-r--r--libbb/xfuncs_printf.c2
7 files changed, 25 insertions, 25 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 80380ae..8f3729f 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -55,8 +55,8 @@ static const char usage_messages[] ALIGN1 = ""
#ifdef SINGLE_APPLET_MAIN
#undef ENABLE_FEATURE_INDIVIDUAL
#define ENABLE_FEATURE_INDIVIDUAL 1
-#undef USE_FEATURE_INDIVIDUAL
-#define USE_FEATURE_INDIVIDUAL(...) __VA_ARGS__
+#undef IF_FEATURE_INDIVIDUAL
+#define IF_FEATURE_INDIVIDUAL(...) __VA_ARGS__
#endif
@@ -179,10 +179,10 @@ int FAST_FUNC find_applet_by_name(const char *name)
void lbb_prepare(const char *applet
- USE_FEATURE_INDIVIDUAL(, char **argv))
+ IF_FEATURE_INDIVIDUAL(, char **argv))
MAIN_EXTERNALLY_VISIBLE;
void lbb_prepare(const char *applet
- USE_FEATURE_INDIVIDUAL(, char **argv))
+ IF_FEATURE_INDIVIDUAL(, char **argv))
{
#ifdef __GLIBC__
(*(int **)&bb_errno) = __errno_location();
@@ -224,7 +224,7 @@ bool re_execed;
/* If not built as a single-applet executable... */
#if !defined(SINGLE_APPLET_MAIN)
-USE_FEATURE_SUID(static uid_t ruid;) /* real uid */
+IF_FEATURE_SUID(static uid_t ruid;) /* real uid */
#if ENABLE_FEATURE_SUID_CONFIG
@@ -500,7 +500,7 @@ static void parse_config_file(void)
#else
static inline void parse_config_file(void)
{
- USE_FEATURE_SUID(ruid = getuid();)
+ IF_FEATURE_SUID(ruid = getuid();)
}
#endif /* FEATURE_SUID_CONFIG */
@@ -754,10 +754,10 @@ int main(int argc UNUSED_PARAM, char **argv)
#if defined(SINGLE_APPLET_MAIN)
/* Only one applet is selected by the user! */
/* applet_names in this case is just "applet\0\0" */
- lbb_prepare(applet_names USE_FEATURE_INDIVIDUAL(, argv));
+ lbb_prepare(applet_names IF_FEATURE_INDIVIDUAL(, argv));
return SINGLE_APPLET_MAIN(argc, argv);
#else
- lbb_prepare("busybox" USE_FEATURE_INDIVIDUAL(, argv));
+ lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
#if !BB_MMU
/* NOMMU re-exec trick sets high-order bit in first byte of name */
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 7bcdb95..e0ab732 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -62,10 +62,10 @@
#define ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR \
(ENABLE_FEATURE_USERNAME_COMPLETION || ENABLE_FEATURE_EDITING_FANCY_PROMPT)
-#define USE_FEATURE_GETUSERNAME_AND_HOMEDIR(...)
+#define IF_FEATURE_GETUSERNAME_AND_HOMEDIR(...)
#if ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR
-#undef USE_FEATURE_GETUSERNAME_AND_HOMEDIR
-#define USE_FEATURE_GETUSERNAME_AND_HOMEDIR(...) __VA_ARGS__
+#undef IF_FEATURE_GETUSERNAME_AND_HOMEDIR
+#define IF_FEATURE_GETUSERNAME_AND_HOMEDIR(...) __VA_ARGS__
#endif
enum {
@@ -152,8 +152,8 @@ extern struct lineedit_statics *const lineedit_ptr_to_statics;
(*(struct lineedit_statics**)&lineedit_ptr_to_statics) = xzalloc(sizeof(S)); \
barrier(); \
cmdedit_termw = 80; \
- USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines = 1;) \
- USE_FEATURE_GETUSERNAME_AND_HOMEDIR(home_pwd_buf = (char*)null_str;) \
+ IF_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines = 1;) \
+ IF_FEATURE_GETUSERNAME_AND_HOMEDIR(home_pwd_buf = (char*)null_str;) \
} while (0)
static void deinit_S(void)
{
@@ -1160,7 +1160,7 @@ static void remember_in_history(char *str)
if ((state->flags & SAVE_HISTORY) && state->hist_file)
save_history(str);
#endif
- USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;)
+ IF_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;)
}
#else /* MAX_HISTORY == 0 */
@@ -1442,7 +1442,7 @@ static void win_changed(int nsig)
/* leave out the "vi-mode"-only case labels if vi editing isn't
* configured. */
-#define vi_case(caselabel) USE_FEATURE_EDITING(case caselabel)
+#define vi_case(caselabel) IF_FEATURE_EDITING(case caselabel)
/* convert uppercase ascii to equivalent control char, for readability */
#undef CTRL
diff --git a/libbb/mtab_file.c b/libbb/mtab_file.c
index 030b148..c9d9a69 100644
--- a/libbb/mtab_file.c
+++ b/libbb/mtab_file.c
@@ -12,4 +12,4 @@
/* Busybox mount uses either /proc/mounts or /etc/mtab to
* get the list of currently mounted filesystems */
const char bb_path_mtab_file[] ALIGN1 =
-USE_FEATURE_MTAB_SUPPORT("/etc/mtab")SKIP_FEATURE_MTAB_SUPPORT("/proc/mounts");
+IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts");
diff --git a/libbb/procps.c b/libbb/procps.c
index c5e40bf..445e709 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -111,7 +111,7 @@ void FAST_FUNC free_procps_scan(procps_status_t* sp)
{
closedir(sp->dir);
free(sp->argv0);
- USE_SELINUX(free(sp->context);)
+ IF_SELINUX(free(sp->context);)
free(sp);
}
diff --git a/libbb/read.c b/libbb/read.c
index 37503e8..a0c0cc6 100644
--- a/libbb/read.c
+++ b/libbb/read.c
@@ -315,7 +315,7 @@ int FAST_FUNC open_zipped(const char *fname)
char *sfx;
int fd;
#if BB_MMU
- USE_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd);
+ IF_DESKTOP(long long) int FAST_FUNC (*xformer)(int src_fd, int dst_fd);
enum { xformer_prog = 0 };
#else
enum { xformer = 0 };
@@ -352,7 +352,7 @@ int FAST_FUNC open_zipped(const char *fname)
|| magic[0] != 'B' || magic[1] != 'Z'
) {
bb_error_msg_and_die("no gzip"
- USE_FEATURE_SEAMLESS_BZ2("/bzip2")
+ IF_FEATURE_SEAMLESS_BZ2("/bzip2")
" magic");
}
#if BB_MMU
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index f5d7983..1b4f4f7 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -151,7 +151,7 @@ void FAST_FUNC set_nport(len_and_sockaddr *lsa, unsigned port)
* port: if neither of above specifies port # */
static len_and_sockaddr* str2sockaddr(
const char *host, int port,
-USE_FEATURE_IPV6(sa_family_t af,)
+IF_FEATURE_IPV6(sa_family_t af,)
int ai_flags)
{
int rc;
@@ -269,9 +269,9 @@ len_and_sockaddr* FAST_FUNC xdotted2sockaddr(const char *host, int port)
}
#undef xsocket_type
-int FAST_FUNC xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,) int sock_type)
+int FAST_FUNC xsocket_type(len_and_sockaddr **lsap, IF_FEATURE_IPV6(int family,) int sock_type)
{
- SKIP_FEATURE_IPV6(enum { family = AF_INET };)
+ IF_NOT_FEATURE_IPV6(enum { family = AF_INET };)
len_and_sockaddr *lsa;
int fd;
int len;
@@ -303,7 +303,7 @@ int FAST_FUNC xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int family,
int FAST_FUNC xsocket_stream(len_and_sockaddr **lsap)
{
- return xsocket_type(lsap, USE_FEATURE_IPV6(AF_UNSPEC,) SOCK_STREAM);
+ return xsocket_type(lsap, IF_FEATURE_IPV6(AF_UNSPEC,) SOCK_STREAM);
}
static int create_and_bind_or_die(const char *bindaddr, int port, int sock_type)
@@ -316,7 +316,7 @@ static int create_and_bind_or_die(const char *bindaddr, int port, int sock_type)
/* user specified bind addr dictates family */
fd = xsocket(lsa->u.sa.sa_family, sock_type, 0);
} else {
- fd = xsocket_type(&lsa, USE_FEATURE_IPV6(AF_UNSPEC,) sock_type);
+ fd = xsocket_type(&lsa, IF_FEATURE_IPV6(AF_UNSPEC,) sock_type);
set_nport(lsa, htons(port));
}
setsockopt_reuseaddr(fd);
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 6d0fa6e..5f56b36 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -420,7 +420,7 @@ int FAST_FUNC xsocket(int domain, int type, int protocol)
const char *s = "INET";
if (domain == AF_PACKET) s = "PACKET";
if (domain == AF_NETLINK) s = "NETLINK";
-USE_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
+IF_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
bb_perror_msg_and_die("socket(AF_%s)", s);
#else
bb_perror_msg_and_die("socket");