Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-vdr committed Sep 13, 2023
0 parents commit 406bea6
Show file tree
Hide file tree
Showing 32 changed files with 2,068 additions and 0 deletions.
Empty file added AUTHORS
Empty file.
481 changes: 481 additions & 0 deletions COPYING

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
see doc/HISTORY
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
beep2 license description.
Copyright (C) 2002 YAMAGUCHI Shingo <[email protected]>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS=src man
Empty file added NEWS
Empty file.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
see doc/
79 changes: 79 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT([beep2], 1.3, [[email protected]])

# OSTYPE
AC_CANONICAL_SYSTEM

# automake
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION, no-define)

AC_CONFIG_SRCDIR([src/beep.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h syslog.h unistd.h])
#
#AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h])
#AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h pwd.h sys/types.h syslog.h])
#AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h ctype.h])
#AC_CHECK_HEADERS([stdio.h ctype.h])
#AC_CHECK_HEADERS([stdio.h ctype.h])
#AC_CHECK_HEADERS([string.h])
#AC_CHECK_HEADERS([stdio.h])
#AC_CHECK_HEADERS([stdio.h])
AC_CHECK_HEADERS([stdio.h pwd.h sys/types.h syslog.h ctype.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T

# Checks for library functions.
AC_FUNC_MALLOC

# output device
AC_ARG_WITH(output-device,
[[ --with-output-device=/foo output device /foo [/dev/console]]])

if test "x$with_output_device" = "x" ; then
OUTPUT_DEVICE=/dev/console
else
OUTPUT_DEVICE="$with_output_device"
fi
AC_SUBST(OUTPUT_DEVICE)
AC_DEFINE_UNQUOTED(OUTPUT_DEVICE, "$OUTPUT_DEVICE",[Output device])

# syslog
AC_MSG_CHECKING([whether to build support for the system logging])
AC_ARG_ENABLE([syslog],
[ --disable-syslog disable system logging],
[SYSTEM_LOGGING=no], [SYSTEM_LOGGING=yes])
AC_MSG_RESULT([$SYSTEM_LOGGING])
if test "x$SYSTEM_LOGGING" = "xyes"; then
SYSTEM_LOGGING="-DSYSTEM_LOGGING"
else
SYSTEM_LOGGING=
fi
AC_SUBST([SYSTEM_LOGGING])

# FreeBSD
case $target_os in
*bsd*) OSTYPE_BSD="-DOSTYPE_BSD" ;;
esac
AC_SUBST([OSTYPE_BSD])

AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
man/en/Makefile
man/ja/Makefile])
AC_OUTPUT
68 changes: 68 additions & 0 deletions doc/HISTORY
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
beep2 version
Original Copyright (C) 1997 Josef Pavlik <[email protected]>
Copyright (C) 2002 YAMAGUCHI Shingo <[email protected]>

2004/09/25
version 1.3 - dai@kip <[email protected]>
* autoconficate
* expansion OUTPUT_DEVICE

2002/01/10
version 1.2a

* security hole (local users read all files when beep2 is installed on
setuid-root) fixed.

2000/10/17
version 1.2

* add logging function(use syslog).
* add information of included function to "-v" option.
* fix usage-output missmatch.
* fix argv[i] debug message ("(null)" included bug).


2000/10/02
version 1.1

* add "tempo control" option "-t".
* add "show version" option "-v".
* fixing score => frequency table (12-average).


2000/09/25
version 1.0a

* include the patch which releases Linux kernel limitation.
* change manual and documentation.


2000/09/22
beep2 version 1.0 (by YAMAGUCHI Shingo)

Initial public release.

append

* debug option.
* stdin frequency/score input.
* score input mode.
* FreeBSD support.
* manual page.
* documentation (include Japanese).

delete

* commandline frequency input.
* commandline selection of output device.
* direct I/O access source.


1997/10/04
console beep version 0.1 (by Josef Pavlik)

* frequency input mode.
* commandline frequency input.
* output device selectable.
* Linux support.
* documentation.
42 changes: 42 additions & 0 deletions doc/INSTALL.en
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
beep2 version 1.2a install instruction.
Copyright (C) 2002 YAMAGUCHI Shingo <[email protected]>

Quick install

1. Edit "Makefile" and set install path (binary and manual). If you
do not use Japanese manual, Please comment out these lines.

install.man:
gzip -c9 man/en/beep2.1 > man/en/beep2.1.gz
install -m 0644 man/en/beep2.1.gz $(MANDIR)
// gzip -c9 man/ja/beep2.1 > man/ja/beep2.1.gz <= comment out
// install -m 0644 man/ja/beep2.1.gz $(JMANDIR) <= comment out

2. Edit "config.h" and set output device.

If you need not to use logging function, disable "SYSTEM_LOGGING"
option. The default is enabled.

If you use FreeBSD or any other BSD-like OS, enable "OSTYPE_BSD"
option. The default is impremented for Linux.

3. Run "make".

4. Run "make install" as root.

5. (Optional) Config syslog.


Caution

This program runs on below platforms:

Linux 2.2 (ix86, glibc 2.1)
Linux 2.2 (ix86, libc 5.4.46)
Linux 2.2 (PowerPC, linuxPPC, glibc 2.0.7)
FreeBSD 4.0 release (ix86)
FreeBSD 4.1 release (ix86)

If you run it any other platform, please tell author.

It does not run on "HARDWARE LIMITED" beep systems like Sun WS.
40 changes: 40 additions & 0 deletions doc/INSTALL.ja
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
beep2 version 1.2a $B%$%s%9%H!<%k2r@b(B
Copyright (C) 2002 YAMAGUCHI Shingo <[email protected]>

Quick install

1. Makefile $B$rJT=8$7$F<B9T%U%!%$%k$H%^%K%e%"%k$N%$%s%9%H!<%k@h$r(B
$BE,@Z$K@_Dj$7$F$/$@$5$$!#(B

2. config.h $B$rJT=8$7$F=PNO%G%P%$%9$r@_Dj$7$F$/$@$5$$!#DL>o$O%G%U%)%k%H(B
$B$N$^$^$G9=$$$^$;$s!#(B

$B%G%U%)%k%H$G$O%m%05!G=$,M-8z$K$J$C$F$$$^$9$,!"$b$7L58z$K$7$?$$>l9g$O(B
SYSTEM_LOGGING $B$rL58z$K$7$F$/$@$5$$!#(B

$B$b$7(B FreeBSD $B$J$I$N(B BSD $B7O(B OS $B$r$*;H$$$J$i(B OSTYPE_BSD $B%*%W%7%g%s$r(B
$BM-8z$K$7$F$/$@$5$$!#%G%U%)%k%H$G$O(B Linux $BMQ$N<BAu$H$J$j$^$9!#(B

3. make $B$7$^$9!#(B

4. root $B$G(B make install $B$7$^$9!#(B

5. ($B%*%W%7%g%s(B) syslog $B$rE,59@_Dj$7$F$/$@$5$$!#(B

$BCm0U(B

$B$3$N%W%m%0%i%`$O0J2<$N4D6-$GF0:n3NG'$5$l$F$$$^$9!#(B

Linux 2.2 (ix86, glibc 2.1)
Linux 2.2 (ix86, libc 5.4.46)
Linux 2.2 (PowerPC, LinuxPPC, glibc 2.0.7)
FreeBSD 4.0 release (ix86)
FreeBSD 4.1 release (ix86)

$B$3$l0J30$N4D6-$GF0:n$5$l$?J}$O:n<T$^$G$4Js9p$$$?$@$1$l$P9,$$$G$9!#(B
$BFC$K(B ix86 $B0J30$N4D6-$G$N%F%9%H$,9T$o$l$F$$$J$$$N$G$h$m$7$/$*4j$$(B
$B$7$^$9!#(B

$B$J$*!"(BSun WS $B$N$h$&$K!"J*M}E*$JJQ99$G$7$+<~GH?tJQ2=$,$G$-$J$$(B
$B%S!<%W5!9=$rEk:\$7$F$$$k5!<o$G$OF0:n$7$F$b$"$^$j0UL#$,$J$$$H(B
$B;W$$$^$9!#(B
134 changes: 134 additions & 0 deletions doc/README.en
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
beep2 version 1.2a
Original Copyright (C) 1997 Josef Pavlik <[email protected]>
Copyright (C) 2002 YAMAGUCHI Shingo <[email protected]>

1. Usage

beep2 [-dfs] [-t tempo] [file]
beep2 -v

'-d' option is "debug mode".
'-f' option is "frequency input mode". This is the same as console
beep V0.1.
'-s' option is "score mode".
'-t' option is "tempo change". tempo change into "tempo" %.
'-v' option is "show version and included function".


2. Frequency input mode
If frequency is 0, then delay(rest).
Frequency is in Hz, length is in milliseconds.

2.1 Input format
Please see sample file "ring.bpf" to more detail.

freq duration
freq duration
freq duration # comment
# comment
...

2.2 Execution example

(1) sound 1 kHz for 0.5 sec.

% beep2[Enter]
1000 500[Enter]
[Ctrl+d]

(2) ring the file "ring.bpf"

% beep2 ./ring.bpf[Enter]

(3) 750ms delay

% beep2[Enter]
0 750[Enter]
[Ctrl+d]

If first line of file is

#!/usr/bin/beep2

and file has attribute x, you may run it immediately.


3. Score input mode
If the score field is "-", then delay(rest).
The score input is in below:

C4 - base score
C5# - "C5" + sharp
--- - rest

You can set octave from 1 to 9, and set score from C1 to B9.

3.1 Input format
Please see sample file "ring.bps" to more detail.

score length
score length
score length # comment
# comment
...

3.2 Execution example
(1) sound C5 for 0.5 sec.

% beep2 -s[Enter]
C5 500[Enter]
[Ctrl+d]

(2) ring the file "ring.bps"

% beep2 -s ./ring.bps[Enter]

(3) 750ms delay

% beep2 -s[Enter]
--- 750[Enter]
[Ctrl+d]

If first line of file is

#!/usr/bin/beep2 -s

and file has attribute x, you may run it immediately.


4. About logging function
beep2 is added logging function since version 1.2. You can use this
function if you enable it when you compile this program.

The log is sent to syslog at user.info priority. Generally, it is
written to /var/log/messages. It includes the information of executed
real user name and executed command string.

If you want to change log file, you need to edit syslog.conf (generally
placed at /etc) and configure. The detail is in syslog documents.


5. About "longbeep-linux.patch"
Because of the Linux console driver limitation, beep2 can not ring
over 2000 ms. This patch releases this limitation and expands length
to 9999 ms.

If you want to use this patch, go to drivers/char on the Linux kernel
directory and run patch command. That is:

# cd /usr/src/linux/drivers/char
# patch < /foo/bar/longbeep-linux.patch

This patch is NO WARRANTY and is used at your own risk.
If you use non-Linux OS, you need not use this patch.


6. Warning
This program installs as root setuid-ed. Please consider with
seculity policy and set execute attribute for trasted users only.


7. Newest release

http://www.kip.iis.toyama-u.ac.jp/~shingo/beep/index.html (English)
http://www.kip.iis.toyama-u.ac.jp/~shingo/beep/index-j.html (Japanese)
Loading

0 comments on commit 406bea6

Please sign in to comment.