summaryrefslogtreecommitdiff
path: root/zwgc/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'zwgc/main.c')
-rw-r--r--zwgc/main.c66
1 files changed, 38 insertions, 28 deletions
diff --git a/zwgc/main.c b/zwgc/main.c
index 52b9e7a..3568443 100644
--- a/zwgc/main.c
+++ b/zwgc/main.c
@@ -40,10 +40,13 @@ static const char rcsid_main_c[] = "$Id$";
#include "variables.h"
#include "main.h"
-extern void notice_handler();
-static void process_notice(), setup_signals(), detach(), signal_exit();
+void notice_handler(ZNotice_t *);
+static void process_notice(ZNotice_t *, char *);
+static void setup_signals(int);
+static void detach(void);
+static void signal_exit(int);
#ifdef HAVE_ARES
-static void notice_callback();
+static void notice_callback(void *, int, struct hostent *);
#endif
/*
@@ -105,7 +108,8 @@ static struct _Node *program = NULL;
* <<<>>>
*/
-static void fake_startup_packet()
+static void
+fake_startup_packet(void)
{
ZNotice_t notice;
struct timezone tz;
@@ -122,7 +126,7 @@ static void fake_startup_packet()
notice.z_default_format = "Zwgc mark II version $version now running...\n";
notice.z_recipient = "";
notice.z_sender = "ZWGC";
- gettimeofday(&notice.z_time,&tz);
+ Z_gettimeofday(&notice.z_time, &tz);
notice.z_port = 0;
notice.z_kind = ACKED;
notice.z_auth = ZAUTH_YES;
@@ -134,7 +138,8 @@ static void fake_startup_packet()
process_notice(&notice, NULL);
}
-static void read_in_description_file()
+static void
+read_in_description_file(void)
{
FILE *input_file;
char defdesc[128];
@@ -163,7 +168,8 @@ static void read_in_description_file()
* program with error code 1.
*/
-void usage()
+void
+usage(void)
{
#ifdef DEBUG
fprintf(stderr, "\
@@ -185,7 +191,8 @@ zwgc: usage: zwgc [-f <filename>] [-subfile <filename>]\n\
* <<<>>>
*/
-static void run_initprogs()
+static void
+run_initprogs(void)
{
/*
* This code stolen from old zwgc: yuck. Clean up & fix. <<<>>>
@@ -214,9 +221,9 @@ static void run_initprogs()
* main -- the program entry point. Does parsing & top level control.
*/
-int main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc,
+ char **argv)
{
char **new;
register char **current;
@@ -321,8 +328,8 @@ int main(argc, argv)
#define USER_SUPPRESS "SUPPRESS"
#define USER_UNSUPPRESS "UNSUPPRESS"
-void notice_handler(notice)
- ZNotice_t *notice;
+void
+notice_handler(ZNotice_t *notice)
{
struct hostent *fromhost = NULL;
@@ -343,10 +350,10 @@ void notice_handler(notice)
}
#ifdef HAVE_ARES
-static void notice_callback(arg, status, fromhost)
- void *arg;
- int status;
- struct hostent *fromhost;
+static void
+notice_callback(void *arg,
+ int status,
+ struct hostent *fromhost)
{
ZNotice_t *notice = (ZNotice_t *) arg;
@@ -356,9 +363,9 @@ static void notice_callback(arg, status, fromhost)
}
#endif
-static void process_notice(notice, hostname)
- ZNotice_t *notice;
- char *hostname;
+static void
+process_notice(ZNotice_t *notice,
+ char *hostname)
{
char *control_opcode;
@@ -400,7 +407,7 @@ static void process_notice(notice, hostname)
free(instance);
free(recipient);
} else if (!strcasecmp(control_opcode, USER_EXIT)) {
- signal_exit();
+ signal_exit(0);
} else
printf("zwgc: unknown control opcode %s.\n", control_opcode);
@@ -434,21 +441,22 @@ static void process_notice(notice, hostname)
*
*/
-static void signal_exit()
+static void
+signal_exit(int ignored)
{
mux_end_loop_p = 1;
}
/* clean up ALL the waiting children, in case we get hit with
multiple SIGCHLD's at once, and don't process in time. */
-static RETSIGTYPE signal_child()
+static RETSIGTYPE
+signal_child(int ignored)
{
#ifdef HAVE_WAITPID
int status;
#else
union wait status;
#endif
- extern int errno;
int pid, old_errno = errno;
do {
@@ -462,13 +470,14 @@ static RETSIGTYPE signal_child()
}
/* rewrite the wgfile in case it has gone away */
-static RETSIGTYPE signal_usr1()
+static RETSIGTYPE
+signal_usr1(int ignored)
{
write_wgfile();
}
-static void setup_signals(dofork)
- int dofork;
+static void
+setup_signals(int dofork)
{
#ifdef _POSIX_VERSION
struct sigaction sa;
@@ -525,7 +534,8 @@ static void setup_signals(dofork)
/* detach() taken from old zwgc, with lots of stuff ripped out */
-static void detach()
+static void
+detach(void)
{
/* detach from terminal and fork. */
register int i;