--- a/diag.c
+++ b/diag.c
@@ -29,11 +29,7 @@ jmp_buf tcpd_buf;
 
 /* tcpd_diag - centralize error reporter */
 
-static void tcpd_diag(severity, tag, format, ap)
-int     severity;
-char   *tag;
-char   *format;
-va_list ap;
+static void tcpd_diag(int severity, char *tag, char *format, va_list ap)
 {
     char    fmt[BUFSIZ];
 
--- a/eval.c
+++ b/eval.c
@@ -42,8 +42,7 @@ char    paranoid[] = STRING_PARANOID;
 
 /* eval_user - look up user name */
 
-char   *eval_user(request)
-struct request_info *request;
+char   *eval_user(struct request_info *request)
 {
     if (request->user[0] == 0) {
 	strcpy(request->user, unknown);
@@ -55,8 +54,7 @@ struct request_info *request;
 
 /* eval_hostaddr - look up printable address */
 
-char   *eval_hostaddr(host)
-struct host_info *host;
+char   *eval_hostaddr(struct host_info *host)
 {
     if (host->addr[0] == 0) {
 	strcpy(host->addr, unknown);
@@ -68,8 +66,7 @@ struct host_info *host;
 
 /* eval_hostname - look up host name */
 
-char   *eval_hostname(host)
-struct host_info *host;
+char   *eval_hostname(struct host_info *host)
 {
     if (host->name[0] == 0) {
 	strcpy(host->name, unknown);
@@ -81,8 +78,7 @@ struct host_info *host;
 
 /* eval_hostinfo - return string with host name (preferred) or address */
 
-char   *eval_hostinfo(host)
-struct host_info *host;
+char   *eval_hostinfo(struct host_info *host)
 {
     char   *hostname;
 
@@ -99,11 +95,10 @@ struct host_info *host;
 }
 
 /* eval_port - return string with the port */
-char   *eval_port(saddr)
 #ifdef INET6
-struct sockaddr *saddr;
+char   *eval_port(struct sockaddr *saddr)
 #else
-struct sockaddr_in *saddr;
+char   *eval_port(struct sockaddr_in *saddr)
 #endif
 {
     static char port[16];
@@ -122,8 +117,7 @@ struct sockaddr_in *saddr;
 
 /* eval_client - return string with as much about the client as we know */
 
-char   *eval_client(request)
-struct request_info *request;
+char   *eval_client(struct request_info *request)
 {
     static char both[2 * STRING_LENGTH];
     char   *hostinfo = eval_hostinfo(request->client);
@@ -142,8 +136,7 @@ struct request_info *request;
 
 /* eval_server - return string with as much about the server as we know */
 
-char   *eval_server(request)
-struct request_info *request;
+char   *eval_server(struct request_info *request)
 {
     static char both[2 * STRING_LENGTH];
     char   *host = eval_hostinfo(request->server);
--- a/fix_options.c
+++ b/fix_options.c
@@ -32,8 +32,7 @@ static char sccsid[] = "@(#) fix_options
 
 /* fix_options - get rid of IP-level socket options */
 
-void fix_options(request)
-struct request_info *request;
+void fix_options(struct request_info *request)
 {
 #ifdef IP_OPTIONS
     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
--- a/hosts_access.c
+++ b/hosts_access.c
@@ -44,9 +44,6 @@ static char sccsid[] = "@(#) hosts_acces
 #include <netdb.h>
 #endif
 
-extern char *fgets();
-extern int errno;
-
 #ifndef	INADDR_NONE
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
 #endif
@@ -92,17 +89,17 @@ int	aclexec_matched = 0;
 
 /* Forward declarations. */
 
-static int table_match();
-static int list_match();
-static int server_match();
-static int client_match();
-static int host_match();
-static int string_match();
-static int masked_match();
-static int match_pattern_ylo();
+static int table_match(char *, struct request_info *);
+static int list_match(char *, struct request_info *, int (*) (char *, struct request_info *));
+static int server_match(char *, struct request_info *);
+static int client_match(char *, struct request_info *);
+static int host_match(char *, struct host_info *);
+static int string_match(char *, char *);
+static int masked_match(char *, char *, char *);
+static int match_pattern_ylo(const char *, const char *);
 #ifdef INET6
-static int masked_match4();
-static int masked_match6();
+static int masked_match4(char *, char *, char *);
+static int masked_match6(char *, char *, char *);
 #endif
 
 /* Size of logical line buffer. */
@@ -111,8 +108,7 @@ static int masked_match6();
 
 /* hosts_access - host access control facility */
 
-int     hosts_access(request)
-struct request_info *request;
+int     hosts_access(struct request_info *request)
 {
     int     verdict;
 
@@ -145,9 +141,7 @@ struct request_info *request;
 
 /* table_match - match table entries with (daemon, client) pair */
 
-static int table_match(table, request)
-char   *table;
-struct request_info *request;
+static int table_match(char *table, struct request_info *request)
 {
     FILE   *fp;
     char    sv_list[BUFLEN];		/* becomes list of daemons */
@@ -213,10 +207,7 @@ struct request_info *request;
 
 /* list_match - match a request against a list of patterns with exceptions */
 
-static int list_match(list, request, match_fn)
-char   *list;
-struct request_info *request;
-int   (*match_fn) ();
+static int list_match(char *list, struct request_info *request, int (*match_fn) (char *, struct request_info *))
 {
     char   *tok;
 
@@ -271,9 +262,7 @@ static int daemon_or_port_match(char *to
 
 /* server_match - match server information */
 
-static int server_match(tok, request)
-char   *tok;
-struct request_info *request;
+static int server_match(char *tok, struct request_info *request)
 {
     char   *host;
 
@@ -287,9 +276,7 @@ struct request_info *request;
 
 /* client_match - match client information */
 
-static int client_match(tok, request)
-char   *tok;
-struct request_info *request;
+static int client_match(char *tok, struct request_info *request)
 {
     char   *host;
 
@@ -303,9 +290,7 @@ struct request_info *request;
 
 /* hostfile_match - look up host patterns from file */
 
-static int hostfile_match(path, host)
-char   *path;
-struct hosts_info *host;
+static int hostfile_match(char *path, struct host_info *host)
 {
     char    tok[BUFSIZ];
     int     match = NO;
@@ -323,9 +308,7 @@ struct hosts_info *host;
 
 /* host_match - match host name and/or address against pattern */
 
-static int host_match(tok, host)
-char   *tok;
-struct host_info *host;
+static int host_match(char *tok, struct host_info *host)
 {
     char   *mask;
 
@@ -366,9 +349,7 @@ struct host_info *host;
 
 /* string_match - match string against pattern */
 
-static int string_match(tok, string)
-char   *tok;
-char   *string;
+static int string_match(char *tok, char *string)
 {
     int     n;
 
@@ -434,22 +415,16 @@ char   *string;
 /* masked_match - match address against netnumber/netmask */
 
 #ifdef INET6
-static int masked_match(net_tok, mask_tok, string)
-char   *net_tok;
-char   *mask_tok;
-char   *string;
+static int masked_match(char *net_tok, char *mask_tok, char *string)
 {
     return (masked_match4(net_tok, mask_tok, string) ||
 	    masked_match6(net_tok, mask_tok, string));
 }
 
-static int masked_match4(net_tok, mask_tok, string)
+static int masked_match4(char *net_tok, char *mask_tok, char *string)
 #else
-static int masked_match(net_tok, mask_tok, string)
+static int masked_match(char *net_tok, char *mask_tok, char *string)
 #endif
-char   *net_tok;
-char   *mask_tok;
-char   *string;
 {
 #ifdef INET6
     u_int32_t net;
@@ -481,10 +456,7 @@ char   *string;
 }
 
 #ifdef INET6
-static int masked_match6(net_tok, mask_tok, string)
-char   *net_tok;
-char   *mask_tok;
-char   *string;
+static int masked_match6(char *net_tok, char *mask_tok, char *string)
 {
     struct addrinfo hints, *res;
     struct sockaddr_in6 net, addr;
--- a/hosts_ctl.c
+++ b/hosts_ctl.c
@@ -21,11 +21,7 @@ static char sccsid[] = "@(#) hosts_ctl.c
 
 /* hosts_ctl - limited interface to the hosts_access() routine */
 
-int     hosts_ctl(daemon, name, addr, user)
-char   *daemon;
-char   *name;
-char   *addr;
-char   *user;
+int     hosts_ctl(char *daemon, char *name, char *addr, char *user)
 {
     struct request_info request;
 
--- a/misc.c
+++ b/misc.c
@@ -18,18 +18,13 @@ static char sccsic[] = "@(#) misc.c 1.2
 
 #include "tcpd.h"
 
-extern char *fgets();
-
 #ifndef	INADDR_NONE
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
 #endif
 
 /* xgets - fgets() with backslash-newline stripping */
 
-char   *xgets(ptr, len, fp)
-char   *ptr;
-int     len;
-FILE   *fp;
+char   *xgets(char *ptr, int len, FILE *fp)
 {
     int     got;
     char   *start = ptr;
@@ -55,9 +50,7 @@ FILE   *fp;
 
 /* split_at - break string at delimiter or return NULL */
 
-char   *split_at(string, delimiter)
-char   *string;
-int     delimiter;
+char   *split_at(char *string, int delimiter)
 {
     char   *cp;
 
@@ -90,8 +83,7 @@ int     delimiter;
 
 /* dot_quad_addr - convert dotted quad to internal form */
 
-unsigned long dot_quad_addr(str)
-char   *str;
+unsigned long dot_quad_addr(char *str)
 {
     int     in_run = 0;
     int     runs = 0;
@@ -113,8 +105,7 @@ char   *str;
 
 /* cidr_mask_addr - convert cidr netmask length to internal form */
 
-unsigned long cidr_mask_addr(str)
-char   *str;
+unsigned long cidr_mask_addr(char *str)
 {
     int     maskbits;
 
--- a/mystdarg.h
+++ b/mystdarg.h
@@ -16,4 +16,4 @@
 #define VAEND(ap)              va_end(ap);}
 #endif
 
-extern char *percent_m();
+extern char *percent_m(char *, char *);
--- a/options.c
+++ b/options.c
@@ -69,32 +69,32 @@ extern jmp_buf tcpd_buf;		/* tcpd_jump()
 static char whitespace_eq[] = "= \t\r\n";
 #define whitespace (whitespace_eq + 1)
 
-static char *get_field();		/* chew :-delimited field off string */
-static char *chop_string();		/* strip leading and trailing blanks */
+static char *get_field(char *);		/* chew :-delimited field off string */
+static char *chop_string(register char *);	/* strip leading and trailing blanks */
 
 /* List of functions that implement the options. Add yours here. */
 
-static void user_option();		/* execute "user name.group" option */
-static void group_option();		/* execute "group name" option */
-static void umask_option();		/* execute "umask mask" option */
-static void linger_option();		/* execute "linger time" option */
-static void keepalive_option();		/* execute "keepalive" option */
-static void aclexec_option();		/* execute "aclexec command" option */
-static void spawn_option();		/* execute "spawn command" option */
-static void twist_option();		/* execute "twist command" option */
-static void rfc931_option();		/* execute "rfc931" option */
-static void setenv_option();		/* execute "setenv name value" */
-static void nice_option();		/* execute "nice" option */
-static void severity_option();		/* execute "severity value" */
-static void allow_option();		/* execute "allow" option */
-static void deny_option();		/* execute "deny" option */
-static void banners_option();		/* execute "banners path" option */
+static void user_option(char *, struct request_info *);		/* execute "user name.group" option */
+static void group_option(char *, struct request_info *);		/* execute "group name" option */
+static void umask_option(char *, struct request_info *);		/* execute "umask mask" option */
+static void linger_option(char *, struct request_info *);		/* execute "linger time" option */
+static void keepalive_option(char *, struct request_info *);		/* execute "keepalive" option */
+static void aclexec_option(char *, struct request_info *);		/* execute "aclexec command" option */
+static void spawn_option(char *, struct request_info *);		/* execute "spawn command" option */
+static void twist_option(char *, struct request_info *);		/* execute "twist command" option */
+static void rfc931_option(char *, struct request_info *);		/* execute "rfc931" option */
+static void setenv_option(char *, struct request_info *);		/* execute "setenv name value" */
+static void nice_option(char *, struct request_info *);		/* execute "nice" option */
+static void severity_option(char *, struct request_info *);		/* execute "severity value" */
+static void allow_option(char *, struct request_info *);		/* execute "allow" option */
+static void deny_option(char *, struct request_info *);		/* execute "deny" option */
+static void banners_option(char *, struct request_info *);		/* execute "banners path" option */
 
 /* Structure of the options table. */
 
 struct option {
     char   *name;			/* keyword name, case is ignored */
-    void  (*func) ();			/* function that does the real work */
+    void  (*func) (char *, struct request_info *);	/* function that does the real work */
     int     flags;			/* see below... */
 };
 
@@ -134,9 +134,7 @@ static struct option option_table[] = {
 
 /* process_options - process access control options */
 
-void    process_options(options, request)
-char   *options;
-struct request_info *request;
+void    process_options(char *options, struct request_info *request)
 {
     char   *key;
     char   *value;
@@ -200,9 +198,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void allow_option(value, request)
-char   *value;
-struct request_info *request;
+static void allow_option(char *value, struct request_info *request)
 {
     longjmp(tcpd_buf, AC_PERMIT);
 }
@@ -211,18 +207,14 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void deny_option(value, request)
-char   *value;
-struct request_info *request;
+static void deny_option(char *value, struct request_info *request)
 {
     longjmp(tcpd_buf, AC_DENY);
 }
 
 /* banners_option - expand %<char>, terminate each line with CRLF */
 
-static void banners_option(value, request)
-char   *value;
-struct request_info *request;
+static void banners_option(char *value, struct request_info *request)
 {
     char    path[MAXPATHNAMELEN];
     char    ibuf[BUFSIZ];
@@ -252,12 +244,9 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void group_option(value, request)
-char   *value;
-struct request_info *request;
+static void group_option(char *value, struct request_info *request)
 {
     struct group *grp;
-    struct group *getgrnam();
 
     if ((grp = getgrnam(value)) == 0)
 	tcpd_jump("unknown group: \"%s\"", value);
@@ -275,12 +264,9 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void user_option(value, request)
-char   *value;
-struct request_info *request;
+static void user_option(char *value, struct request_info *request)
 {
     struct passwd *pwd;
-    struct passwd *getpwnam();
     char   *group;
     int    defaultgroup = 0;
 
@@ -308,9 +294,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void umask_option(value, request)
-char   *value;
-struct request_info *request;
+static void umask_option(char *value, struct request_info *request)
 {
     unsigned mask;
     char    junk;
@@ -324,9 +308,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void spawn_option(value, request)
-char   *value;
-struct request_info *request;
+static void spawn_option(char *value, struct request_info *request)
 {
     if (dry_run == 0)
 	shell_cmd(value);
@@ -337,9 +319,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void aclexec_option(value, request)
-char   *value;
-struct request_info *request;
+static void aclexec_option(char *value, struct request_info *request)
 {
     int status, child_pid, wait_pid;
     extern int aclexec_matched;
@@ -384,9 +364,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void linger_option(value, request)
-char   *value;
-struct request_info *request;
+static void linger_option(char *value, struct request_info *request)
 {
     struct linger linger;
     char    junk;
@@ -406,9 +384,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void keepalive_option(value, request)
-char   *value;
-struct request_info *request;
+static void keepalive_option(char *value, struct request_info *request)
 {
     static int on = 1;
 
@@ -421,9 +397,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void nice_option(value, request)
-char   *value;
-struct request_info *request;
+static void nice_option(char *value, struct request_info *request)
 {
     int     niceval = 10;
     char    junk;
@@ -436,9 +410,7 @@ struct request_info *request;
 
 /* twist_option - replace process by shell command */
 
-static void twist_option(value, request)
-char   *value;
-struct request_info *request;
+static void twist_option(char *value, struct request_info *request)
 {
     char   *error;
 
@@ -474,9 +446,7 @@ struct request_info *request;
 
 /* rfc931_option - look up remote user name */
 
-static void rfc931_option(value, request)
-char   *value;
-struct request_info *request;
+static void rfc931_option(char *value, struct request_info *request)
 {
     int     timeout;
     char    junk;
@@ -493,9 +463,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void setenv_option(value, request)
-char   *value;
-struct request_info *request;
+static void setenv_option(char *value, struct request_info *request)
 {
     char   *var_value;
 
@@ -600,9 +568,7 @@ static struct syslog_names log_sev[] = {
 
 /* severity_map - lookup facility or severity value */
 
-static int severity_map(table, name)
-struct syslog_names *table;
-char   *name;
+static int severity_map(struct syslog_names *table, char *name)
 {
     struct syslog_names *t;
 
@@ -617,9 +583,7 @@ char   *name;
 
 /* ARGSUSED */
 
-static void severity_option(value, request)
-char   *value;
-struct request_info *request;
+static void severity_option(char *value, struct request_info *request)
 {
     char   *level = split_at(value, '.');
 
@@ -630,8 +594,7 @@ struct request_info *request;
 
 /* get_field - return pointer to next field in string */
 
-static char *get_field(string)
-char   *string;
+static char *get_field(char *string)
 {
     static char *last = "";
     char   *src;
@@ -673,8 +636,7 @@ char   *string;
 
 /* chop_string - strip leading and trailing blanks from string */
 
-static char *chop_string(string)
-register char *string;
+static char *chop_string(register char *string)
 {
     char   *start = 0;
     char   *end;
--- a/percent_m.c
+++ b/percent_m.c
@@ -12,7 +12,6 @@ static char sccsid[] = "@(#) percent_m.c
 #include <errno.h>
 #include <string.h>
 
-extern int errno;
 #ifndef SYS_ERRLIST_DEFINED
 extern char *sys_errlist[];
 extern int sys_nerr;
@@ -20,9 +19,7 @@ extern int sys_nerr;
 
 #include "mystdarg.h"
 
-char   *percent_m(obuf, ibuf)
-char   *obuf;
-char   *ibuf;
+char   *percent_m(char *obuf, char *ibuf)
 {
     char   *bp = obuf;
     char   *cp = ibuf;
--- a/refuse.c
+++ b/refuse.c
@@ -22,8 +22,7 @@ static char sccsid[] = "@(#) refuse.c 1.
 
 /* refuse - refuse request */
 
-void    refuse(request)
-struct request_info *request;
+void    refuse(struct request_info *request)
 {
 #ifdef INET6
     syslog(deny_severity, "refused connect from %s (%s)",
--- a/rfc931.c
+++ b/rfc931.c
@@ -38,10 +38,7 @@ static sigjmp_buf timebuf;
 
 /* fsocket - open stdio stream on top of socket */
 
-static FILE *fsocket(domain, type, protocol)
-int     domain;
-int     type;
-int     protocol;
+static FILE *fsocket(int domain, int type, int protocol)
 {
     int     s;
     FILE   *fp;
@@ -60,23 +57,18 @@ int     protocol;
 
 /* timeout - handle timeouts */
 
-static void timeout(sig)
-int     sig;
+static void timeout(int sig)
 {
     siglongjmp(timebuf, sig);
 }
 
 /* rfc931 - return remote user name, given socket structures */
 
-void    rfc931(rmt_sin, our_sin, dest)
 #ifdef INET6
-struct sockaddr *rmt_sin;
-struct sockaddr *our_sin;
+void    rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest)
 #else
-struct sockaddr_in *rmt_sin;
-struct sockaddr_in *our_sin;
+void    rfc931(struct sockaddr_in *rmt_sin, struct sockaddr_in *our_sin, char *dest)
 #endif
-char   *dest;
 {
     unsigned rmt_port;
     unsigned our_port;
--- a/shell_cmd.c
+++ b/shell_cmd.c
@@ -18,6 +18,7 @@ static char sccsid[] = "@(#) shell_cmd.c
 #include <sys/param.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <syslog.h>
 #include <string.h>
 #include <errno.h>
@@ -26,15 +27,13 @@ static char sccsid[] = "@(#) shell_cmd.c
 #include <sys/stat.h>
 #include <fcntl.h>
 
-extern void exit();
-
 /* Local stuff. */
 
 #include "tcpd.h"
 
 /* Forward declarations. */
 
-static void do_child();
+static void do_child(char *);
 
 /*
  * The sigchld handler. If there is a SIGCHLD caused by a child other than
@@ -50,8 +49,7 @@ static void sigchld(int sig, siginfo_t *
 
 /* shell_cmd - execute shell command */
 
-void    shell_cmd(command)
-char   *command;
+void    shell_cmd(char *command)
 {
     int     child_pid;
 
@@ -107,8 +105,7 @@ char   *command;
 
 /* do_child - exec command with { stdin, stdout, stderr } to /dev/null */
 
-static void do_child(command)
-char   *command;
+static void do_child(char *command)
 {
     char   *error;
     int     tmp_fd;
--- a/socket.c
+++ b/socket.c
@@ -47,7 +47,7 @@ extern char *inet_ntoa();
 
 /* Forward declarations. */
 
-static void sock_sink();
+static void sock_sink(int);
 
 #ifdef APPEND_DOT
 
@@ -57,8 +57,7 @@ static void sock_sink();
   * that lack DNS-style trailing dot magic, such as local files or NIS maps.
   */
 
-static struct hostent *gethostbyname_dot(name)
-char   *name;
+static struct hostent *gethostbyname_dot(char *name)
 {
     char    dot_name[MAXHOSTNAMELEN + 1];
     struct hostent *hp;
@@ -85,8 +84,7 @@ char   *name;
 
 /* sock_host - look up endpoint addresses and install conversion methods */
 
-void    sock_host(request)
-struct request_info *request;
+void    sock_host(struct request_info *request)
 {
 #ifdef INET6
     static struct sockaddr_storage client;
@@ -153,8 +151,7 @@ struct request_info *request;
 
 /* sock_hostaddr - map endpoint address to printable form */
 
-void    sock_hostaddr(host)
-struct host_info *host;
+void    sock_hostaddr(struct host_info *host)
 {
 #ifdef INET6
     struct sockaddr *sin = host->sin;
@@ -180,8 +177,7 @@ struct host_info *host;
 
 /* sock_hostname - map endpoint address to host name */
 
-void    sock_hostname(host)
-struct host_info *host;
+void    sock_hostname(struct host_info *host)
 {
 #ifdef INET6
     struct sockaddr *sin = host->sin;
@@ -421,8 +417,7 @@ struct host_info *host;
 
 /* sock_sink - absorb unreceived IP datagram */
 
-static void sock_sink(fd)
-int     fd;
+static void sock_sink(int fd)
 {
     char    buf[BUFSIZ];
 #ifdef INET6
--- a/tcpd.c
+++ b/tcpd.c
@@ -44,9 +44,7 @@ void fix_options(struct request_info *);
 int     allow_severity = SEVERITY;	/* run-time adjustable */
 int     deny_severity = LOG_WARNING;	/* ditto */
 
-int main(argc, argv)
-int     argc;
-char  **argv;
+int main(int argc, char **argv)
 {
     struct request_info request;
     char    path[MAXPATHNAMELEN];
--- a/update.c
+++ b/update.c
@@ -31,9 +31,7 @@ static char sccsid[] = "@(#) update.c 1.
 
 /* request_fill - request update engine */
 
-static struct request_info *request_fill(request, ap)
-struct request_info *request;
-va_list ap;
+static struct request_info *request_fill(struct request_info *request, va_list ap)
 {
     int     key;
     char   *ptr;
--- a/clean_exit.c
+++ b/clean_exit.c
@@ -14,15 +14,13 @@ static char sccsid[] = "@(#) clean_exit.
 
 #include <stdio.h>
 #include <unistd.h>
-
-extern void exit();
+#include <stdlib.h>
 
 #include "tcpd.h"
 
 /* clean_exit - clean up and exit */
 
-void    clean_exit(request)
-struct request_info *request;
+void    clean_exit(struct request_info *request)
 {
 
     /*
--- a/inetcf.c
+++ b/inetcf.c
@@ -16,12 +16,10 @@ static char sccsid[] = "@(#) inetcf.c 1.
 #include <errno.h>
 #include <string.h>
 
-extern int errno;
-extern void exit();
-
 #include "tcpd.h"
 #include "inetcf.h"
 #include "scaffold.h"
+#include "mystdarg.h"
 
  /*
   * Network configuration files may live in unusual places. Here are some
@@ -42,8 +40,8 @@ char   *inet_files[] = {
     0,
 };
 
-static void inet_chk();
-static char *base_name();
+static void inet_chk(char *, char *, char *, char *);
+static char *base_name(char *);
 
  /*
   * Structure with everything we know about a service.
@@ -60,8 +58,7 @@ static char whitespace[] = " \t\r\n";
 
 /* inet_conf - read in and examine inetd.conf (or tlid.conf) entries */
 
-char   *inet_cfg(conf)
-char   *conf;
+char   *inet_cfg(char *conf)
 {
     char    buf[BUFSIZ];
     FILE   *fp;
@@ -72,7 +69,6 @@ char   *conf;
     char   *arg0;
     char   *arg1;
     struct tcpd_context saved_context;
-    char   *percent_m();
     int     i;
     struct stat st;
 
@@ -163,11 +159,7 @@ char   *conf;
 
 /* inet_chk - examine one inetd.conf (tlid.conf?) entry */
 
-static void inet_chk(protocol, path, arg0, arg1)
-char   *protocol;
-char   *path;
-char   *arg0;
-char   *arg1;
+static void inet_chk(char *protocol, char *path, char *arg0, char *arg1)
 {
     char    daemon[BUFSIZ];
     struct stat st;
@@ -274,9 +266,7 @@ char   *arg1;
 
 /* inet_set - remember service status */
 
-void    inet_set(name, type)
-char   *name;
-int     type;
+void    inet_set(const char *name, int type)
 {
     struct inet_ent *ip =
     (struct inet_ent *) malloc(sizeof(struct inet_ent) + strlen(name));
@@ -293,8 +283,7 @@ int     type;
 
 /* inet_get - look up service status */
 
-int     inet_get(name)
-char   *name;
+int     inet_get(const char *name)
 {
     struct inet_ent *ip;
 
@@ -310,8 +299,7 @@ char   *name;
 
 /* base_name - compute last pathname component */
 
-static char *base_name(path)
-char   *path;
+static char *base_name(char *path)
 {
     char   *cp;
 
--- a/percent_x.c
+++ b/percent_x.c
@@ -17,23 +17,18 @@ static char sccsid[] = "@(#) percent_x.c
 /* System libraries. */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <syslog.h>
 #include <string.h>
 
-extern void exit();
-
 /* Local stuff. */
 
 #include "tcpd.h"
 
 /* percent_x - do %<char> expansion, abort if result buffer is too small */
 
-char   *percent_x(result, result_len, string, request)
-char   *result;
-int     result_len;
-char   *string;
-struct request_info *request;
+char   *percent_x(char *result, int result_len, char *string, struct request_info *request)
 {
     char   *bp = result;
     char   *end = result + result_len - 1;	/* end of result buffer */
--- a/safe_finger.c
+++ b/safe_finger.c
@@ -33,8 +33,6 @@ static char sccsid[] = "@(#) safe_finger
 #include <grp.h>
 #include <syslog.h>
 
-extern void exit();
-
 /* Local stuff */
 
 char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
@@ -52,16 +50,13 @@ int	deny_severity = LOG_WARNING;
 
 int     pipe_stdin(char **argv);
 
-void    cleanup(sig)
-int     sig;
+void    cleanup(int sig)
 {
     kill(finger_pid, SIGKILL);
     exit(0);
 }
 
-int main(argc, argv)
-int     argc;
-char  **argv;
+int main(int argc, char **argv)
 {
     int     c;
     int     line_length = 0;
@@ -147,8 +142,7 @@ char  **argv;
 
 /* perror_exit - report system error text and terminate */
 
-void    perror_exit(text)
-char   *text;
+void    perror_exit(char *text)
 {
     perror(text);
     exit(1);
@@ -156,8 +150,7 @@ char   *text;
 
 /* pipe_stdin - pipe stdin through program (from my ANSI to OLD C converter) */
 
-int     pipe_stdin(argv)
-char  **argv;
+int     pipe_stdin(char **argv)
 {
     int     pipefds[2];
     int     pid;
--- a/scaffold.c
+++ b/scaffold.c
@@ -26,10 +26,6 @@ static char sccs_id[] = "@(#) scaffold.c
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
 #endif
 
-#ifndef INET6
-extern char *malloc();
-#endif
-
 /* Application-specific. */
 
 #include "tcpd.h"
@@ -45,8 +41,7 @@ int     rfc931_timeout = RFC931_TIMEOUT;
 #ifndef INET6
 /* dup_hostent - create hostent in one memory block */
 
-static struct hostent *dup_hostent(hp)
-struct hostent *hp;
+static struct hostent *dup_hostent(struct hostent *hp)
 {
     struct hostent_block {
 	struct hostent host;
@@ -82,8 +77,7 @@ struct hostent *hp;
 /* find_inet_addr - find all addresses for this host, result to free() */
 
 #ifdef INET6
-struct addrinfo *find_inet_addr(host)
-char   *host;
+struct addrinfo *find_inet_addr(char *host)
 {
     struct addrinfo hints, *res;
 
@@ -117,8 +111,7 @@ char   *host;
     return (res);
 }
 #else
-struct hostent *find_inet_addr(host)
-char   *host;
+struct hostent *find_inet_addr(char *host)
 {
     struct in_addr addr;
     struct hostent *hp;
@@ -163,8 +156,7 @@ char   *host;
 
 /* check_dns - give each address thorough workout, return address count */
 
-int     check_dns(host)
-char   *host;
+int     check_dns(char *host)
 {
     struct request_info request;
 #ifdef INET6
@@ -217,8 +209,7 @@ char   *host;
 
 /* ARGSUSED */
 
-void    shell_cmd(command)
-char   *command;
+void    shell_cmd(char *command)
 {
     if (hosts_access_verbose)
 	printf("command: %s", command);
@@ -228,8 +219,7 @@ char   *command;
 
 /* ARGSUSED */
 
-void    clean_exit(request)
-struct request_info *request;
+void    clean_exit(struct request_info *request)
 {
     exit(0);
 }
@@ -238,24 +228,18 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-void    rfc931(rmt_sin, our_sin, dest)
 #ifdef INET6
-struct sockaddr *rmt_sin;
-struct sockaddr *our_sin;
+void    rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest)
 #else
-struct sockaddr_in *rmt_sin;
-struct sockaddr_in *our_sin;
+void    rfc931(struct sockaddr_in *rmt_sin, struct sockaddr_in *our_sin, char *dest)
 #endif
-char   *dest;
 {
     strcpy(dest, unknown);
 }
 
 /* check_path - examine accessibility */
 
-int     check_path(path, st)
-char   *path;
-struct stat *st;
+int     check_path(char *path, struct stat *st)
 {
     struct stat stbuf;
     char    buf[BUFSIZ];
--- a/scaffold.h
+++ b/scaffold.h
@@ -5,9 +5,9 @@
   */
 
 #ifdef INET6
-extern struct addrinfo *find_inet_addr();
+extern struct addrinfo *find_inet_addr(char *);
 #else
-extern struct hostent *find_inet_addr();
+extern struct hostent *find_inet_addr(char *);
 #endif
-extern int check_dns();
-extern int check_path();
+extern int check_dns(char *);
+extern int check_path(char *, struct stat *);
--- a/tcpdchk.c
+++ b/tcpdchk.c
@@ -36,11 +36,6 @@ static char sccsid[] = "@(#) tcpdchk.c 1
 #include <netdb.h>
 #include <string.h>
 
-extern int errno;
-extern void exit();
-extern int optind;
-extern char *optarg;
-
 #ifndef INADDR_NONE
 #define INADDR_NONE     (-1)		/* XXX should be 0xffffffff */
 #endif
@@ -91,15 +86,15 @@ extern jmp_buf tcpd_buf;
  /*
   * Local stuff.
   */
-static void usage();
-static void parse_table();
-static void print_list();
-static void check_daemon_list();
-static void check_client_list();
-static void check_daemon();
-static void check_user();
-static int check_host();
-static int reserved_name();
+static void usage(void);
+static void parse_table(char *table, struct request_info *);
+static void print_list(char *, char *);
+static void check_daemon_list(char *);
+static void check_client_list(char *);
+static void check_daemon(char *);
+static void check_user(char *);
+static int check_host(char *);
+static int reserved_name(char *);
 
 #define PERMIT	1
 #define DENY	0
@@ -112,9 +107,7 @@ static char *myname;
 static int allow_check;
 static char *inetcf;
 
-int     main(argc, argv)
-int     argc;
-char  **argv;
+int     main(int argc, char **argv)
 {
     struct request_info request;
     struct stat st;
@@ -203,7 +196,7 @@ char  **argv;
 
 /* usage - explain */
 
-static void usage()
+static void usage(void)
 {
     fprintf(stderr, "usage: %s [-a] [-d] [-i inet_conf] [-v]\n", myname);
     fprintf(stderr, "	-a: report rules with implicit \"ALLOW\" at end\n");
@@ -215,9 +208,7 @@ static void usage()
 
 /* parse_table - like table_match(), but examines _all_ entries */
 
-static void parse_table(table, request)
-char   *table;
-struct request_info *request;
+static void parse_table(char *table, struct request_info *request)
 {
     FILE   *fp;
     int     real_verdict;
@@ -291,9 +282,7 @@ struct request_info *request;
 
 /* print_list - pretty-print a list */
 
-static void print_list(title, list)
-char   *title;
-char   *list;
+static void print_list(char *title, char *list)
 {
     char    buf[BUFLEN];
     char   *cp;
@@ -313,8 +302,7 @@ char   *list;
 
 /* check_daemon_list - criticize daemon list */
 
-static void check_daemon_list(list)
-char   *list;
+static void check_daemon_list(char *list)
 {
     char    buf[BUFLEN];
     char   *cp;
@@ -341,8 +329,7 @@ char   *list;
 
 /* check_client_list - criticize client list */
 
-static void check_client_list(list)
-char   *list;
+static void check_client_list(char *list)
 {
     char    buf[BUFLEN];
     char   *cp;
@@ -370,8 +357,7 @@ char   *list;
 
 /* check_daemon - criticize daemon pattern */
 
-static void check_daemon(pat)
-char   *pat;
+static void check_daemon(char *pat)
 {
     if (pat[0] == '@') {
 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
@@ -404,8 +390,7 @@ char   *pat;
 
 /* check_user - criticize user pattern */
 
-static void check_user(pat)
-char   *pat;
+static void check_user(char *pat)
 {
     if (pat[0] == '@') {			/* @netgroup */
 	tcpd_warn("%s: user name begins with \"@\"", pat);
@@ -427,8 +412,7 @@ char   *pat;
 }
 
 #ifdef INET6
-static int is_inet6_addr(pat)
-    char *pat;
+static int is_inet6_addr(char *pat)
 {
     struct addrinfo hints, *res;
     int len, ret;
@@ -453,8 +437,7 @@ static int is_inet6_addr(pat)
 
 /* check_host - criticize host pattern */
 
-static int check_host(pat)
-char   *pat;
+static int check_host(char *pat)
 {
     char    buf[BUFSIZ];
     char   *mask;
@@ -538,8 +521,7 @@ char   *pat;
 
 /* reserved_name - determine if name is reserved */
 
-static int reserved_name(pat)
-char   *pat;
+static int reserved_name(char *pat)
 {
     return (STR_EQ(pat, unknown)
 	    || STR_EQ(pat, "KNOWN")
--- a/tcpdmatch.c
+++ b/tcpdmatch.c
@@ -26,15 +26,12 @@ static char sccsid[] = "@(#) tcpdmatch.c
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <syslog.h>
 #include <setjmp.h>
 #include <string.h>
 
-extern void exit();
-extern int optind;
-extern char *optarg;
-
 #ifndef	INADDR_NONE
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
 #endif
@@ -49,14 +46,12 @@ extern char *optarg;
 #include "inetcf.h"
 #include "scaffold.h"
 
-static void usage();
-static void tcpdmatch();
+static void usage(char *);
+static void tcpdmatch(struct request_info *);
 
 /* The main program */
 
-int     main(argc, argv)
-int     argc;
-char  **argv;
+int     main(int argc, char **argv)
 {
 #ifdef INET6
     struct addrinfo hints, *hp, *res;
@@ -317,8 +312,7 @@ char  **argv;
 
 /* Explain how to use this program */
 
-static void usage(myname)
-char   *myname;
+static void usage(char *myname)
 {
     fprintf(stderr, "usage: %s [-d] [-i inet_conf] daemon[@host] [user@]host\n",
 	    myname);
@@ -329,10 +323,7 @@ char   *myname;
 
 /* Print interesting expansions */
 
-static void expand(text, pattern, request)
-char   *text;
-char   *pattern;
-struct request_info *request;
+static void expand(char *text, char *pattern, struct request_info *request)
 {
     char    buf[BUFSIZ];
 
@@ -342,8 +333,7 @@ struct request_info *request;
 
 /* Try out a (server,client) pair */
 
-static void tcpdmatch(request)
-struct request_info *request;
+static void tcpdmatch(struct request_info *request)
 {
     int     verdict;
 
--- a/inetcf.h
+++ b/inetcf.h
@@ -4,9 +4,9 @@
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   */
 
-extern char *inet_cfg();		/* read inetd.conf file */
-extern void inet_set();			/* remember internet service */
-extern int inet_get();			/* look up internet service */
+extern char *inet_cfg(char *);		/* read inetd.conf file */
+extern void inet_set(const char *, int);/* remember internet service */
+extern int inet_get(const char *);	/* look up internet service */
 
 #define WR_UNKNOWN	(-1)		/* service unknown */
 #define WR_NOT		1		/* may not be wrapped */
--- a/fakelog.c
+++ b/fakelog.c
@@ -17,20 +17,14 @@ static char sccsid[] = "@(#) fakelog.c 1
 
 /* ARGSUSED */
 
-void openlog(name, logopt, facility)
-char   *name;
-int     logopt;
-int     facility;
+void openlog(char *name, int logopt, int facility)
 {
     /* void */
 }
 
 /* vsyslog - format one record */
 
-void vsyslog(severity, fmt, ap)
-int     severity;
-char   *fmt;
-va_list ap;
+void vsyslog(int severity, char *fmt, va_list ap)
 {
     char    buf[BUFSIZ];
 
--- a/try-from.c
+++ b/try-from.c
@@ -37,9 +37,7 @@ static char sccsid[] = "@(#) try-from.c
 int     allow_severity = SEVERITY;	/* run-time adjustable */
 int     deny_severity = LOG_WARNING;	/* ditto */
 
-int main(argc, argv)
-int     argc;
-char  **argv;
+int main(int argc, char **argv)
 {
     struct request_info request;
     char    buf[BUFSIZ];
