#include "usage.h"
#define MAKE_USAGE(aname, usage) { aname, usage },
static struct usage_data {
- const char *aname;
- const char *usage;
+ const char *aname;
+ const char *usage;
} usage_array[] = {
#include "applets.h"
};
#define INIT_G() do { } while (0)
//#define G (*ptr_to_globals)
//#define INIT_G() do {
-// SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
+// SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
//} while (0)
blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
struct ext2_inode *inode)
{
- return inode->i_blocks -
- (inode->i_file_acl ? fs->blocksize >> 9 : 0);
+ return inode->i_blocks -
+ (inode->i_file_acl ? fs->blocksize >> 9 : 0);
}
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
struct BUG_G_too_big {
- char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
+ char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
};
#define INIT_G() do { \
G.sed_cmd_tail = &G.sed_cmd_head; \
const void *end = (uint8_t*)buf + len;
while (buf != end) {
- val = crc_table[(uint8_t)val ^ *(uint8_t*)buf] ^ (val >> 8);
+ val = crc_table[(uint8_t)val ^ *(uint8_t*)buf] ^ (val >> 8);
buf = (uint8_t*)buf + 1;
}
return val;
This struct allows you to define long options:
static const char applet_longopts[] ALIGN1 =
- //"name\0" has_arg val
- "verbose\0" No_argument "v"
- ;
+ //"name\0" has_arg val
+ "verbose\0" No_argument "v"
+ ;
applet_long_options = applet_longopts;
The last member of struct option (val) typically is set to
if specified together. In this case you must set
opt_complementary = "b--cf:c--bf:f--bc". If two of the
mutually exclusive options are found, getopt32 will call
- bb_show_usage() and die.
+ bb_show_usage() and die.
"x--x" Variation of the above, it means that -x option should occur
at most once.
* IMAXBEL Echo BEL on input line too long
* IUTF8 Appears to affect tty's idea of char widths,
* observed to improve backspacing through Unicode chars
- */
+ */
/* line buffered input (NL or EOL or EOF chars end a line);
* recognize INT/QUIT/SUSP chars;
#define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() do { } while (0)
struct BUG_G_too_big {
- char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
+ char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
};
static char* skip_whitespace(char *s)
{
- while (*s == ' ' || *s == '\t') ++s;
+ while (*s == ' ' || *s == '\t') ++s;
- return s;
+ return s;
}
static char line[64 * 1024];
// /* Do we have a loop? */
// if (p->refid == p->dstaddr || p->refid == s.refid)
// return 0;
- return 1;
+ return 1;
}
static peer_t*
select_and_cluster(void)
};
#define G (*ptr_to_globals)
#define INIT_G() do { \
- SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
#endif
/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
- argc = 1;
- while (argv[argc])
- argc++;
+ argc = 1;
+ while (argv[argc])
+ argc++;
opts = 0;
while (1) {
};
#if ENABLE_LONG_OPTS
- static const char getopt_longopts[] ALIGN1 =
+ static const char getopt_longopts[] ALIGN1 =
"shared\0" No_argument "s"
"exclusive\0" No_argument "x"
"unlock\0" No_argument "u"