);
}
-#define AR_OPT_VERBOSE (1 << 0)
-#define AR_OPT_PRESERVE_DATE (1 << 1)
+#define AR_OPT_VERBOSE (1 << 0)
+#define AR_OPT_PRESERVE_DATE (1 << 1)
/* "ar r" implies create, but warns about it. c suppresses warning.
* bbox accepts but ignores it: */
-#define AR_OPT_CREATE (1 << 2)
+#define AR_OPT_CREATE (1 << 2)
-#define AR_CMD_PRINT (1 << 3)
-#define FIRST_CMD AR_CMD_PRINT
-#define AR_CMD_LIST (1 << 4)
-#define AR_CMD_EXTRACT (1 << 5)
-#define AR_CMD_INSERT (1 << 6)
+#define AR_CMD_PRINT (1 << 3)
+#define FIRST_CMD AR_CMD_PRINT
+#define AR_CMD_LIST (1 << 4)
+#define AR_CMD_EXTRACT (1 << 5)
+#define AR_CMD_INSERT (1 << 6)
int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ar_main(int argc UNUSED_PARAM, char **argv)
* 0.9.0a/b -- no changes in this file.
* 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress().
* fixed bzWrite/bzRead to ignore zero-length requests.
- * fixed bzread to correctly handle read requests after EOF.
+ * fixed bzread to correctly handle read requests after EOF.
* wrong parameter order in call to bzDecompressInit in
* bzBuffToBuffDecompress. Fixed.
*/
* holds the original block data.
*
* The first thing to do is generate the MTF values,
- * and put them in
- * ((uint16_t*)s->arr1)[0 .. s->nblock-1].
+ * and put them in ((uint16_t*)s->arr1)[0 .. s->nblock-1].
+ *
* Because there are strictly fewer or equal MTF values
* than block values, ptr values in this area are overwritten
* with MTF values only when they are no longer needed.
*
* The final compressed bitstream is generated into the
- * area starting at
- * &((uint8_t*)s->arr2)[s->nblock]
+ * area starting at &((uint8_t*)s->arr2)[s->nblock]
*
* These storage aliases are set up in bzCompressInit(),
* except for the last one, which is arranged in
}
AssertH(nGroups < 8, 3002);
- AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003);
+ AssertH(nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003);
/*--- Compute MTF values for the selectors. ---*/
{
return 0;
switch (depend_type) {
- case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
- case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
+ case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
+ case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
}
return 0;
}
conflicts[conflicts_num] = package_num;
conflicts_num++;
/* add provides to conflicts list */
- for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) {
+ for (j = 0; j < package_hashtable[package_num]->num_of_edges; j++) {
if (package_hashtable[package_num]->edge[j]->type == EDGE_PROVIDES) {
const int conflicts_package_num = search_package_hashtable(
package_hashtable[package_num]->edge[j]->name,
if (package_edge->type == EDGE_OR_PRE_DEPENDS
|| package_edge->type == EDGE_OR_DEPENDS
- ) { /* start an EDGE_OR_ list */
+ ) {
+ /* start an EDGE_OR_ list */
number_of_alternatives = package_edge->version;
root_of_alternatives = package_edge;
continue;
}
- if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */
+ if (number_of_alternatives == 0) { /* not in the middle of an EDGE_OR_ list */
number_of_alternatives = 1;
root_of_alternatives = NULL;
}
#include "libbb.h"
#include "unarchive.h"
-#define DPKG_DEB_OPT_CONTENTS 1
-#define DPKG_DEB_OPT_CONTROL 2
-#define DPKG_DEB_OPT_FIELD 4
-#define DPKG_DEB_OPT_EXTRACT 8
-#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
+#define DPKG_DEB_OPT_CONTENTS 1
+#define DPKG_DEB_OPT_CONTROL 2
+#define DPKG_DEB_OPT_FIELD 4
+#define DPKG_DEB_OPT_EXTRACT 8
+#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dpkg_deb_main(int argc, char **argv)
/* Big things go last (register-relative addressing can be larger for big offsets) */
uint32_t crc32Table[256];
- unsigned char selectors[32768]; /* nSelectors=15 bits */
- struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
+ unsigned char selectors[32768]; /* nSelectors=15 bits */
+ struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
};
/* typedef struct bunzip_data bunzip_data; -- done in .h file */
{
enum {
SCANCODE = (1 << 0),
- ASCII = (1 << 1),
+ ASCII = (1 << 1),
MEDIUMRAW = (1 << 2),
- UNICODE = (1 << 3),
+ UNICODE = (1 << 3),
};
int fd;
unsigned opt;
* Example:
* At the font position for a capital A-ring glyph, we
* may have:
- * 00C5,212B,FFFE,0041,030A,FFFF
+ * 00C5,212B,FFFE,0041,030A,FFFF
* Some font positions may be described by sequences only,
* namely when there is no precomposed Unicode value for the glyph.
*/
int glyph;
uint16_t unicode;
- maxct = tailsz; /* more than enough */
+ maxct = tailsz; /* more than enough */
up = xmalloc(maxct * sizeof(*up));
for (glyph = 0; glyph < fontsize; glyph++) {
} else
#endif
#if ENABLE_FEATURE_LOADFONT_RAW
- if (len == 9780) { /* file with three code pages? */
+ if (len == 9780) { /* file with three code pages? */
charsize = height = 16;
font += 40;
- } else if ((len & 0377) == 0) { /* bare font */
+ } else if ((len & 0377) == 0) { /* bare font */
charsize = height = len / 256;
} else
#endif
struct termios tio, tio0;
};
#define G (*ptr_to_globals)
-#define kbmode (G.kbmode)
-#define tio (G.tio)
-#define tio0 (G.tio0)
+#define kbmode (G.kbmode)
+#define tio (G.tio)
+#define tio0 (G.tio0)
#define INIT_G() do { \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
int showkey_main(int argc UNUSED_PARAM, char **argv)
{
enum {
- OPT_a = (1<<0), // display the decimal/octal/hex values of the keys
- OPT_k = (1<<1), // display only the interpreted keycodes (default)
- OPT_s = (1<<2), // display only the raw scan-codes
+ OPT_a = (1<<0), // display the decimal/octal/hex values of the keys
+ OPT_k = (1<<1), // display only the interpreted keycodes (default)
+ OPT_s = (1<<2), // display only the raw scan-codes
};
INIT_G();
}
/* Correct any day of week and day of year etc. fields */
- tm_time.tm_isdst = -1; /* Be sure to recheck dst */
+ tm_time.tm_isdst = -1; /* Be sure to recheck dst */
ts.tv_sec = validate_tm_time(date_str, &tm_time);
maybe_set_utc(opt);
{ "b", 512 },
{ "kD", 1000 },
{ "k", 1024 },
- { "K", 1024 }, /* compat with coreutils dd */
+ { "K", 1024 }, /* compat with coreutils dd */
{ "MD", 1000000 },
{ "M", 1048576 },
{ "GD", 1000000000 },
|| (flags & OPT_FILEUTILS_INTERACTIVE))
) {
if (fprintf(stderr, "mv: overwrite '%s'? ", dest) < 0) {
- goto RET_1; /* Ouch! fprintf failed! */
+ goto RET_1; /* Ouch! fprintf failed! */
}
if (!bb_ask_confirmation()) {
goto RET_0;
old_priority = getpriority(PRIO_PROCESS, 0);
- if (!*++argv) { /* No args, so (GNU) output current nice value. */
+ if (!*++argv) { /* No args, so (GNU) output current nice value. */
printf("%d\n", old_priority);
fflush_stdout_and_exit(EXIT_SUCCESS);
}
- adjustment = 10; /* Set default adjustment. */
+ adjustment = 10; /* Set default adjustment. */
if (argv[0][0] == '-') {
if (argv[0][1] == 'n') { /* -n */
} else { /* -NNN (NNN may be negative) == -n NNN */
argv[0] += 1; argv--; argc++;
}
- if (argc < 4) { /* Missing priority and/or utility! */
+ if (argc < 4) { /* Missing priority and/or utility! */
bb_show_usage();
}
adjustment = xatoi_range(argv[1], INT_MIN/2, INT_MAX/2);
* Based on code from util-linux v 2.11l
*
* Copyright (c) 1990
- * The Regents of the University of California. All rights reserved.
+ * The Regents of the University of California. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
bb_dump_add(dumper, "\" \"");
}
bb_dump_add(dumper, add_strings[(int)od_o2si[(p - od_opts)]]);
- } else { /* P, p, s, w, or other unhandled */
+ } else { /* P, p, s, w, or other unhandled */
bb_show_usage();
}
}
static char key_separator;
static struct sort_key {
- struct sort_key *next_key; /* linked list */
- unsigned range[4]; /* start word, start char, end word, end char */
+ struct sort_key *next_key; /* linked list */
+ unsigned range[4]; /* start word, start char, end word, end char */
unsigned flags;
} *key_list;
* state. */
/* test(1) accepts the following grammar:
- oexpr ::= aexpr | aexpr "-o" oexpr ;
- aexpr ::= nexpr | nexpr "-a" aexpr ;
- nexpr ::= primary | "!" primary
+ oexpr ::= aexpr | aexpr "-o" oexpr ;
+ aexpr ::= nexpr | nexpr "-a" aexpr ;
+ nexpr ::= primary | "!" primary
primary ::= unary-operator operand
| operand binary-operator operand
| operand
buffer[pos++] = *arg; /* copy CHAR */
if (!arg[0] || arg[1] != '=' || arg[2] != ']')
bb_show_usage();
- arg += 3; /* skip CHAR=] */
+ arg += 3; /* skip CHAR=] */
continue;
}
/* The rest of "[xyz..." cases is treated as normal
char *invec = vector + ASCII;
char *outvec = vector + ASCII * 2;
-#define TR_OPT_complement (3 << 0)
-#define TR_OPT_delete (1 << 2)
-#define TR_OPT_squeeze_reps (1 << 3)
+#define TR_OPT_complement (3 << 0)
+#define TR_OPT_delete (1 << 2)
+#define TR_OPT_squeeze_reps (1 << 3)
for (i = 0; i < ASCII; i++) {
vector[i] = i;
bb_simple_perror_msg(arg);
status = EXIT_FAILURE;
}
- goto DO_EOF; /* Treat an EOF as '\r'. */
+ goto DO_EOF; /* Treat an EOF as '\r'. */
}
/* Cater for -c and -m */
*/
if (c == '\t') {
linepos = (linepos | 7) + 1;
- } else { /* '\n', '\r', '\f', or '\v' */
+ } else { /* '\n', '\r', '\f', or '\v' */
DO_EOF:
if (linepos > counts[WC_LENGTH]) {
counts[WC_LENGTH] = linepos;
* effect of trashing the totals array after outputting it, but that's
* irrelavent since we no longer need it. */
if (num_files > 1) {
- num_files = 0; /* Make sure we don't get here again. */
+ num_files = 0; /* Make sure we don't get here again. */
arg = "total";
pcounts = totals;
--argv;
};
-#define tid_gt(x, y) ((x - y) > 0)
+#define tid_gt(x, y) ((x - y) > 0)
static inline int tid_geq(tid_t x, tid_t y)
{
/* tokens and their corresponding info values */
-#define NTC "\377" /* switch to next token class (tc<<1) */
-#define NTCC '\377'
+#define NTC "\377" /* switch to next token class (tc<<1) */
+#define NTCC '\377'
-#define OC_B OC_BUILTIN
+#define OC_B OC_BUILTIN
static const char tokenlist[] ALIGN1 =
"\1(" NTC
OC_B|B_ss|P(0x8f), OC_FBLTIN|F_ti, OC_B|B_ti|P(0x0b), OC_B|B_mt|P(0x0b),
OC_B|B_lo|P(0x49), OC_B|B_up|P(0x49),
OC_GETLINE|SV|P(0),
- 0, 0,
+ 0, 0,
0,
0 /* END */
};
ORS, RS, RT, FILENAME,
SUBSEP, F0, ARGIND, ARGC,
ARGV, ERRNO, FNR, NR,
- NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS
+ NF, IGNORECASE, ENVIRON, NUM_INTERNAL_VARS
};
static const char vNames[] ALIGN1 =
#define fnargs (G.evaluate__fnargs)
/* seed is initialized to 1 */
#define seed (G.evaluate__seed)
-#define sreg (G.evaluate__sreg)
+#define sreg (G.evaluate__sreg)
var *v1;
rsm->F = popen(L.s, "r");
rsm->is_pipe = TRUE;
} else {
- rsm->F = fopen_for_read(L.s); /* not xfopen! */
+ rsm->F = fopen_for_read(L.s); /* not xfopen! */
}
}
} else {
{
int i, j;
- if (list[c[k]].y < y) /* quick look for typical case */
+ if (list[c[k]].y < y) /* quick look for typical case */
return k + 1;
for (i = 0, j = k + 1;;) {
char *add_cmd_line;
struct pipeline {
- char *buf; /* Space to hold string */
- int idx; /* Space used */
- int len; /* Space allocated */
+ char *buf; /* Space to hold string */
+ int idx; /* Space used */
+ int len; /* Space allocated */
} pipeline;
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
02111-1307 USA.
*/
/*
- * POSIX Standard: 9.2.1 Group Database Access <grp.h>
+ * POSIX Standard: 9.2.1 Group Database Access <grp.h>
*/
#ifndef BB_GRP_H
#define BB_GRP_H 1
# include <sex.h>
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
|| defined(__APPLE__)
-# include <sys/resource.h> /* rlimit */
+# include <sys/resource.h> /* rlimit */
# include <machine/endian.h>
# define bswap_64 __bswap64
# define bswap_32 __bswap32
02111-1307 USA. */
/*
- * POSIX Standard: 9.2.2 User Database Access <pwd.h>
+ * POSIX Standard: 9.2.2 User Database Access <pwd.h>
*/
#ifndef BB_PWD_H
};
struct linux_rtc_wkalrm {
- unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
+ unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
- struct linux_rtc_time time; /* time the alarm is set to */
+ struct linux_rtc_time time; /* time the alarm is set to */
};
/*
};
static const char P_array[] ALIGN1 = {
# if MD5_SIZE_VS_SPEED > 1
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
# endif
- 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */
- 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */
- 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */
+ 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */
+ 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */
+ 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 /* 4 */
};
#endif
uint32_t *words = (void*) ctx->wbuffer;
//TODO: replace with something like
// bb_uuencode(cp, src, length, bb_uuenc_tbl_XXXbase64);
#define b64_from_24bit(B2, B1, B0, N) \
-do { \
- unsigned w = ((B2) << 16) | ((B1) << 8) | (B0); \
- resptr = to64(resptr, w, N); \
+do { \
+ unsigned w = ((B2) << 16) | ((B1) << 8) | (B0); \
+ resptr = to64(resptr, w, N); \
} while (0)
if (is_sha512 == '5') {
unsigned i = 0;
p = s = start;
do {
if (*p == '/') {
- if (*s == '/') { /* skip duplicate (or initial) slash */
+ if (*s == '/') { /* skip duplicate (or initial) slash */
continue;
}
if (*s == '.') {
- if (s[1] == '/' || !s[1]) { /* remove extra '.' */
+ if (s[1] == '/' || !s[1]) { /* remove extra '.' */
continue;
}
if ((s[1] == '.') && (s[2] == '/' || !s[2])) {
++s;
if (p > start) {
- while (*--p != '/') /* omit previous dir */
+ while (*--p != '/') /* omit previous dir */
continue;
}
continue;
*++p = *s;
} while (*++s);
- if ((p == start) || (*p != '/')) { /* not a trailing slash */
- ++p; /* so keep last character */
+ if ((p == start) || (*p != '/')) { /* not a trailing slash */
+ ++p; /* so keep last character */
}
*p = '\0';
return p;
while (1) {
rv = bb__pgsreader(GETXXKEY_R_PARSER, resultbuf, buffer, buflen, stream);
if (!rv) {
- if (GETXXKEY_R_TEST(resultbuf)) { /* Found key? */
+ if (GETXXKEY_R_TEST(resultbuf)) { /* found key? */
*result = resultbuf;
break;
}
} else {
- if (rv == ENOENT) { /* end-of-file encountered. */
+ if (rv == ENOENT) { /* EOF encountered */
rv = 0;
}
break;
if (G.remote.cursor_x < G.x) {
G.x = G.remote.cursor_x;
- i = 0; // force refresh
+ i = 0; // force refresh
}
if (nx > G.x) {
G.x = nx;
- i = 0; // force refresh
+ i = 0; // force refresh
}
if (G.remote.cursor_y < G.y) {
G.y = G.remote.cursor_y;
- i = 0; // force refresh
+ i = 0; // force refresh
}
if (ny > G.y) {
G.y = ny;
- i = 0; // force refresh
+ i = 0; // force refresh
}
}
#include "libbb.h"
#include <mtd/ubi-user.h>
-#define OPTION_M (1 << 0)
-#define OPTION_D (1 << 1)
+#define OPTION_M (1 << 0)
+#define OPTION_D (1 << 1)
#define do_attach (ENABLE_UBIATTACH && \
(!ENABLE_UBIDETACH || (applet_name[3] == 'a')))
/* Parse command line. */
n = getopt32(argv, "wfas"); // -s ignored
argv += optind;
- if (n & 1) // --wait
+ if (n & 1) // --wait
flags &= ~O_NONBLOCK;
- if (n & 2) // --force
+ if (n & 2) // --force
flags |= O_TRUNC;
if (n & 4) {
/* Unload _all_ unused modules via NULL delete_module() call */
int verbose; /* must be int (used by getopt32) */
smallint flg_deny_all;
- unsigned rmt_ip; /* used for IP-based allow/deny rules */
+ unsigned rmt_ip; /* used for IP-based allow/deny rules */
time_t last_mod;
char *rmt_ip_str; /* for $REMOTE_ADDR and $REMOTE_PORT */
const char *bind_addr_or_port;
#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
Htaccess *script_i; /* config script interpreters */
#endif
- char *iobuf; /* [IOBUF_SIZE] */
+ char *iobuf; /* [IOBUF_SIZE] */
#define hdr_buf bb_common_bufsiz1
char *hdr_ptr;
int hdr_cnt;
struct rlimit rlim_ofile;
servtab_t *serv_list;
int global_queuelen;
- int maxsock; /* max fd# in allsock, -1: unknown */
+ int maxsock; /* max fd# in allsock, -1: unknown */
/* whenever maxsock grows, prev_maxsock is set to new maxsock,
* but if maxsock is set to -1, prev_maxsock is not changed */
int prev_maxsock;
/* vi: set sw=4 ts=4: */
/*
- * "ip" utility frontend.
- *
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
* Bernhard Reutner-Fischer rewrote to use index_in_substr_array
*/
/* After libbb.h, because on some systems it needs other includes */
#include <arpa/inet.h>
-#define CLASS_A_NETMASK ntohl(0xFF000000)
-#define CLASS_B_NETMASK ntohl(0xFFFF0000)
-#define CLASS_C_NETMASK ntohl(0xFFFFFF00)
+#define CLASS_A_NETMASK ntohl(0xFF000000)
+#define CLASS_B_NETMASK ntohl(0xFFFF0000)
+#define CLASS_C_NETMASK ntohl(0xFFFFFF00)
static unsigned long get_netmask(unsigned long ipaddr)
{
/* vi: set sw=4 ts=4: */
/*
- * ip.c "ip" utility frontend.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
*
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
*/
#include "ip_common.h" /* #include "libbb.h" is inside */
/* vi: set sw=4 ts=4: */
/*
- * ipaddress.c "ip address".
- *
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
- * Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated
+ * Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated
*/
#include <fnmatch.h>
#ifndef IFF_LOWER_UP
/* from linux/if.h */
-#define IFF_LOWER_UP 0x10000 /* driver signals L1 up*/
+#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
#endif
struct filter_t {
struct nlmsg_list {
struct nlmsg_list *next;
- struct nlmsghdr h;
+ struct nlmsghdr h;
};
static int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo)
};
struct rtnl_handle rth;
struct {
- struct nlmsghdr n;
- struct ifinfomsg i;
- char buf[1024];
+ struct nlmsghdr n;
+ struct ifinfomsg i;
+ char buf[1024];
} req;
smalluint arg;
char *name_str = NULL, *link_str = NULL, *type_str = NULL, *dev_str = NULL;
/* vi: set sw=4 ts=4: */
/*
- * iproute.c "ip route".
- *
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
*
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
* Kunihiro Ishiguro <kunihiro@zebra.org> 001102: rtnh_ifindex was not initialized
*/
-#include "ip_common.h" /* #include "libbb.h" is inside */
+#include "ip_common.h" /* #include "libbb.h" is inside */
#include "rt_names.h"
#include "utils.h"
};
struct rtnl_handle rth;
struct {
- struct nlmsghdr n;
- struct rtmsg r;
- char buf[1024];
+ struct nlmsghdr n;
+ struct rtmsg r;
+ char buf[1024];
} req;
char mxbuf[256];
struct rtattr * mxrta = (void*)mxbuf;
/* vi: set sw=4 ts=4: */
/*
- * iprule.c "ip rule".
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
*
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
* initially integrated into busybox by Bernhard Reutner-Fischer
*/
bool table_ok = 0;
struct rtnl_handle rth;
struct {
- struct nlmsghdr n;
- struct rtmsg r;
- char buf[1024];
+ struct nlmsghdr n;
+ struct rtmsg r;
+ char buf[1024];
} req;
smalluint key;
/* vi: set sw=4 ts=4: */
/*
- * iptunnel.c "ip tunnel"
- *
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
*
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
- * Rani Assaf <rani@magic.metawire.com> 980930: do not allow key for ipip/sit
- * Phil Karn <karn@ka9q.ampr.org> 990408: "pmtudisc" flag
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980930: do not allow key for ipip/sit
+ * Phil Karn <karn@ka9q.ampr.org> 990408: "pmtudisc" flag
*/
#include <netinet/ip.h>
struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- iov, 2,
- NULL, 0,
+ iov, 2,
+ NULL, 0,
0
};
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- &iov, 1,
- NULL, 0,
+ &iov, 1,
+ NULL, 0,
0
};
char *buf = xmalloc(8*1024); /* avoid big stack buffer */
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- &iov, 1,
- NULL, 0,
+ &iov, 1,
+ NULL, 0,
0
};
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
struct rtnl_handle {
- int fd;
- struct sockaddr_nl local;
- struct sockaddr_nl peer;
- uint32_t seq;
- uint32_t dump;
+ int fd;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
+ uint32_t seq;
+ uint32_t dump;
};
extern void xrtnl_open(struct rtnl_handle *rth) FAST_FUNC;
/* vi: set sw=4 ts=4: */
/*
- * ll_addr.c
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <net/if_arp.h>
/* vi: set sw=4 ts=4: */
/*
- * ll_map.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
-#include <net/if.h> /* struct ifreq and co. */
+#include <net/if.h> /* struct ifreq and co. */
#include "libbb.h"
#include "libnetlink.h"
/* vi: set sw=4 ts=4: */
/*
- * ll_proto.c
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include "libbb.h"
/* vi: set sw=4 ts=4: */
/*
- * ll_types.c
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <arpa/inet.h>
#include <linux/if_arp.h>
/* vi: set sw=4 ts=4: */
/*
- * rt_names.c rtnetlink names DB.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include "libbb.h"
#include "rt_names.h"
/* vi: set sw=4 ts=4: */
/*
- * rtm_map.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include "libbb.h"
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Changes:
*
- * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
*/
#include "libbb.h"
extern char _SL_;
#ifndef IPPROTO_ESP
-#define IPPROTO_ESP 50
+#define IPPROTO_ESP 50
#endif
#ifndef IPPROTO_AH
-#define IPPROTO_AH 51
+#define IPPROTO_AH 51
#endif
#define SPRINT_BSIZE 64
-#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
+#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
extern void incomplete_command(void) NORETURN;
#endif
/* Taken from linux/sockios.h */
-#define SIOCSIFNAME 0x8923 /* set interface name */
+#define SIOCSIFNAME 0x8923 /* set interface name */
/* Octets in one Ethernet addr, from <linux/if_ether.h> */
-#define ETH_ALEN 6
+#define ETH_ALEN 6
#ifndef ifr_newname
#define ifr_newname ifr_ifru.ifru_slave
flags |= opt;
}
if (flags & (NETSTAT_TCP|NETSTAT_UDP|NETSTAT_RAW)) {
- printf("Active Internet connections "); /* xxx */
+ printf("Active Internet connections "); /* xxx */
if ((flags & (NETSTAT_LISTENING|NETSTAT_CONNECTED)) == (NETSTAT_LISTENING|NETSTAT_CONNECTED))
printf("(servers and established)");
//UNUSED: #define PANIC_THRESHOLD 1000 /* panic threshold (sec) */
#define FREQ_TOLERANCE 0.000015 /* frequency tolerance (15 PPM) */
-#define BURSTPOLL 0 /* initial poll */
+#define BURSTPOLL 0 /* initial poll */
#define MINPOLL 5 /* minimum poll interval. std ntpd uses 6 (6: 64 sec) */
#define BIGPOLL 10 /* drop to lower poll at any trouble (10: 17 min) */
#define MAXPOLL 12 /* maximum poll interval (12: 1.1h, 17: 36.4h). std ntpd uses 17 */
VERB3 bb_error_msg("peer %s unfit for selection: unreachable", p->p_dotted);
return 0;
}
-#if 0 /* we filter out such packets earlier */
+#if 0 /* we filter out such packets earlier */
if ((p->lastpkt_status & LI_ALARM) == LI_ALARM
|| p->lastpkt_stratum >= MAXSTRAT
) {
}
static void
-set_freq(double freq) /* frequency update */
+set_freq(double freq) /* frequency update */
{
char tbuf[80];
int prec = 0;
int b;
# if 0
- struct timespec tp;
+ struct timespec tp;
/* We can use sys_clock_getres but assuming 10ms tick should be fine */
clock_getres(CLOCK_REALTIME, &tp);
tp.tv_sec = 0;
int i, encap, opt;
struct termios state;
const char *proto = "cslip";
- const char *extcmd; /* Command to execute after hangup */
+ const char *extcmd; /* Command to execute after hangup */
const char *baud_str;
- int baud_code = -1; /* Line baud rate (system code) */
+ int baud_code = -1; /* Line baud rate (system code) */
enum {
OPT_p_proto = 1 << 0,
if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) {
struct winsize ws;
if ((ptr+8) >= end)
- break; /* incomplete, can't process */
+ break; /* incomplete, can't process */
ws.ws_col = (ptr[3] << 8) | ptr[4];
ws.ws_row = (ptr[5] << 8) | ptr[6];
ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws);
static const char iacs_to_send[] ALIGN1 = {
IAC, DO, TELOPT_ECHO,
IAC, DO, TELOPT_NAWS,
- /* This requires telnetd.ctrlSQ.patch (incomplete) */
- /* IAC, DO, TELOPT_LFLOW, */
+ /* This requires telnetd.ctrlSQ.patch (incomplete) */
+ /*IAC, DO, TELOPT_LFLOW,*/
IAC, WILL, TELOPT_ECHO,
IAC, WILL, TELOPT_SGA
};
short vlan_qos;
};
-#define VLAN_GROUP_ARRAY_LEN 4096
-#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
+#define VLAN_GROUP_ARRAY_LEN 4096
+#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */
/* On entry, table points to the length of the current string
* plus NUL terminator plus data length for the subsequent entry.
* Licensed under GPLv2, see file LICENSE in this source tree.
*
* Copyright (C) 2010 Bradley M. Kuhn <bkuhn@ebb.org>
- * Kuhn's copyrights are licensed GPLv2-or-later. File as a whole remains GPLv2.
+ * Kuhn's copyrights are licensed GPLv2-or-later. File as a whole remains GPLv2.
*/
#include "libbb.h"
/* Must match option string! */
enum {
WGET_OPT_CONTINUE = (1 << 0),
- WGET_OPT_SPIDER = (1 << 1),
+ WGET_OPT_SPIDER = (1 << 1),
WGET_OPT_QUIET = (1 << 2),
WGET_OPT_OUTNAME = (1 << 3),
WGET_OPT_PREFIX = (1 << 4),
*/
case 204:
break;
- case 300: /* redirection */
+ case 300: /* redirection */
case 301:
case 302:
case 303:
//config: Report CPU and I/O statistics
#include "libbb.h"
-#include <sys/utsname.h> /* Need struct utsname */
+#include <sys/utsname.h> /* Need struct utsname */
//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
#define debug(fmt, ...) ((void)0)
-#define MAX_DEVICE_NAME 12
-#define CURRENT 0
-#define LAST 1
+#define MAX_DEVICE_NAME 12
+#define CURRENT 0
+#define LAST 1
#if 1
typedef unsigned long long cputime_t;
int i = 0;
char buf[128];
unsigned major, minor;
- unsigned long wr_ops, dummy; /* %*lu for suppres the conversion wouldn't work */
+ unsigned long wr_ops, dummy; /* %*lu for suppress the conversion wouldn't work */
unsigned long long rd_sec_or_wr_ops;
unsigned long long rd_sec_or_dummy, wr_sec_or_dummy, wr_sec;
struct stats_dev sd;
//config: Per-processor statistics
#include "libbb.h"
-#include <sys/utsname.h> /* struct utsname */
+#include <sys/utsname.h> /* struct utsname */
//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
#define debug(fmt, ...) ((void)0)
while (irq < irqs_per_cpu) {
/* Number of interrupts per CPU has changed */
ic = &per_cpu_stats[current][irq];
- ic->irq_name[0] = '\0'; /* False interrupt */
+ ic->irq_name[0] = '\0'; /* False interrupt */
irq++;
}
}
unsigned irq;
fp = fopen_for_read(f);
- if (!fp) /* No interrupts file */
+ if (!fp) /* No interrupts file */
return 0;
linelen = INTERRUPTS_LINE + 16 * G.cpu_nr;
char *opt_set_cpu;
int i, opt;
enum {
- OPT_ALL = 1 << 0, /* -A */
- OPT_INTS = 1 << 1, /* -I */
- OPT_SETCPU = 1 << 2, /* -P */
- OPT_UTIL = 1 << 3, /* -u */
+ OPT_ALL = 1 << 0, /* -A */
+ OPT_INTS = 1 << 1, /* -I */
+ OPT_SETCPU = 1 << 2, /* -P */
+ OPT_UTIL = 1 << 3, /* -u */
};
/* Dont buffer data if redirected to a pipe */
retval = EXIT_FAILURE;
goto end;
}
- value = cptr + 1; /* point to the value in name=value */
+ value = cptr + 1; /* point to the value in name=value */
if (setting == cptr || !*value) {
bb_error_msg("error: malformed setting '%s'", outname);
retval = EXIT_FAILURE;
extern char *selinux_mnt;
-#define OPT_VERBOSE (1 << 0)
-#define OPT_BOOLEAN (1 << 1)
+#define OPT_VERBOSE (1 << 0)
+#define OPT_BOOLEAN (1 << 1)
-#define COL_FMT "%-31s "
+#define COL_FMT "%-31s "
static void display_boolean(void)
{
const char *pol_path;
int rc;
- opt_complementary = "?0"; /* no arguments are required. */
+ opt_complementary = "?0"; /* no arguments are required. */
opts = getopt32(argv, "vb");
/* SELinux status: line */
void strprint();
-int
-main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
- register int i;
+ int i;
for (i = 1; i < argc; i++) {
printf("argv[%d] = <", i);
exit(EXIT_SUCCESS);
}
-void
-strprint(str)
-char *str;
+void strprint(char *str)
{
- register unsigned char *s;
+ unsigned char *s;
for (s = (unsigned char *)str; s && *s; s++) {
if (*s < ' ') {
#include <stdio.h>
#include <stdlib.h>
-int
-main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
argv++;
struct fb_bitfield {
uint32_t offset; /* beginning of bitfield */
- uint32_t length; /* length of bitfield */
+ uint32_t length; /* length of bitfield */
uint32_t msb_right; /* !=0: Most significant bit is right */
};
struct fb_var_screeninfo {
uint32_t height; /* height of picture in mm */
uint32_t width; /* width of picture in mm */
- uint32_t accel_flags; /* acceleration flags (hints) */
+ uint32_t accel_flags; /* acceleration flags (hints) */
/* Timing: All values in pixclocks, except pixclock (of course) */
uint32_t pixclock; /* pixel clock in ps (pico seconds) */
}
case 4:
case 5:
- case 6: {
+ case 6: {
static const uint32_t syncs[] = {FB_SYNC_VERT_HIGH_ACT, FB_SYNC_HOR_HIGH_ACT, FB_SYNC_COMP_HIGH_ACT};
ss(&base->sync, syncs[i-4], p, "low");
//bb_info_msg("SYNC[%s]", p);
* Based on code from util-linux v 2.11l
*
* Copyright (c) 1989
- * The Regents of the University of California. All rights reserved.
+ * The Regents of the University of California. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
}
static const char *const add_strings[] = {
- "\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"", /* b */
- "\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"", /* c */
- "\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"", /* d */
- "\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"", /* o */
- "\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"", /* x */
+ "\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"", /* b */
+ "\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"", /* c */
+ "\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"", /* d */
+ "\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"", /* o */
+ "\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"", /* x */
};
static const char add_first[] ALIGN1 = "\"%07.7_Ax\n\"";