extension++;
if (strcmp(extension, "tgz" + 1) == 0
-#ifdef CONFIG_FEATURE_GUNZIP_UNCOMPRESS
+#if ENABLE_FEATURE_GUNZIP_UNCOMPRESS
|| strcmp(extension, "Z") == 0
#endif
) {
tar_handle->src_fd = ar_handle->src_fd;
/* We don't care about data.tar.* or debian-binary, just control.tar.* */
-#ifdef CONFIG_FEATURE_DEB_TAR_GZ
+#if ENABLE_FEATURE_DEB_TAR_GZ
llist_add_to(&(ar_handle->accept), (char*)"control.tar.gz");
#endif
-#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
+#if ENABLE_FEATURE_DEB_TAR_BZ2
llist_add_to(&(ar_handle->accept), (char*)"control.tar.bz2");
#endif
tar_handle->src_fd = ar_handle->src_fd;
/* We don't care about control.tar.* or debian-binary, just data.tar.* */
-#ifdef CONFIG_FEATURE_DEB_TAR_GZ
+#if ENABLE_FEATURE_DEB_TAR_GZ
llist_add_to(&(ar_handle->accept), (char*)"data.tar.gz");
#endif
-#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
+#if ENABLE_FEATURE_DEB_TAR_BZ2
llist_add_to(&(ar_handle->accept), (char*)"data.tar.bz2");
#endif
ar_archive->sub_archive = tar_archive;
ar_archive->filter = filter_accept_list_reassign;
-#ifdef CONFIG_FEATURE_DEB_TAR_GZ
+#if ENABLE_FEATURE_DEB_TAR_GZ
llist_add_to(&(ar_archive->accept), (char*)"data.tar.gz");
llist_add_to(&control_tar_llist, (char*)"control.tar.gz");
#endif
-#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
+#if ENABLE_FEATURE_DEB_TAR_BZ2
llist_add_to(&(ar_archive->accept), (char*)"data.tar.bz2");
llist_add_to(&control_tar_llist, (char*)"control.tar.bz2");
#endif
#include "libbb.h"
#include "unarchive.h"
-#ifdef CONFIG_FEATURE_LZMA_FAST
+#if ENABLE_FEATURE_LZMA_FAST
# define speed_inline ALWAYS_INLINE
#else
# define speed_inline
}
}
-/* Called 9 times */
+/* rc_is_bit_0 is called 9 times */
/* Why rc_is_bit_0_helper exists?
- * Because we want to always expose (rc->code < rc->bound) to optimizer
+ * Because we want to always expose (rc->code < rc->bound) to optimizer.
+ * Thus rc_is_bit_0 is always inlined, and rc_is_bit_0_helper is inlined
+ * only if we compile for speed.
*/
static speed_inline uint32_t rc_is_bit_0_helper(rc_t * rc, uint16_t * p)
{
name_ptr = strrchr(archive_handle->file_header->name, '.');
/* Modify the subarchive handler based on the extension */
-#ifdef CONFIG_FEATURE_DEB_TAR_GZ
+#if ENABLE_FEATURE_DEB_TAR_GZ
if (strcmp(name_ptr, ".gz") == 0) {
archive_handle->action_data_subarchive = get_header_tar_gz;
return EXIT_SUCCESS;
}
#endif
-#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
+#if ENABLE_FEATURE_DEB_TAR_BZ2
if (strcmp(name_ptr, ".bz2") == 0) {
archive_handle->action_data_subarchive = get_header_tar_bz2;
return EXIT_SUCCESS;
void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount)
{
if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) {
-#ifdef CONFIG_FEATURE_UNARCHIVE_TAPE
+#if ENABLE_FEATURE_UNARCHIVE_TAPE
if (errno == ESPIPE) {
seek_by_read(archive_handle, amount);
} else
#include <sys/vfs.h>
#include "libbb.h"
-#ifndef CONFIG_FEATURE_HUMAN_READABLE
+#if !ENABLE_FEATURE_HUMAN_READABLE
static long kscale(long b, long bs)
{
return ( b * (long long) bs + 1024/2 ) / 1024;
{
long blocks_used;
long blocks_percent_used;
-#ifdef CONFIG_FEATURE_HUMAN_READABLE
+#if ENABLE_FEATURE_HUMAN_READABLE
unsigned long df_disp_hr = 1024;
#endif
int status = EXIT_SUCCESS;
static const char hdr_1k[] ALIGN1 = "1k-blocks";
const char *disp_units_hdr = hdr_1k;
-#ifdef CONFIG_FEATURE_HUMAN_READABLE
+#if ENABLE_FEATURE_HUMAN_READABLE
opt_complementary = "h-km:k-hm:m-hk";
opt = getopt32(argc, argv, "hmk");
if (opt & 1) {
}
}
-#ifdef CONFIG_FEATURE_HUMAN_READABLE
+#if ENABLE_FEATURE_HUMAN_READABLE
printf("%-20s %9s ", device,
make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));
#include "libbb.h"
-#ifdef CONFIG_LOCALE_SUPPORT
+#if ENABLE_LOCALE_SUPPORT
#define isspace_given_isprint(c) isspace(c)
#else
#undef isspace
(in .h header file)
- #ifdef CONFIG_FEATURE_FUNKY
- static inline void maybe_do_funky_stuff (int bar, int baz)
+ #if ENABLE_FEATURE_FUNKY
+ static inline void maybe_do_funky_stuff(int bar, int baz)
{
/* lotsa code in here */
}
#else
- static inline void maybe_do_funky_stuff (int bar, int baz) {}
+ static inline void maybe_do_funky_stuff(int bar, int baz) {}
#endif
(in the .c source file)
/* See docs/keep_data_small.txt */
struct globals;
/* '*const' ptr makes gcc optimize code much better.
- * Magic prevents ptr_to_globals from going into rodata
+ * Magic prevents ptr_to_globals from going into rodata.
* If you want to assign a value, use PTR_TO_GLOBALS = xxx */
extern struct globals *const ptr_to_globals;
#define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals)
#define lsmod_full_usage \
"List the currently loaded kernel modules"
-#ifdef CONFIG_FEATURE_MAKEDEVS_LEAF
+#if ENABLE_FEATURE_MAKEDEVS_LEAF
#define makedevs_trivial_usage \
"NAME TYPE MAJOR MINOR FIRST LAST [s]"
#define makedevs_full_usage \
"[creates hda,hda1-hda8]\n"
#endif
-#ifdef CONFIG_FEATURE_MAKEDEVS_TABLE
+#if ENABLE_FEATURE_MAKEDEVS_TABLE
#define makedevs_trivial_usage \
"[-d device_table] rootdir"
#define makedevs_full_usage \
USE_FEATURE_PIDOF_OMIT( \
"$ pidof /bin/sh -o %PPID\n20351 5950")
-#ifndef CONFIG_FEATURE_FANCY_PING
+#if !ENABLE_FEATURE_FANCY_PING
#define ping_trivial_usage \
"host"
#define ping_full_usage \
"$ cat /tmp/foo\n" \
"Hello\n"
-#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
+#if ENABLE_FEATURE_TELNET_AUTOLOGIN
#define telnet_trivial_usage \
"[-a] [-l USER] HOST [PORT]"
#define telnet_full_usage \
*
*/
-#include <sys/types.h>
-#include <netdb.h>
-#include <sys/socket.h>
+//#include <sys/types.h>
+//#include <netdb.h>
+//#include <sys/socket.h>
#include "libbb.h"
-#ifdef CONFIG_FEATURE_IPV6
+#if ENABLE_FEATURE_IPV6
int create_icmp6_socket(void)
{
struct protoent *proto;
*
*/
-#include <sys/types.h>
-#include <netdb.h>
-#include <sys/socket.h>
+//#include <sys/types.h>
+//#include <netdb.h>
+//#include <sys/socket.h>
#include "libbb.h"
int create_icmp_socket(void)
return name;
}
-#ifdef CONFIG_FEATURE_IPV6
+#if ENABLE_FEATURE_IPV6
int INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
{
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <netdb.h>
+//#include <netdb.h>
#include "libbb.h"
struct hostent *xgethostbyname(const char *name)
#include "libbb.h"
-#ifdef CONFIG_FEATURE_MAKEDEVS_LEAF
+#if ENABLE_FEATURE_MAKEDEVS_LEAF
int makedevs_main(int argc, char **argv);
int makedevs_main(int argc, char **argv)
{
return 0;
}
-#elif defined CONFIG_FEATURE_MAKEDEVS_TABLE
+#elif ENABLE_FEATURE_MAKEDEVS_TABLE
/* Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */
ret = EXIT_FAILURE;
goto loop;
}
- } else
- {
+ } else {
dev_t rdev;
if (type == 'p') {
#include "libbb.h"
-#ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE
+#if !ENABLE_FEATURE_CHECK_TAINTED_MODULE
static void check_tainted(void) { puts(""); }
#else
#define TAINT_FILENAME "/proc/sys/kernel/tainted"
}
#endif
-#ifdef CONFIG_FEATURE_QUERY_MODULE_INTERFACE
+#if ENABLE_FEATURE_QUERY_MODULE_INTERFACE
struct module_info
{
puts("");
}
-#ifdef CONFIG_FEATURE_CLEAN_UP
+#if ENABLE_FEATURE_CLEAN_UP
free(module_names);
#endif
#include "libbb.h"
#include <sys/syscall.h>
-#ifdef CONFIG_FEATURE_2_6_MODULES
+#if ENABLE_FEATURE_2_6_MODULES
static inline void filename2modname(char *modname, const char *afterslash)
{
unsigned int i;
return 0;
}
-#ifdef CONFIG_FEATURE_IPCALC_FANCY
+#if ENABLE_FEATURE_IPCALC_FANCY
static int get_prefix(unsigned long netmask)
{
unsigned long msk = 0x80000000;
CMD_INFO = 12,
CMD_CHANGE = 13,
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
CMD_XRES = 100,
CMD_YRES = 101,
CMD_VXRES = 102,
{ "-laced", 1, CMD_LACED },
{ "-double", 1, CMD_DOUBLE },
{ "-n", 0, CMD_CHANGE },
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
{ "-all", 0, CMD_ALL },
{ "-xres", 1, CMD_XRES },
{ "-yres", 1, CMD_YRES },
{ "", 0, 0 }
};
-#ifdef CONFIG_FEATURE_FBSET_READMODE
+#if ENABLE_FEATURE_FBSET_READMODE
/* taken from linux/fb.h */
enum {
FB_VMODE_INTERLACED = 1, /* interlaced */
static int readmode(struct fb_var_screeninfo *base, const char *fn,
const char *mode)
{
-#ifdef CONFIG_FEATURE_FBSET_READMODE
+#if ENABLE_FEATURE_FBSET_READMODE
FILE *f;
char buf[256];
char *p = buf;
vrate = hrate / (v->upper_margin + v->yres + v->lower_margin + v->vsync_len);
}
printf("\nmode \"%ux%u-%u\"\n"
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
"\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n"
#endif
"\tgeometry %u %u %u %u %u\n"
"\trgba %u/%u,%u/%u,%u/%u,%u/%u\n"
"endmode\n\n",
v->xres, v->yres, (int) (vrate + 0.5),
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
drate / 1e6, hrate / 1e3, vrate,
#endif
v->xres, v->yres, v->xres_virtual, v->yres_virtual, v->bits_per_pixel,
case CMD_CHANGE:
g_options |= OPT_CHANGE;
break;
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
case CMD_XRES:
varset.xres = xatou32(argv[1]);
break;
write_rtc(tv.tv_sec, utc);
}
-#ifdef CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS
+#if ENABLE_FEATURE_HWCLOCK_ADJTIME_FHS
# define ADJTIME_PATH "/var/lib/hwclock/adjtime"
#else
# define ADJTIME_PATH "/etc/adjtime"
};
#endif
-#ifndef CONFIG_IPCRM_DROP_LEGACY
+#define IPCRM_LEGACY 1
+
+
+#if IPCRM_LEGACY
typedef enum type_id {
SHM,
return nb_errors;
}
-#endif /* #ifndef CONFIG_IPCRM_DROP_LEGACY */
+#endif /* IPCRM_LEGACY */
int ipcrm_main(int argc, char **argv);
/* if the command is executed without parameters, do nothing */
if (argc == 1)
return 0;
-#ifndef CONFIG_IPCRM_DROP_LEGACY
+#if IPCRM_LEGACY
/* check to see if the command is being invoked in the old way if so
then run the old code. Valid commands are msg, shm, sem. */
{
return 0;
}
}
-#endif /* #ifndef CONFIG_IPCRM_DROP_LEGACY */
+#endif /* IPCRM_LEGACY */
/* process new syntax to conform with SYSV ipcrm */
while ((c = getopt(argc, argv, "q:m:s:Q:M:S:h?")) != -1) {