Changed ERROR_FREQUENCY to runtime -x option.
Changed ERROR_VOLUME to runtime -X option.
Dropped BSD signal and tty support, it's all POSIX now.
- Wrote the manual page.
+ QSO assumes that srand48/lrand48 is available, so morse will too.
Wrote the manual page.
Updated all code to use ANSI prototypes.
#DEVICE = Linux
DEVICE = OSS
-#
-# For alternate random number generator, add either -DUSELRAND for lrand48(),
-# or -DUSERAND for (ugh) rand(). Default is -DUSERANDOM for random().
-#DEFINES = -DUSELRAND
-#DEFINES =
-
VERS=$(shell sed <morse.spec -n -e '/Version: \(.*\)/s//\1/p')
BEEPERS = beepLinux.c beepOSS.c beepX11.c
-SOURCES = alarm.c morse.c alarm.h beep.h $(BEEPERS)
+SOURCES = alarm.c morse.c alarm.h beep.h $(BEEPERS)
MANPAGES = morse.1 QSO.1
DOCS = README HISTORY morse.xml morse.spec $(MANPAGES)
ALL= $(DOCS) Makefile $(SOURCES) test_input qso/*.[ch] qso/Makefile
# The flags necessary to link with the X11 libraries.
-#X11LIBS = -L/usr/X11/lib -lX11 -lsocket -lnsl
X11LIBS = -L/usr/X11/lib -lX11
# Any additional flags your favorite C compiler requires to work.
*/
#undef FLUSHCODE
-/*
- * Choose your favorite random number generator!
- */
-#ifndef USERANDOM
-#ifndef USELRAND
-#ifndef USERAND
-#define USERANDOM /* USELRAND or USERAND are the other choices */
-#endif
-#endif
-#endif
-
-#ifdef USERANDOM
-#define RANDOM() random()
-#define SEEDRANDOM(s) srandom((int)s)
-#endif
-#ifdef USELRAND
-#define RANDOM() lrand48()
-#define SEEDRANDOM(s) srand48((long)(s))
-long lrand48 ();
-#endif
-#ifdef USERAND
-/*
- * UGH, are you really sure you want to use this one?
- * This one really stinks!
- */
-#define RANDOM() rand()
-#define SEEDRANDOM(s) srand((int)(s))
-int rand ();
-#endif
-
static void new_words_per_minute (void);
static void dowords (int c);
static void morse (int c);
}
else if (randomletters)
{
- SEEDRANDOM (time (NULL));
+ srand48(time (NULL));
randexp = 1. / (1. - 1. / (float) (RANDWORDLEN));
while (1)
{
/* Shift a few bits because the lower bits stink */
/* Add in the time so it doesn't repeat from run to run */
randnum = (float) (
- (((RANDOM () >> 9) + (long) (time (NULL))) >> 4)
+ (((lrand48() >> 9) + (long) (time (NULL))) >> 4)
& 0x00FFFFFF);
randnum = randnum - randexp * (int) (randnum / randexp);
if ((randnum >= 1.) && (linepos != 0)) dowords ((int) ' ');
*/
do
{
- ranspot = ((RANDOM () >> 4) % sum + norepeat) % sum;
+ ranspot = ((lrand48() >> 4) % sum + norepeat) % sum;
sum2 = 0;
for (ii = 0; ii < TWOFIFTYSIX - 1; ii++)
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-root
-%description
-morse is a training program for aspiring radio hams. It can generate
-random tests or simulated QSOs resembling those used in the ARRL test
-(a QSO generator is included). There are a plethora of options to
-vary the training method. In one mode, it will take text input from
-standard input and render it as more beeps.
+%description
+morse is a Morse-code training program for aspiring radio hams. It
+can generate random tests or simulated QSOs resembling those used in
+the ARRL test (a QSO generator is included). There are a plethora of
+options to vary the training method. In one of the simpler modes,
+this program will take text from standard input and render it as
+Morse-code beeps.
%prep
%setup -q