aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-10-06 09:07:33 -0700
committerElliott Hughes <enh@google.com>2021-10-06 09:39:44 -0700
commit5d609971554a05a18293f060aeab42f5e4089281 (patch)
tree84c0a822d790f6e39f7c9475b20ca6f3d594bd9e /android
parent98227bd7baa580da66b59f89c1c8c5b84367a22f (diff)
parent1986075975db4cdab08133f8299ad72dd5af4b23 (diff)
downloadtoybox-5d609971554a05a18293f060aeab42f5e4089281.tar.gz
Upgrade toybox to 1986075975db4cdab08133f8299ad72dd5af4b23
Test: make Change-Id: I44f5f2e1fc2f45dd6dd4c58fcaddeff552296c14
Diffstat (limited to 'android')
-rw-r--r--android/device/generated/config.h4
-rw-r--r--android/device/generated/flags.h36
-rw-r--r--android/device/generated/globals.h16
-rw-r--r--android/device/generated/help.h6
-rw-r--r--android/device/generated/newtoys.h4
-rw-r--r--android/linux/generated/config.h4
-rw-r--r--android/linux/generated/flags.h36
-rw-r--r--android/linux/generated/globals.h16
-rw-r--r--android/linux/generated/help.h6
-rw-r--r--android/linux/generated/newtoys.h4
-rw-r--r--android/mac/generated/config.h4
-rw-r--r--android/mac/generated/flags.h36
-rw-r--r--android/mac/generated/globals.h16
-rw-r--r--android/mac/generated/help.h6
-rw-r--r--android/mac/generated/newtoys.h4
15 files changed, 183 insertions, 15 deletions
diff --git a/android/device/generated/config.h b/android/device/generated/config.h
index 7558a5ba..fa21fed2 100644
--- a/android/device/generated/config.h
+++ b/android/device/generated/config.h
@@ -262,8 +262,12 @@
#define USE_HELP_EXTRAS(...) __VA_ARGS__
#define CFG_HELP 1
#define USE_HELP(...) __VA_ARGS__
+#define CFG_HEXDUMP 0
+#define USE_HEXDUMP(...)
#define CFG_HEXEDIT 0
#define USE_HEXEDIT(...)
+#define CFG_HD 0
+#define USE_HD(...)
#define CFG_HOSTID 0
#define USE_HOSTID(...)
#define CFG_HOST 0
diff --git a/android/device/generated/flags.h b/android/device/generated/flags.h
index 641112e7..809a29b2 100644
--- a/android/device/generated/flags.h
+++ b/android/device/generated/flags.h
@@ -1267,6 +1267,23 @@
#undef FLAG_a
#endif
+// hexdump bcCdn#<0os#<0vx[!bcCdox]
+#undef OPTSTR_hexdump
+#define OPTSTR_hexdump "bcCdn#<0os#<0vx[!bcCdox]"
+#ifdef CLEANUP_hexdump
+#undef CLEANUP_hexdump
+#undef FOR_hexdump
+#undef FLAG_x
+#undef FLAG_v
+#undef FLAG_s
+#undef FLAG_o
+#undef FLAG_n
+#undef FLAG_d
+#undef FLAG_C
+#undef FLAG_c
+#undef FLAG_b
+#endif
+
// hexedit <1>1r
#undef OPTSTR_hexedit
#define OPTSTR_hexedit "<1>1r"
@@ -2256,9 +2273,9 @@
#undef FLAG_c
#endif
-// pidof <1so:x <1so:x
+// pidof so:x so:x
#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
+#define OPTSTR_pidof "so:x"
#ifdef CLEANUP_pidof
#undef CLEANUP_pidof
#undef FOR_pidof
@@ -4709,6 +4726,21 @@
#define FLAG_a (1<<2)
#endif
+#ifdef FOR_hexdump
+#ifndef TT
+#define TT this.hexdump
+#endif
+#define FLAG_x (FORCED_FLAG<<0)
+#define FLAG_v (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_o (FORCED_FLAG<<3)
+#define FLAG_n (FORCED_FLAG<<4)
+#define FLAG_d (FORCED_FLAG<<5)
+#define FLAG_C (FORCED_FLAG<<6)
+#define FLAG_c (FORCED_FLAG<<7)
+#define FLAG_b (FORCED_FLAG<<8)
+#endif
+
#ifdef FOR_hexedit
#ifndef TT
#define TT this.hexedit
diff --git a/android/device/generated/globals.h b/android/device/generated/globals.h
index 1eede5a7..cb866143 100644
--- a/android/device/generated/globals.h
+++ b/android/device/generated/globals.h
@@ -117,7 +117,7 @@ struct passwd_data {
// toys/lsb/pidof.c
struct pidof_data {
- char *omit;
+ char *o;
};
// toys/lsb/seq.c
@@ -722,6 +722,19 @@ struct groupadd_data {
long gid;
};
+// toys/pending/hexdump.c
+
+struct hexdump_data {
+ long s, n;
+
+ long long len, pos, ppos;
+ const char *fmt;
+ unsigned int fn, bc; // file number and byte count
+ char linebuf[16]; // line buffer - serves double duty for sqeezing repeat
+ // lines and for accumulating full lines accross file
+ // boundaries if necessesary.
+};
+
// toys/pending/host.c
struct host_data {
@@ -1676,6 +1689,7 @@ extern union global_union {
struct getopt_data getopt;
struct getty_data getty;
struct groupadd_data groupadd;
+ struct hexdump_data hexdump;
struct host_data host;
struct ip_data ip;
struct ipcrm_data ipcrm;
diff --git a/android/device/generated/help.h b/android/device/generated/help.h
index 9a533c68..52624b88 100644
--- a/android/device/generated/help.h
+++ b/android/device/generated/help.h
@@ -72,7 +72,7 @@
#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
+#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME...]\n\nPrint the PIDs of all processes with the given names.\n\n-o Omit PID(s)\n-s Single shot, only return one pid\n-x Match shell scripts too"
#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
@@ -430,6 +430,10 @@
#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
+#define HELP_hd "usage: hd [FILE...]\n\nDisplay file(s) in cannonical hex+ASCII format."
+
+#define HELP_hexdump "usage: hexdump [-bcCdovx] [-n LEN] [-s SKIP] [FILE...]\n\nDump file(s) in hexadecimal format.\n\n-n LEN Show LEN bytes of output\n-s SKIP Skip bytes of input\n-v Verbose (don't combine identical lines)\n\nDisplay type:\n-b One byte octal -c One byte character -C Canonical (hex + ASCII)\n-d Two byte decimal -o Two byte octal -x Two byte hexadecimal (default)"
+
#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
diff --git a/android/device/generated/newtoys.h b/android/device/generated/newtoys.h
index ecbabab5..81d4725a 100644
--- a/android/device/generated/newtoys.h
+++ b/android/device/generated/newtoys.h
@@ -109,9 +109,11 @@ USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
+USE_HD(OLDTOY(hd, hexdump, TOYFLAG_USR|TOYFLAG_BIN))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
+USE_HEXDUMP(NEWTOY(hexdump, "bcCdn#<0os#<0vx[!bcCdox]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -199,7 +201,7 @@ USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4064=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
diff --git a/android/linux/generated/config.h b/android/linux/generated/config.h
index de38960f..82814f97 100644
--- a/android/linux/generated/config.h
+++ b/android/linux/generated/config.h
@@ -258,8 +258,12 @@
#define USE_HELP_EXTRAS(...)
#define CFG_HELP 0
#define USE_HELP(...)
+#define CFG_HEXDUMP 0
+#define USE_HEXDUMP(...)
#define CFG_HEXEDIT 0
#define USE_HEXEDIT(...)
+#define CFG_HD 0
+#define USE_HD(...)
#define CFG_HOSTID 0
#define USE_HOSTID(...)
#define CFG_HOST 0
diff --git a/android/linux/generated/flags.h b/android/linux/generated/flags.h
index c315a28a..78a35cb0 100644
--- a/android/linux/generated/flags.h
+++ b/android/linux/generated/flags.h
@@ -1267,6 +1267,23 @@
#undef FLAG_a
#endif
+// hexdump bcCdn#<0os#<0vx[!bcCdox]
+#undef OPTSTR_hexdump
+#define OPTSTR_hexdump "bcCdn#<0os#<0vx[!bcCdox]"
+#ifdef CLEANUP_hexdump
+#undef CLEANUP_hexdump
+#undef FOR_hexdump
+#undef FLAG_x
+#undef FLAG_v
+#undef FLAG_s
+#undef FLAG_o
+#undef FLAG_n
+#undef FLAG_d
+#undef FLAG_C
+#undef FLAG_c
+#undef FLAG_b
+#endif
+
// hexedit <1>1r
#undef OPTSTR_hexedit
#define OPTSTR_hexedit "<1>1r"
@@ -2256,9 +2273,9 @@
#undef FLAG_c
#endif
-// pidof <1so:x
+// pidof so:x
#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
+#define OPTSTR_pidof "so:x"
#ifdef CLEANUP_pidof
#undef CLEANUP_pidof
#undef FOR_pidof
@@ -4709,6 +4726,21 @@
#define FLAG_a (FORCED_FLAG<<2)
#endif
+#ifdef FOR_hexdump
+#ifndef TT
+#define TT this.hexdump
+#endif
+#define FLAG_x (FORCED_FLAG<<0)
+#define FLAG_v (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_o (FORCED_FLAG<<3)
+#define FLAG_n (FORCED_FLAG<<4)
+#define FLAG_d (FORCED_FLAG<<5)
+#define FLAG_C (FORCED_FLAG<<6)
+#define FLAG_c (FORCED_FLAG<<7)
+#define FLAG_b (FORCED_FLAG<<8)
+#endif
+
#ifdef FOR_hexedit
#ifndef TT
#define TT this.hexedit
diff --git a/android/linux/generated/globals.h b/android/linux/generated/globals.h
index 1eede5a7..cb866143 100644
--- a/android/linux/generated/globals.h
+++ b/android/linux/generated/globals.h
@@ -117,7 +117,7 @@ struct passwd_data {
// toys/lsb/pidof.c
struct pidof_data {
- char *omit;
+ char *o;
};
// toys/lsb/seq.c
@@ -722,6 +722,19 @@ struct groupadd_data {
long gid;
};
+// toys/pending/hexdump.c
+
+struct hexdump_data {
+ long s, n;
+
+ long long len, pos, ppos;
+ const char *fmt;
+ unsigned int fn, bc; // file number and byte count
+ char linebuf[16]; // line buffer - serves double duty for sqeezing repeat
+ // lines and for accumulating full lines accross file
+ // boundaries if necessesary.
+};
+
// toys/pending/host.c
struct host_data {
@@ -1676,6 +1689,7 @@ extern union global_union {
struct getopt_data getopt;
struct getty_data getty;
struct groupadd_data groupadd;
+ struct hexdump_data hexdump;
struct host_data host;
struct ip_data ip;
struct ipcrm_data ipcrm;
diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h
index 8a9f3aa6..cd0919a2 100644
--- a/android/linux/generated/help.h
+++ b/android/linux/generated/help.h
@@ -72,7 +72,7 @@
#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
+#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME...]\n\nPrint the PIDs of all processes with the given names.\n\n-o Omit PID(s)\n-s Single shot, only return one pid\n-x Match shell scripts too"
#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
@@ -432,6 +432,10 @@
#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
+#define HELP_hd "usage: hd [FILE...]\n\nDisplay file(s) in cannonical hex+ASCII format."
+
+#define HELP_hexdump "usage: hexdump [-bcCdovx] [-n LEN] [-s SKIP] [FILE...]\n\nDump file(s) in hexadecimal format.\n\n-n LEN Show LEN bytes of output\n-s SKIP Skip bytes of input\n-v Verbose (don't combine identical lines)\n\nDisplay type:\n-b One byte octal -c One byte character -C Canonical (hex + ASCII)\n-d Two byte decimal -o Two byte octal -x Two byte hexadecimal (default)"
+
#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
diff --git a/android/linux/generated/newtoys.h b/android/linux/generated/newtoys.h
index ecbabab5..81d4725a 100644
--- a/android/linux/generated/newtoys.h
+++ b/android/linux/generated/newtoys.h
@@ -109,9 +109,11 @@ USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
+USE_HD(OLDTOY(hd, hexdump, TOYFLAG_USR|TOYFLAG_BIN))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
+USE_HEXDUMP(NEWTOY(hexdump, "bcCdn#<0os#<0vx[!bcCdox]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -199,7 +201,7 @@ USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4064=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
diff --git a/android/mac/generated/config.h b/android/mac/generated/config.h
index 108ea0a8..48f344f4 100644
--- a/android/mac/generated/config.h
+++ b/android/mac/generated/config.h
@@ -258,8 +258,12 @@
#define USE_HELP_EXTRAS(...)
#define CFG_HELP 0
#define USE_HELP(...)
+#define CFG_HEXDUMP 0
+#define USE_HEXDUMP(...)
#define CFG_HEXEDIT 0
#define USE_HEXEDIT(...)
+#define CFG_HD 0
+#define USE_HD(...)
#define CFG_HOSTID 0
#define USE_HOSTID(...)
#define CFG_HOST 0
diff --git a/android/mac/generated/flags.h b/android/mac/generated/flags.h
index 568b3b49..dae3f5ec 100644
--- a/android/mac/generated/flags.h
+++ b/android/mac/generated/flags.h
@@ -1267,6 +1267,23 @@
#undef FLAG_a
#endif
+// hexdump bcCdn#<0os#<0vx[!bcCdox]
+#undef OPTSTR_hexdump
+#define OPTSTR_hexdump "bcCdn#<0os#<0vx[!bcCdox]"
+#ifdef CLEANUP_hexdump
+#undef CLEANUP_hexdump
+#undef FOR_hexdump
+#undef FLAG_x
+#undef FLAG_v
+#undef FLAG_s
+#undef FLAG_o
+#undef FLAG_n
+#undef FLAG_d
+#undef FLAG_C
+#undef FLAG_c
+#undef FLAG_b
+#endif
+
// hexedit <1>1r
#undef OPTSTR_hexedit
#define OPTSTR_hexedit "<1>1r"
@@ -2256,9 +2273,9 @@
#undef FLAG_c
#endif
-// pidof <1so:x
+// pidof so:x
#undef OPTSTR_pidof
-#define OPTSTR_pidof "<1so:x"
+#define OPTSTR_pidof "so:x"
#ifdef CLEANUP_pidof
#undef CLEANUP_pidof
#undef FOR_pidof
@@ -4709,6 +4726,21 @@
#define FLAG_a (FORCED_FLAG<<2)
#endif
+#ifdef FOR_hexdump
+#ifndef TT
+#define TT this.hexdump
+#endif
+#define FLAG_x (FORCED_FLAG<<0)
+#define FLAG_v (FORCED_FLAG<<1)
+#define FLAG_s (FORCED_FLAG<<2)
+#define FLAG_o (FORCED_FLAG<<3)
+#define FLAG_n (FORCED_FLAG<<4)
+#define FLAG_d (FORCED_FLAG<<5)
+#define FLAG_C (FORCED_FLAG<<6)
+#define FLAG_c (FORCED_FLAG<<7)
+#define FLAG_b (FORCED_FLAG<<8)
+#endif
+
#ifdef FOR_hexedit
#ifndef TT
#define TT this.hexedit
diff --git a/android/mac/generated/globals.h b/android/mac/generated/globals.h
index 1eede5a7..cb866143 100644
--- a/android/mac/generated/globals.h
+++ b/android/mac/generated/globals.h
@@ -117,7 +117,7 @@ struct passwd_data {
// toys/lsb/pidof.c
struct pidof_data {
- char *omit;
+ char *o;
};
// toys/lsb/seq.c
@@ -722,6 +722,19 @@ struct groupadd_data {
long gid;
};
+// toys/pending/hexdump.c
+
+struct hexdump_data {
+ long s, n;
+
+ long long len, pos, ppos;
+ const char *fmt;
+ unsigned int fn, bc; // file number and byte count
+ char linebuf[16]; // line buffer - serves double duty for sqeezing repeat
+ // lines and for accumulating full lines accross file
+ // boundaries if necessesary.
+};
+
// toys/pending/host.c
struct host_data {
@@ -1676,6 +1689,7 @@ extern union global_union {
struct getopt_data getopt;
struct getty_data getty;
struct groupadd_data groupadd;
+ struct hexdump_data hexdump;
struct host_data host;
struct ip_data ip;
struct ipcrm_data ipcrm;
diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h
index 8a9f3aa6..cd0919a2 100644
--- a/android/mac/generated/help.h
+++ b/android/mac/generated/help.h
@@ -72,7 +72,7 @@
#define HELP_seq "usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last\n\nCount from first to last, by increment. Omitted arguments default\nto 1. Two arguments are used as first and last. Arguments can be\nnegative or floating point.\n\n-f Use fmt_str as a printf-style floating point format string\n-s Use sep_str as separator, default is a newline character\n-w Pad to equal width with leading zeroes"
-#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...\n\nPrint the PIDs of all processes with the given names.\n\n-s Single shot, only return one pid\n-o Omit PID(s)\n-x Match shell scripts too"
+#define HELP_pidof "usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME...]\n\nPrint the PIDs of all processes with the given names.\n\n-o Omit PID(s)\n-s Single shot, only return one pid\n-x Match shell scripts too"
#define HELP_passwd_sad "Password changes are checked to make sure they're at least 6 chars long,\ndon't include the entire username (but not a subset of it), or the entire\nprevious password (but changing password1, password2, password3 is fine).\nThis heuristic accepts \"aaaaaa\" and \"123456\"."
@@ -432,6 +432,10 @@
#define HELP_host "usage: host [-av] [-t TYPE] NAME [SERVER]\n\nPerform DNS lookup on NAME, which can be a domain name to lookup,\nor an IPv4 dotted or IPv6 colon-separated address to reverse lookup.\nSERVER (if present) is the DNS server to use.\n\n-a -v -t ANY\n-t TYPE query records of type TYPE\n-v verbose"
+#define HELP_hd "usage: hd [FILE...]\n\nDisplay file(s) in cannonical hex+ASCII format."
+
+#define HELP_hexdump "usage: hexdump [-bcCdovx] [-n LEN] [-s SKIP] [FILE...]\n\nDump file(s) in hexadecimal format.\n\n-n LEN Show LEN bytes of output\n-s SKIP Skip bytes of input\n-v Verbose (don't combine identical lines)\n\nDisplay type:\n-b One byte octal -c One byte character -C Canonical (hex + ASCII)\n-d Two byte decimal -o Two byte octal -x Two byte hexadecimal (default)"
+
#define HELP_groupdel "usage: groupdel [USER] GROUP\n\nDelete a group or remove a user from a group"
#define HELP_groupadd "usage: groupadd [-S] [-g GID] [USER] GROUP\n\nAdd a group or add a user to a group\n\n -g GID Group id\n -S Create a system group"
diff --git a/android/mac/generated/newtoys.h b/android/mac/generated/newtoys.h
index ecbabab5..81d4725a 100644
--- a/android/mac/generated/newtoys.h
+++ b/android/mac/generated/newtoys.h
@@ -109,9 +109,11 @@ USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_GUNZIP(NEWTOY(gunzip, "cdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_GZIP(NEWTOY(gzip, "ncdfk123456789[-123456789]", TOYFLAG_USR|TOYFLAG_BIN))
USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
+USE_HD(OLDTOY(hd, hexdump, TOYFLAG_USR|TOYFLAG_BIN))
USE_HEAD(NEWTOY(head, "?n(lines)#<0=10c(bytes)#<0qv[-nc]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HELLO(NEWTOY(hello, 0, TOYFLAG_USR|TOYFLAG_BIN))
USE_HELP(NEWTOY(help, "ahu", TOYFLAG_BIN|TOYFLAG_MAYFORK))
+USE_HEXDUMP(NEWTOY(hexdump, "bcCdn#<0os#<0vx[!bcCdox]", TOYFLAG_USR|TOYFLAG_BIN))
USE_HEXEDIT(NEWTOY(hexedit, "<1>1r", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_HOST(NEWTOY(host, "<1>2avt:", TOYFLAG_USR|TOYFLAG_BIN))
USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN))
@@ -199,7 +201,7 @@ USE_PASSWD(NEWTOY(passwd, ">1a:dlu", TOYFLAG_STAYROOT|TOYFLAG_USR|TOYFLAG_BIN))
USE_PASTE(NEWTOY(paste, "d:s", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_LOCALE))
USE_PATCH(NEWTOY(patch, ">2(no-backup-if-mismatch)(dry-run)"USE_TOYBOX_DEBUG("x")"F#g#fulp#d:i:Rs(quiet)", TOYFLAG_USR|TOYFLAG_BIN))
USE_PGREP(NEWTOY(pgrep, "?cld:u*U*t*s*P*g*G*fnovxL:[-no]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_PIDOF(NEWTOY(pidof, "<1so:x", TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "so:x", TOYFLAG_BIN))
USE_PING(NEWTOY(ping, "<1>1m#t#<0>255=64c#<0=3s#<0>4064=56i%W#<0=3w#<0qf46I:[-46]", TOYFLAG_USR|TOYFLAG_BIN))
USE_PING(OLDTOY(ping6, ping, TOYFLAG_USR|TOYFLAG_BIN))
USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))