*/
-
-#include "busybox.h"
+#include "libbb.h"
#include <getopt.h>
#define assert(a) ((void)0)
initializer in the width_bytes array. */
struct dummy {
int assert_width_bytes_matches_size_spec_decl
- [sizeof width_bytes / sizeof width_bytes[0] == N_SIZE_SPECS ? 1 : -1];
+ [ARRAY_SIZE(width_bytes) == N_SIZE_SPECS ? 1 : -1];
};
static size_t string_min;
fmt = SIGNED_DECIMAL;
size = INT or LONG; (whichever integral_type_size[4] resolves to)
print_function = print_int; (assuming size == INT)
- fmt_string = "%011d%c";
+ fmt_string = "%011d%c";
}
S_ORIG is solely for reporting errors. It should be the full format
string argument. */
n_bytes_read = fread(buf, 1, n_bytes_to_read, in_stream);
n_skip -= n_bytes_read;
if (n_bytes_read != n_bytes_to_read)
- break; /* EOF on this file or error */
+ break; /* EOF on this file or error */
}
}
if (n_skip == 0)
OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG,
};
#if ENABLE_GETOPT_LONG
- static const struct option long_options[] = {
- { "skip-bytes", required_argument, NULL, 'j' },
- { "address-radix", required_argument, NULL, 'A' },
- { "read-bytes", required_argument, NULL, 'N' },
- { "format", required_argument, NULL, 't' },
- { "output-duplicates", no_argument, NULL, 'v' },
- { "strings", optional_argument, NULL, 'S' },
- { "width", optional_argument, NULL, 'w' },
- { "traditional", no_argument, NULL, 0xff },
- { NULL, 0, NULL, 0 }
- };
+ static const char od_longopts[] =
+ "skip-bytes\0" Required_argument "j"
+ "address-radix\0" Required_argument "A"
+ "read-bytes\0" Required_argument "N"
+ "format\0" Required_argument "t"
+ "output-duplicates\0" No_argument "v"
+ "strings\0" Optional_argument "S"
+ "width\0" Optional_argument "w"
+ "traditional\0" No_argument "\xff"
+ "\0";
#endif
char *str_A, *str_N, *str_j, *str_S;
char *str_w = NULL;
/* Parse command line */
opt_complementary = "t::"; // list
#if ENABLE_GETOPT_LONG
- applet_long_options = long_options;
+ applet_long_options = od_longopts;
#endif
opt = getopt32(argc, argv, "A:N:abcdfhij:lot:vxsS:"
"w::", // -w with optional param
if (opt & OPT_l) decode_format_string("d4");
if (opt & OPT_o) decode_format_string("o2");
//if (opt & OPT_t)...
- lst_t = llist_rev(lst_t);
while (lst_t) {
decode_format_string(lst_t->data);
lst_t = lst_t->link;
/* If the --traditional option is used, there may be from
* 0 to 3 remaining command line arguments; handle each case
* separately.
- * od [file] [[+]offset[.][b] [[+]label[.][b]]]
+ * od [file] [[+]offset[.][b] [[+]label[.][b]]]
* The offset and pseudo_start have the same syntax.
*
* FIXME: POSIX 1003.1-2001 with XSI requires support for the