aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.h8
-rw-r--r--include/libbb.h9
-rw-r--r--include/unicode.h18
-rw-r--r--include/usage.h77
4 files changed, 80 insertions, 32 deletions
diff --git a/include/applets.h b/include/applets.h
index 83c1792ac..36b24856a 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -83,6 +83,7 @@ IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP))
83//IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP)) 83//IF_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_DROP))
84IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 84IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP))
85IF_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_DROP)) 85IF_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_DROP))
86IF_BOOTCHARTD(APPLET(bootchartd, _BB_DIR_SBIN, _BB_SUID_DROP))
86IF_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 87IF_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_DROP))
87IF_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 88IF_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_DROP))
88IF_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_DROP, bzcat)) 89IF_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_DROP, bzcat))
@@ -247,8 +248,8 @@ IF_LS(APPLET_NOEXEC(ls, ls, _BB_DIR_BIN, _BB_SUID_DROP, ls))
247IF_LSATTR(APPLET(lsattr, _BB_DIR_BIN, _BB_SUID_DROP)) 248IF_LSATTR(APPLET(lsattr, _BB_DIR_BIN, _BB_SUID_DROP))
248IF_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_DROP)) 249IF_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_DROP))
249IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, _BB_DIR_SBIN, _BB_SUID_DROP, modprobe)) 250IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, _BB_DIR_SBIN, _BB_SUID_DROP, modprobe))
250IF_LSPCI(APPLET(lspci, _BB_DIR_SBIN, _BB_SUID_DROP)) 251IF_LSPCI(APPLET(lspci, _BB_DIR_USR_BIN, _BB_SUID_DROP))
251IF_LSUSB(APPLET(lsusb, _BB_DIR_SBIN, _BB_SUID_DROP)) 252IF_LSUSB(APPLET(lsusb, _BB_DIR_USR_BIN, _BB_SUID_DROP))
252IF_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzmacat)) 253IF_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzmacat))
253IF_LZOP(APPLET(lzop, _BB_DIR_BIN, _BB_SUID_DROP)) 254IF_LZOP(APPLET(lzop, _BB_DIR_BIN, _BB_SUID_DROP))
254IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzopcat)) 255IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzopcat))
@@ -321,6 +322,7 @@ IF_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_DROP))
321IF_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 322IF_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_DROP))
322IF_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 323IF_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_DROP))
323IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, _BB_DIR_SBIN, _BB_SUID_DROP, restorecon)) 324IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, _BB_DIR_SBIN, _BB_SUID_DROP, restorecon))
325IF_RFKILL(APPLET(rfkill, _BB_DIR_USR_SBIN, _BB_SUID_DROP))
324IF_RM(APPLET_NOFORK(rm, rm, _BB_DIR_BIN, _BB_SUID_DROP, rm)) 326IF_RM(APPLET_NOFORK(rm, rm, _BB_DIR_BIN, _BB_SUID_DROP, rm))
325IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, _BB_DIR_BIN, _BB_SUID_DROP, rmdir)) 327IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, _BB_DIR_BIN, _BB_SUID_DROP, rmdir))
326IF_RMMOD(APPLET(rmmod, _BB_DIR_SBIN, _BB_SUID_DROP)) 328IF_RMMOD(APPLET(rmmod, _BB_DIR_SBIN, _BB_SUID_DROP))
@@ -403,7 +405,7 @@ IF_TRUE(APPLET_NOFORK(true, true, _BB_DIR_BIN, _BB_SUID_DROP, true))
403IF_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 405IF_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_DROP))
404IF_TTYSIZE(APPLET(ttysize, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 406IF_TTYSIZE(APPLET(ttysize, _BB_DIR_USR_BIN, _BB_SUID_DROP))
405IF_TUNCTL(APPLET(tunctl, _BB_DIR_SBIN, _BB_SUID_DROP)) 407IF_TUNCTL(APPLET(tunctl, _BB_DIR_SBIN, _BB_SUID_DROP))
406IF_MKFS_EXT2(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_DROP)) 408IF_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_DROP))
407IF_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_DROP)) 409IF_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_DROP))
408IF_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 410IF_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP))
409IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_DROP, udpsvd)) 411IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_DROP, udpsvd))
diff --git a/include/libbb.h b/include/libbb.h
index 11d7f27d3..58a5968c5 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -664,6 +664,15 @@ extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p) FAST_FUNC;
664extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 664extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
665/* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */ 665/* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */
666extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 666extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
667/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */
668#if ENABLE_FEATURE_SEAMLESS_LZMA \
669 || ENABLE_FEATURE_SEAMLESS_BZ2 \
670 || ENABLE_FEATURE_SEAMLESS_GZ \
671 /* || ENABLE_FEATURE_SEAMLESS_Z */
672extern int setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) FAST_FUNC;
673#else
674# define setup_unzip_on_fd(...) ((void)0)
675#endif
667/* Autodetects .gz etc */ 676/* Autodetects .gz etc */
668extern int open_zipped(const char *fname) FAST_FUNC; 677extern int open_zipped(const char *fname) FAST_FUNC;
669extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 678extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
diff --git a/include/unicode.h b/include/unicode.h
index 4e2927297..eaf67c833 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -30,12 +30,21 @@ enum {
30#else 30#else
31 31
32# if CONFIG_LAST_SUPPORTED_WCHAR < 126 || CONFIG_LAST_SUPPORTED_WCHAR >= 0x30000 32# if CONFIG_LAST_SUPPORTED_WCHAR < 126 || CONFIG_LAST_SUPPORTED_WCHAR >= 0x30000
33# define LAST_SUPPORTED_WCHAR 0x2ffff 33# undef CONFIG_LAST_SUPPORTED_WCHAR
34# else 34# define CONFIG_LAST_SUPPORTED_WCHAR 0x2ffff
35# define LAST_SUPPORTED_WCHAR CONFIG_LAST_SUPPORTED_WCHAR 35# endif
36
37# if CONFIG_LAST_SUPPORTED_WCHAR < 0x300
38# undef ENABLE_UNICODE_COMBINING_WCHARS
39# define ENABLE_UNICODE_COMBINING_WCHARS 0
40# endif
41
42# if CONFIG_LAST_SUPPORTED_WCHAR < 0x1100
43# undef ENABLE_UNICODE_WIDE_WCHARS
44# define ENABLE_UNICODE_WIDE_WCHARS 0
36# endif 45# endif
37 46
38# if LAST_SUPPORTED_WCHAR < 0x590 47# if CONFIG_LAST_SUPPORTED_WCHAR < 0x590
39# undef ENABLE_UNICODE_BIDI_SUPPORT 48# undef ENABLE_UNICODE_BIDI_SUPPORT
40# define ENABLE_UNICODE_BIDI_SUPPORT 0 49# define ENABLE_UNICODE_BIDI_SUPPORT 0
41# endif 50# endif
@@ -92,6 +101,7 @@ size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) FAST_FUNC;
92int iswspace(wint_t wc) FAST_FUNC; 101int iswspace(wint_t wc) FAST_FUNC;
93int iswalnum(wint_t wc) FAST_FUNC; 102int iswalnum(wint_t wc) FAST_FUNC;
94int iswpunct(wint_t wc) FAST_FUNC; 103int iswpunct(wint_t wc) FAST_FUNC;
104int wcwidth(unsigned ucs) FAST_FUNC;
95# if ENABLE_UNICODE_BIDI_SUPPORT 105# if ENABLE_UNICODE_BIDI_SUPPORT
96# undef unicode_bidi_isrtl 106# undef unicode_bidi_isrtl
97int unicode_bidi_isrtl(wint_t wc) FAST_FUNC; 107int unicode_bidi_isrtl(wint_t wc) FAST_FUNC;
diff --git a/include/usage.h b/include/usage.h
index 4568fac9f..3fce939bb 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -154,18 +154,15 @@
154 "\n -r Repetitions" \ 154 "\n -r Repetitions" \
155 "\n -n Start new tone" \ 155 "\n -n Start new tone" \
156 156
157#define fbsplash_trivial_usage \ 157#define bootchartd_trivial_usage \
158 "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]" 158 "start [PROG ARGS]|stop|init"
159#define fbsplash_full_usage "\n\n" \ 159#define bootchartd_full_usage "\n\n" \
160 "Options:" \ 160 "Create /var/log/bootchart.tgz with boot chart data\n" \
161 "\n -s Image" \ 161 "\nOptions:" \
162 "\n -c Hide cursor" \ 162 "\nstart: start background logging; with PROG, run PROG, then kill logging with USR1" \
163 "\n -d Framebuffer device (default /dev/fb0)" \ 163 "\nstop: send USR1 to all bootchartd processes" \
164 "\n -i Config file (var=value):" \ 164 "\ninit: start background logging; stop when getty/xdm is seen (for init scripts)" \
165 "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" \ 165 "\nUnder PID 1: as init, then exec $bootchart_init, /init, /sbin/init" \
166 "\n BAR_R,BAR_G,BAR_B" \
167 "\n -f Control pipe (else exit after drawing image)" \
168 "\n commands: 'NN' (% for progress bar) or 'exit'" \
169 166
170#define brctl_trivial_usage \ 167#define brctl_trivial_usage \
171 "COMMAND [BRIDGE [INTERFACE]]" 168 "COMMAND [BRIDGE [INTERFACE]]"
@@ -504,9 +501,9 @@
504 "Clear screen" 501 "Clear screen"
505 502
506#define cmp_trivial_usage \ 503#define cmp_trivial_usage \
507 "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]") "]]" 504 "[-l] [-s] FILE1 [FILE2" IF_DESKTOP(" [SKIP1 [SKIP2]]") "]"
508#define cmp_full_usage "\n\n" \ 505#define cmp_full_usage "\n\n" \
509 "Compares FILE1 vs stdin if FILE2 is not specified\n" \ 506 "Compare FILE1 with FILE2 (or stdin)\n" \
510 "\nOptions:" \ 507 "\nOptions:" \
511 "\n -l Write the byte numbers (decimal) and values (octal)" \ 508 "\n -l Write the byte numbers (decimal) and values (octal)" \
512 "\n for all differing bytes" \ 509 "\n for all differing bytes" \
@@ -515,7 +512,7 @@
515#define comm_trivial_usage \ 512#define comm_trivial_usage \
516 "[-123] FILE1 FILE2" 513 "[-123] FILE1 FILE2"
517#define comm_full_usage "\n\n" \ 514#define comm_full_usage "\n\n" \
518 "Compare FILE1 to FILE2, or to stdin if - is specified\n" \ 515 "Compare FILE1 with FILE2\n" \
519 "\nOptions:" \ 516 "\nOptions:" \
520 "\n -1 Suppress lines unique to FILE1" \ 517 "\n -1 Suppress lines unique to FILE1" \
521 "\n -2 Suppress lines unique to FILE2" \ 518 "\n -2 Suppress lines unique to FILE2" \
@@ -652,8 +649,16 @@
652 "\n -S SALT" \ 649 "\n -S SALT" \
653 ) \ 650 ) \
654 651
655#define cttyhack_trivial_usage NOUSAGE_STR 652#define cttyhack_trivial_usage \
656#define cttyhack_full_usage "" 653 "PROG ARGS"
654#define cttyhack_full_usage "\n\n" \
655 "Give PROG a controlling tty if possible." \
656 "\nExample for /etc/inittab (for busybox init):" \
657 "\n ::respawn:/bin/cttyhack /bin/sh" \
658 "\nGiving controlling tty to shell running with PID 1:" \
659 "\n $ exec cttyhack sh" \
660 "\nStarting interactive shell from boot shell script:" \
661 "\n setsid cttyhack sh" \
657 662
658#define cut_trivial_usage \ 663#define cut_trivial_usage \
659 "[OPTIONS] [FILE]..." 664 "[OPTIONS] [FILE]..."
@@ -1174,6 +1179,19 @@
1174 "$ echo $?\n" \ 1179 "$ echo $?\n" \
1175 "1\n" 1180 "1\n"
1176 1181
1182#define fbsplash_trivial_usage \
1183 "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]"
1184#define fbsplash_full_usage "\n\n" \
1185 "Options:" \
1186 "\n -s Image" \
1187 "\n -c Hide cursor" \
1188 "\n -d Framebuffer device (default /dev/fb0)" \
1189 "\n -i Config file (var=value):" \
1190 "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" \
1191 "\n BAR_R,BAR_G,BAR_B" \
1192 "\n -f Control pipe (else exit after drawing image)" \
1193 "\n commands: 'NN' (% for progress bar) or 'exit'" \
1194
1177#define fbset_trivial_usage \ 1195#define fbset_trivial_usage \
1178 "[OPTIONS] [MODE]" 1196 "[OPTIONS] [MODE]"
1179#define fbset_full_usage "\n\n" \ 1197#define fbset_full_usage "\n\n" \
@@ -1531,8 +1549,7 @@
1531 "\n -H HOST Log HOST into the utmp file as the hostname" \ 1549 "\n -H HOST Log HOST into the utmp file as the hostname" \
1532 1550
1533#define grep_trivial_usage \ 1551#define grep_trivial_usage \
1534 "[-HhnlLoqvsri" \ 1552 "[-HhnlLoqvsriw" \
1535 IF_DESKTOP("w") \
1536 "F" \ 1553 "F" \
1537 IF_FEATURE_GREP_EGREP_ALIAS("E") \ 1554 IF_FEATURE_GREP_EGREP_ALIAS("E") \
1538 IF_EXTRA_COMPAT("z") \ 1555 IF_EXTRA_COMPAT("z") \
@@ -1554,9 +1571,7 @@
1554 "\n -s Suppress open and read errors" \ 1571 "\n -s Suppress open and read errors" \
1555 "\n -r Recurse" \ 1572 "\n -r Recurse" \
1556 "\n -i Ignore case" \ 1573 "\n -i Ignore case" \
1557 IF_DESKTOP( \
1558 "\n -w Match whole words only" \ 1574 "\n -w Match whole words only" \
1559 ) \
1560 "\n -F PATTERN is a literal (not regexp)" \ 1575 "\n -F PATTERN is a literal (not regexp)" \
1561 IF_FEATURE_GREP_EGREP_ALIAS( \ 1576 IF_FEATURE_GREP_EGREP_ALIAS( \
1562 "\n -E PATTERN is an extended regexp" \ 1577 "\n -E PATTERN is an extended regexp" \
@@ -3741,6 +3756,18 @@
3741 "\n for customizable files, or the user section," \ 3756 "\n for customizable files, or the user section," \
3742 "\n if it has changed" \ 3757 "\n if it has changed" \
3743 3758
3759#define rfkill_trivial_usage \
3760 "COMMAND [INDEX|TYPE]"
3761#define rfkill_full_usage "\n\n" \
3762 "Enable/disable wireless devices\n" \
3763 "\nCommands:" \
3764 "\n list [INDEX|TYPE] List current state" \
3765 "\n block INDEX|TYPE Disable device" \
3766 "\n unblock INDEX|TYPE Enable device" \
3767 "\n" \
3768 "\n TYPE: all, wlan(wifi), bluetooth, uwb(ultrawideband)," \
3769 "\n wimax, wwan, gps, fm" \
3770
3744#define rm_trivial_usage \ 3771#define rm_trivial_usage \
3745 "[OPTIONS] FILE..." 3772 "[OPTIONS] FILE..."
3746#define rm_full_usage "\n\n" \ 3773#define rm_full_usage "\n\n" \
@@ -3791,13 +3818,13 @@
3791 "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family" \ 3818 "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family" \
3792 3819
3793#define rpm_trivial_usage \ 3820#define rpm_trivial_usage \
3794 "-i -q[ildc]p PACKAGE.rpm" 3821 "-i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm"
3795#define rpm_full_usage "\n\n" \ 3822#define rpm_full_usage "\n\n" \
3796 "Manipulate RPM packages\n" \ 3823 "Manipulate RPM packages\n" \
3797 "\nOptions:" \ 3824 "\nCommands:" \
3798 "\n -i Install package" \ 3825 "\n -i Install package" \
3799 "\n -q Query package" \ 3826 "\n -qp Query package" \
3800 "\n -p Query uninstalled package" \ 3827 "\nOptions:" \
3801 "\n -i Show information" \ 3828 "\n -i Show information" \
3802 "\n -l List contents" \ 3829 "\n -l List contents" \
3803 "\n -d List documents" \ 3830 "\n -d List documents" \