Module Name:    src
Committed By:   dholland
Date:           Sat Jul  4 07:51:35 UTC 2009

Modified Files:
        src/games/hunt: Makefile.inc
        src/games/hunt/hunt: hunt.c playit.c
        src/games/hunt/huntd: bsd.h faketalk.c hunt.h

Log Message:
Remove config options for 4.2BSD and 4.3BSD, and associated code. Highly
obsolete, and I doubt most of it still worked anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/hunt/Makefile.inc
cvs rdiff -u -r1.34 -r1.35 src/games/hunt/hunt/hunt.c
cvs rdiff -u -r1.13 -r1.14 src/games/hunt/hunt/playit.c
cvs rdiff -u -r1.6 -r1.7 src/games/hunt/huntd/bsd.h
cvs rdiff -u -r1.16 -r1.17 src/games/hunt/huntd/faketalk.c
cvs rdiff -u -r1.17 -r1.18 src/games/hunt/huntd/hunt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/hunt/Makefile.inc
diff -u src/games/hunt/Makefile.inc:1.10 src/games/hunt/Makefile.inc:1.11
--- src/games/hunt/Makefile.inc:1.10	Sat Jul  4 07:10:22 2009
+++ src/games/hunt/Makefile.inc	Sat Jul  4 07:51:34 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2009/07/04 07:10:22 dholland Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2009/07/04 07:51:34 dholland Exp $
 #
 #
 #  Hunt
@@ -56,20 +56,17 @@
 #	OLDIPC		Use 4.1a internet system calls (must also define
 #			INTERNET)
 #	LOG		Use syslog(3) for logging errors
-#	BSD_RELEASE	Which version of BSD distribution
-#			42 is 4.2BSD
-#			43 is 4.3BSD (implies BROADCAST)
 #	HPUX		do special HPUX only hacks
 #
-DEFS_BSD43=	-DINTERNET -DLOG -DBSD_RELEASE=43
-DEFS_BSD44=	-DINTERNET -DLOG -DBSD_RELEASE=44
-DEFS_SUN=	-DINTERNET -DLOG -DBSD_RELEASE=42 -DBROADCAST
-DEFS_SUN4_0=	-DINTERNET -DLOG -DBROADCAST
-DEFS_ULTRIX=	-DINTERNET -DLOG -DBSD_RELEASE=42
-DEFS_HPUX=	-DHPUX -DINTERNET -DLOG -DBROADCAST
-DEFS_SGI=	-DINTERNET -DLOG -DBSD_RELEASE=43
-DEFS_NEXT=	$(DEFS_BSD43) -bsd -Dconst=
-DEFS_OSF1=	-DINTERNET -DLOG -DBSD_RELEASE=43 -D_BSD
+DEFS_BSD43=	-DINTERNET -DLOG
+DEFS_BSD44=	-DINTERNET -DLOG
+DEFS_SUN=	-DINTERNET -DLOG
+DEFS_SUN4_0=	-DINTERNET -DLOG
+DEFS_ULTRIX=	-DINTERNET -DLOG
+DEFS_HPUX=	-DINTERNET -DLOG -DHPUX
+DEFS_SGI=	-DINTERNET -DLOG
+DEFS_NEXT=	-DINTERNET -DLOG -bsd -Dconst=
+DEFS_OSF1=	-DINTERNET -DLOG -D_BSD
 
 #
 # The following flags are used for system specific compilation arguments.

Index: src/games/hunt/hunt/hunt.c
diff -u src/games/hunt/hunt/hunt.c:1.34 src/games/hunt/hunt/hunt.c:1.35
--- src/games/hunt/hunt/hunt.c:1.34	Sat Jul  4 07:10:23 2009
+++ src/games/hunt/hunt/hunt.c	Sat Jul  4 07:51:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.34 2009/07/04 07:10:23 dholland Exp $	*/
+/*	$NetBSD: hunt.c,v 1.35 2009/07/04 07:51:34 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.34 2009/07/04 07:10:23 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.35 2009/07/04 07:51:34 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -51,13 +51,6 @@
 
 #include "hunt.h"
 
-/*
- * Some old versions of curses don't have these defined
- */
-#if !defined(cbreak) && (!defined(BSD_RELEASE) || BSD_RELEASE < 44)
-#define cbreak()	crmode()
-#endif
-
 #define clear_eol()	clrtoeol()
 #define put_ch		addch
 #define put_str		addstr
@@ -338,7 +331,6 @@
 }
 
 #ifdef INTERNET
-#ifdef BROADCAST
 int
 broadcast_vec(int s /*socket*/, struct sockaddr **vector)
 {
@@ -368,7 +360,6 @@
 	freeifaddrs(ifp);
 	return vec_cnt;
 }
-#endif
 
 SOCKET *
 list_drivers(void)
@@ -383,12 +374,8 @@
 	static int initial = TRUE;
 	static struct in_addr local_address;
 	struct hostent *hp;
-#ifdef BROADCAST
 	static int brdc;
 	static SOCKET *brdv;
-#else
-	u_long local_net;
-#endif
 	int i;
 	unsigned j;
 	static SOCKET *listv;
@@ -397,9 +384,6 @@
 	struct pollfd set[1];
 
 	if (initial) {			/* do one time initialization */
-#ifndef BROADCAST
-		sethostent(1);		/* don't bother to close host file */
-#endif
 		if (gethostname(local_name, sizeof local_name) < 0) {
 			leavex(1, "Sorry, I have no name.");
 			/* NOTREACHED */
@@ -442,7 +426,6 @@
 		    (struct sockaddr *) &test, DAEMON_SIZE);
 	}
 
-#ifdef BROADCAST
 	if (initial)
 		brdc = broadcast_vec(test_socket, (void *) &brdv);
 
@@ -472,19 +455,6 @@
 		leave(1, "sendto");
 		/* NOTREACHED */
 	}
-#else /* !BROADCAST */
-	/* loop thru all hosts on local net and send msg to them. */
-	msg = htons(C_TESTMSG());
-	local_net = inet_netof(local_address);
-	sethostent(0);		/* rewind host file */
-	while (hp = gethostent()) {
-		if (local_net == inet_netof(* ((struct in_addr *) hp->h_addr))){
-			test.sin_addr = * ((struct in_addr *) hp->h_addr);
-			(void) sendto(test_socket, &msg, sizeof msg, 0,
-			    (struct sockaddr *) &test, DAEMON_SIZE);
-		}
-	}
-#endif
 
 get_response:
 	namelen = DAEMON_SIZE;
@@ -811,23 +781,6 @@
 	errx(eval, mesg ? mesg : "");
 }
 
-#if defined(BSD_RELEASE) && BSD_RELEASE < 43
-char *
-strpbrk(char *s, char *brk)
-{
-	char *p;
-	c;
-
-	while (c = *s) {
-		for (p = brk; *p; p++)
-			if (c == *p)
-				return (s);
-		s++;
-	}
-	return (0);
-}
-#endif
-
 long
 env_init(long enter_status)
 {

Index: src/games/hunt/hunt/playit.c
diff -u src/games/hunt/hunt/playit.c:1.13 src/games/hunt/hunt/playit.c:1.14
--- src/games/hunt/hunt/playit.c:1.13	Sat Jul  4 07:10:23 2009
+++ src/games/hunt/hunt/playit.c	Sat Jul  4 07:51:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: playit.c,v 1.13 2009/07/04 07:10:23 dholland Exp $	*/
+/*	$NetBSD: playit.c,v 1.14 2009/07/04 07:51:34 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: playit.c,v 1.13 2009/07/04 07:10:23 dholland Exp $");
+__RCSID("$NetBSD: playit.c,v 1.14 2009/07/04 07:51:34 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/file.h>
@@ -42,10 +42,8 @@
 #include <curses.h>
 #include <ctype.h>
 #include <signal.h>
-#if defined(HPUX) || (defined(BSD_RELEASE) && BSD_RELEASE >= 44)
 #include <termios.h>
 #include <unistd.h>
-#endif
 #include "hunt.h"
 
 #ifndef FREAD
@@ -77,10 +75,6 @@
 
 #define GETCHR()	(--icnt < 0 ? getchr() : *iptr++)
 
-#if !defined(BSD_RELEASE) || BSD_RELEASE < 44
-extern int _putchar();
-#endif
-
 static unsigned char getchr(void);
 static void send_stuff(void);
 
@@ -160,15 +154,7 @@
 		  case READY:
 			refresh();
 			if (nchar_send < 0)
-#if defined(HPUX) || (defined(BSD_RELEASE) && BSD_RELEASE >= 44)
 				tcflush(STDIN, TCIFLUSH);
-#else
-#ifndef TCFLSH
-				(void) ioctl(STDIN, TIOCFLUSH, &in);
-#else
-				(void) ioctl(STDIN, TCFLSH, 0);
-#endif
-#endif
 			nchar_send = MAX_SEND;
 #ifndef OTTO
 			(void) GETCHR();
@@ -348,12 +334,7 @@
 				refresh();
 				if ((ch = getchar()) == '\n' || ch == '\r')
 					break;
-#if BSD_RELEASE >= 44
-				if (ch == erasechar())
-#else
-				if (ch == _tty.sg_erase)
-#endif
-				{
+				if (ch == erasechar()) {
 					if (cp > buf) {
 						int y, x;
 						getyx(stdscr, y, x);
@@ -363,12 +344,7 @@
 					}
 					continue;
 				}
-#if BSD_RELEASE >= 44
-				else if (ch == killchar())
-#else
-				else if (ch == _tty.sg_kill)
-#endif
-				{
+				else if (ch == killchar()) {
 					int y, x;
 					getyx(stdscr, y, x);
 					move(y, x - (cp - buf));

Index: src/games/hunt/huntd/bsd.h
diff -u src/games/hunt/huntd/bsd.h:1.6 src/games/hunt/huntd/bsd.h:1.7
--- src/games/hunt/huntd/bsd.h:1.6	Sat Jul  4 06:31:31 2009
+++ src/games/hunt/huntd/bsd.h	Sat Jul  4 07:51:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsd.h,v 1.6 2009/07/04 06:31:31 dholland Exp $	*/
+/*	$NetBSD: bsd.h,v 1.7 2009/07/04 07:51:35 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
@@ -30,7 +30,3 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-#if defined(BSD_RELEASE) && BSD_RELEASE >= 43
-#define BROADCAST
-#endif

Index: src/games/hunt/huntd/faketalk.c
diff -u src/games/hunt/huntd/faketalk.c:1.16 src/games/hunt/huntd/faketalk.c:1.17
--- src/games/hunt/huntd/faketalk.c:1.16	Sat Jul  4 06:38:35 2009
+++ src/games/hunt/huntd/faketalk.c	Sat Jul  4 07:51:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: faketalk.c,v 1.16 2009/07/04 06:38:35 dholland Exp $	*/
+/*	$NetBSD: faketalk.c,v 1.17 2009/07/04 07:51:35 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: faketalk.c,v 1.16 2009/07/04 06:38:35 dholland Exp $");
+__RCSID("$NetBSD: faketalk.c,v 1.17 2009/07/04 07:51:35 dholland Exp $");
 #endif /* not lint */
 
 #include "bsd.h"
@@ -214,11 +214,7 @@
 	get_remote_name(s);	/* setup his_machine_addr, msg.r_name */
 
 #ifdef TALK_43
-#if BSD_RELEASE >= 44
 	msg.ctl_addr = *(struct osockaddr *) &ctl_addr;
-#else
-	msg.ctl_addr = *(struct sockaddr *) &ctl_addr;
-#endif
 	msg.ctl_addr.sa_family = htons(msg.ctl_addr.sa_family);
 #else
 	msg.ctl_addr = ctl_addr;

Index: src/games/hunt/huntd/hunt.h
diff -u src/games/hunt/huntd/hunt.h:1.17 src/games/hunt/huntd/hunt.h:1.18
--- src/games/hunt/huntd/hunt.h:1.17	Sat Jul  4 07:10:23 2009
+++ src/games/hunt/huntd/hunt.h	Sat Jul  4 07:51:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.h,v 1.17 2009/07/04 07:10:23 dholland Exp $	*/
+/*	$NetBSD: hunt.h,v 1.18 2009/07/04 07:51:35 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
@@ -40,12 +40,7 @@
 #include <syslog.h>
 #endif
 
-#if BSD_RELEASE < 44
-#include <sgtty.h>
-#else
 #include <sys/ioctl.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <sys/poll.h>
@@ -54,9 +49,7 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <arpa/inet.h>
-#ifdef BROADCAST
 #include <net/if.h>
-#endif
 #else
 #include <sys/un.h>
 #endif

Reply via email to