Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/whois Remove some STDC ifdefs, and some code that's ...



details:   https://anonhg.NetBSD.org/src/rev/7747ffed7875
branches:  trunk
changeset: 532726:7747ffed7875
user:      wiz <wiz%NetBSD.org@localhost>
date:      Thu Jun 13 23:26:43 2002 +0000

description:
Remove some STDC ifdefs, and some code that's for non-NetBSD systems.
ANSIfy.

diffstat:

 usr.bin/whois/whois.c |  83 ++++++++++----------------------------------------
 1 files changed, 17 insertions(+), 66 deletions(-)

diffs (156 lines):

diff -r d2cdb059365d -r 7747ffed7875 usr.bin/whois/whois.c
--- a/usr.bin/whois/whois.c     Thu Jun 13 23:00:16 2002 +0000
+++ b/usr.bin/whois/whois.c     Thu Jun 13 23:26:43 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: whois.c,v 1.17 2001/04/06 11:13:46 wiz Exp $   */
+/*     $NetBSD: whois.c,v 1.18 2002/06/13 23:26:43 wiz Exp $   */
 
 /*
  * RIPE version marten%ripe.net@localhost
@@ -47,9 +47,6 @@
  */
 
 #include <sys/cdefs.h>
-#if defined(sun) && defined(solaris)
-#define SYSV
-#endif
 
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
@@ -61,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)whois.c    8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: whois.c,v 1.17 2001/04/06 11:13:46 wiz Exp $");
+__RCSID("$NetBSD: whois.c,v 1.18 2002/06/13 23:26:43 wiz Exp $");
 #endif
 #endif /* not lint */
 #endif /* not RIPE */
@@ -88,26 +85,9 @@
 #include <pwd.h>
 #include <signal.h>
 
-#if defined(SYSV)
-#include       <crypt.h>
-#endif /* SYSV */
-
-#ifndef __NetBSD__
-#ifdef __STDC__
-extern int     getopt(int argc, char * const *argv, const char *optstring);
-extern int     kill(pid_t pid, int sig);
-extern FILE    *fdopen(int fildes, const char *type); 
-extern int     gethostname(char *name, int namelen);
-#else /* !__STDC__ */
-extern int     gethostname();
-#endif /* __STDC__ */
-#endif /* __NetBSD__ */
-
-#if defined(SYSV) || defined(__STDC__)
-
-#define                index(s,c)              strchr((const char*)(s),(int)(c))
-#define                rindex(s,c)             strrchr((const char*)(s),(int)(c))
-#define                bzero(s,n)              memset((void*)s,0,(size_t)n)
+#define                index(s,c)      strchr((const char*)(s),(int)(c))
+#define                rindex(s,c)     strrchr((const char*)(s),(int)(c))
+#define                bzero(s,n)      memset((void*)s,0,(size_t)n)
 
 #ifdef HASMEMMOVE
 # define       bcopy(s,d,n)    memmove((void*)(d),(void*)(s),(size_t)(n))
@@ -115,13 +95,6 @@
 # define       bcopy(s,d,n)    memcpy((void*)(d),(void*)(s),(size_t)(n))
 #endif /* HASMEMMOVE */
 
-#endif /* SYSV || __STDC__ */
-
-#ifdef GLIBC
-typedef __u_short u_short;
-typedef __caddr_t caddr_t;
-#endif /* GLIBC */
-
 /*
 
 # the following defines can be used but are not fully functional anymore...
@@ -151,19 +124,15 @@
 #endif /* !RIPE */
 #endif /* TOPDOMAIN || CLEVER */
 
-#if defined(RIPE) && !defined(__NetBSD__)
-#include <sys/param.h>
-#define NICHOST "whois.ripe.net"
-#else
 #define NICHOST "whois.internic.net"
-#endif
 
-int main __P((int, char **));
-static void usage __P((void));
-static void closesocket __P((int, int));
-static void termhandler __P((int));
+int main(int, char **);
+static void usage(void);
+static void closesocket(int, int);
+static void termhandler(int);
 
-void usage()
+void
+usage(void)
 {
 #ifdef RIPE
 #ifdef NETWORKUPDATE
@@ -215,8 +184,8 @@
 
 int s;
 
-void closesocket(s, child) 
-int s, child;
+void
+closesocket(int s, int child)
 {
   /* printf("close connection child=%i\n", child);  */
 
@@ -232,36 +201,19 @@
 
 }
 
-void termhandler(sig)
-int sig;
+void
+termhandler(int sig)
 {
   closesocket(s,1);
 }   
 
 
 #ifdef RIPE
-#if defined(__STDC__) || defined(SYSV)
 #define occurs(str,pat)                ((int) strstr((str),(pat)))
-#else /* !__STDC__ && !SYSV */
-int occurs(str, pat)
-     char *str, *pat;
-{
-  register char *point = str;
-  
-  while ((point=index(point, *pat)))
-    {
-      if (strncmp(point, pat, strlen(pat)) == 0)
-       return(1);
-      point++;
-    }
-  return(0);
-}
-#endif
 #endif
 
-int main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char *argv[])
 {
   extern char *optarg;
   extern int optind;
@@ -630,5 +582,4 @@
   closesocket(s, 1);
 
   exit(0);
-
 }



Home | Main Index | Thread Index | Old Index