Module Name:    src
Committed By:   dholland
Date:           Sat Mar 29 22:11:19 UTC 2014

Modified Files:
        src/games/hunt: Makefile.inc
        src/games/hunt/hunt: hunt.c
        src/games/hunt/huntd: driver.c
Added Files:
        src/games/hunt/include: pathnames.h

Log Message:
handle compiled-in pathnames the customary way


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/games/hunt/Makefile.inc
cvs rdiff -u -r1.45 -r1.46 src/games/hunt/hunt/hunt.c
cvs rdiff -u -r1.30 -r1.31 src/games/hunt/huntd/driver.c
cvs rdiff -u -r0 -r1.1 src/games/hunt/include/pathnames.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.11 src/games/hunt/Makefile.inc:1.12
--- src/games/hunt/Makefile.inc:1.11	Sat Jul  4 07:51:34 2009
+++ src/games/hunt/Makefile.inc	Sat Mar 29 22:11:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11 2009/07/04 07:51:34 dholland Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2014/03/29 22:11:19 dholland Exp $
 #
 #
 #  Hunt
@@ -49,6 +49,11 @@ GAME_PARAM=	-DRANDOM -DREFLECT -DMONITOR
 		-DOTTO
 
 #
+# Perhaps, compile in a specific non-default huntd to run, for debugging:
+#CPPFLAGS+=	-DOVERRIDE_PATH_HUNTD=\"/home/socr/a/conrad/games/src/hunt/huntd.dbg\"
+
+
+#
 # System parameter flags are:
 #	DEBUG		Don't trust everything in the code
 #	INTERNET	Use the Internet domain IPC instead of UNIX domain
@@ -82,6 +87,6 @@ SYSLIBS=
 # Generic definitions
 #
 DEFS=		$(GAME_PARAM) $(DEFS_BSD44)
-CPPFLAGS+=	$(SYSCFLAGS) $(DEFS) -DHUNTD=\"/usr/games/huntd\"
+CPPFLAGS+=	$(SYSCFLAGS) $(DEFS)
 
 .include "../Makefile.inc"

Index: src/games/hunt/hunt/hunt.c
diff -u src/games/hunt/hunt/hunt.c:1.45 src/games/hunt/hunt/hunt.c:1.46
--- src/games/hunt/hunt/hunt.c:1.45	Sat Mar 29 22:05:44 2014
+++ src/games/hunt/hunt/hunt.c	Sat Mar 29 22:11:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.45 2014/03/29 22:05:44 dholland Exp $	*/
+/*	$NetBSD: hunt.c,v 1.46 2014/03/29 22:11:19 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.45 2014/03/29 22:05:44 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.46 2014/03/29 22:11:19 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -50,22 +50,23 @@ __RCSID("$NetBSD: hunt.c,v 1.45 2014/03/
 #include <ifaddrs.h>
 
 #include "hunt_common.h"
+#include "pathnames.h"
 #include "hunt_private.h"
 
 #define clear_eol()	clrtoeol()
 #define put_ch		addch
 #define put_str		addstr
 
-#ifdef DEBUG
-static const char Driver[] = "/home/socr/a/conrad/games/src/hunt/huntd.dbg";
+#ifdef OVERRIDE_PATH_HUNTD
+static const char Driver[] = OVERRIDE_PATH_HUNTD;
 #else
-static const char Driver[] = HUNTD;
+static const char Driver[] = PATH_HUNTD;
 #endif
 
 #ifdef INTERNET
 static uint16_t Test_port = TEST_PORT;
 #else
-static const char Sock_name[] = "/tmp/hunt";
+static const char Sock_name[] = PATH_HUNTSOCKET;
 #endif
 
 

Index: src/games/hunt/huntd/driver.c
diff -u src/games/hunt/huntd/driver.c:1.30 src/games/hunt/huntd/driver.c:1.31
--- src/games/hunt/huntd/driver.c:1.30	Sat Mar 29 21:55:59 2014
+++ src/games/hunt/huntd/driver.c	Sat Mar 29 22:11:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: driver.c,v 1.30 2014/03/29 21:55:59 dholland Exp $	*/
+/*	$NetBSD: driver.c,v 1.31 2014/03/29 22:11:19 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: driver.c,v 1.30 2014/03/29 21:55:59 dholland Exp $");
+__RCSID("$NetBSD: driver.c,v 1.31 2014/03/29 22:11:19 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/ioctl.h>
@@ -43,14 +43,16 @@ __RCSID("$NetBSD: driver.c,v 1.30 2014/0
 #include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include"hunt.h"
+
+#include "hunt.h"
+#include "pathnames.h"
 
 
 #ifdef INTERNET
 static uint16_t Test_port = TEST_PORT;
 #else
-static const char Sock_name[] = "/tmp/hunt";
-static const char Stat_name[] = "/tmp/hunt.stats";
+static const char Sock_name[] = PATH_HUNTSOCKET;
+static const char Stat_name[] = PATH_STATSOCKET;
 #endif
 
 static SOCKET Daemon;

Added files:

Index: src/games/hunt/include/pathnames.h
diff -u /dev/null src/games/hunt/include/pathnames.h:1.1
--- /dev/null	Sat Mar 29 22:11:19 2014
+++ src/games/hunt/include/pathnames.h	Sat Mar 29 22:11:19 2014
@@ -0,0 +1,35 @@
+/*	$NetBSD: pathnames.h,v 1.1 2014/03/29 22:11:19 dholland Exp $	*/
+/*
+ * Copyright (c) 1983-2003, Regents of the University of California.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * + Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ * + 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.
+ * + Neither the name of the University of California, San Francisco nor 
+ *   the names of its contributors may be used to endorse or promote 
+ *   products derived from this software without specific prior written 
+ *   permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define PATH_HUNTD	"/usr/games/huntd"
+#define PATH_HUNTSOCKET	"/tmp/hunt"
+#define PATH_STATSOCKET	"/tmp/hunt.stats"

Reply via email to