hush: do not accept "if() { echo; }" function def
[oweals/busybox.git] / miscutils / beep.c
index c7699ffe1ff4fb399df3d91d0b588a7abb798f59..b9b62f79be691d3be3cff96c58c4ac5d1c9189f6 100644 (file)
@@ -7,12 +7,37 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  *
  */
+//config:config BEEP
+//config:      bool "beep (3 kb)"
+//config:      default y
+//config:      select PLATFORM_LINUX
+//config:      help
+//config:      The beep applets beeps in a given freq/Hz.
+//config:
+//config:config FEATURE_BEEP_FREQ
+//config:      int "default frequency"
+//config:      range 20 50000  # allowing 0 here breaks the build
+//config:      default 4000
+//config:      depends on BEEP
+//config:      help
+//config:      Frequency for default beep.
+//config:
+//config:config FEATURE_BEEP_LENGTH_MS
+//config:      int "default length"
+//config:      range 0 2147483647
+//config:      default 30
+//config:      depends on BEEP
+//config:      help
+//config:      Length in ms for default beep.
+
+//applet:IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_BEEP) += beep.o
 
 //usage:#define beep_trivial_usage
 //usage:       "-f FREQ -l LEN -d DELAY -r COUNT -n"
 //usage:#define beep_full_usage "\n\n"
-//usage:       "Options:"
-//usage:     "\n       -f      Frequency in Hz"
+//usage:       "       -f      Frequency in Hz"
 //usage:     "\n       -l      Length in ms"
 //usage:     "\n       -d      Delay in ms"
 //usage:     "\n       -r      Repetitions"
@@ -89,7 +114,7 @@ int beep_main(int argc, char **argv)
                        bb_show_usage();
                }
                while (rep) {
-//bb_info_msg("rep[%d] freq=%d, length=%d, delay=%d", rep, freq, length, delay);
+//bb_error_msg("rep[%d] freq=%d, length=%d, delay=%d", rep, freq, length, delay);
                        xioctl(speaker, KIOCSOUND, (void*)(uintptr_t)tickrate_div_freq);
                        usleep(1000 * length);
                        ioctl(speaker, KIOCSOUND, (void*)0);