* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#ifdef __hpux
#define USG
#endif
-/*
- * Define the return type of a signal handler. Defaults to void, which is
- * what most modern systems are using these days.
- */
-#ifndef SIGRET
-#define SIGRET void
-#endif
#define FREQUENCY 800.
#define FREQUENCY2 602.
static int errorlog[TWOFIFTYSIX];
static int randomfactor[TWOFIFTYSIX];
static int randomripe[TWOFIFTYSIX];
-extern int testterminal ();
-extern int randomletter ();
+static int testterminal (void);
+static int randomletter (void);
/*
* Pointers to termcap/terminfo "smso/so" (enter_standout_mode) and "rmso/se"
* with ANSI sequences "\E[7m" to turn the inverse video mode on and "\E[0m"
* to turn all video attributes off).
*/
-char *enter_standout_mode = "\033[7m";
-char *exit_standout_mode = "\033[0m";
+static const char *enter_standout_mode = "\033[7m";
+static const char *exit_standout_mode = "\033[0m";
/*
* Value of (Wrong - Right), which, if exceeded, will cause the program
int rand ();
#endif
-void new_words_per_minute (void);
-void dowords (int c);
-void morse (int c);
-void show (char *s);
-void testaddchar (char c);
-void youraddchar (char c);
-void pollyou (void);
-void tone (float hertz, float duration, float amplitude);
-void toneflush (void);
-void openterminal (void);
-int readterminal (char **string);
-void closeterminal (void);
-void report (void);
-
-SIGRET die (), suspend ();
-void cleanup ();
+static void new_words_per_minute (void);
+static void dowords (int c);
+static void morse (int c);
+static void show (char *s);
+static void testaddchar (char c);
+static void youraddchar (char c);
+static void pollyou (void);
+static void tone (float hertz, float duration, float amplitude);
+static void toneflush (void);
+static void openterminal (void);
+static int readterminal (char **string);
+static void closeterminal (void);
+static void report (void);
+
+static void die (), suspend ();
+static void cleanup ();
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
extern char *optarg;
extern int optind;
/*----------------------------------------*/
-void
-tone (hertz, duration, amplitude)
- float hertz, duration, amplitude;
+static void
+tone (float hertz, float duration, float amplitude)
{
Beep ((int) (duration * 1000), (int) (amplitude * 100), (int) hertz);
}
-void
-toneflush ()
+static void
+toneflush (void)
{
BeepWait ();
}
return n;
}
-void
+static void
closeterminal ()
{
#ifdef USG
close (termfd);
}
-SIGRET
+static void
die ()
{
cleanup ();
exit (1);
}
-void
+static void
cleanup ()
{
if (termopen)
BeepCleanup ();
}
-SIGRET
+static void
suspend ()
{
signal (SIGTSTP, suspend);
/*----------------------------------------*/
-int
-randomletter ()
+static int
+randomletter (void)
{
int ii;
int sum, sum2;