summaryrefslogtreecommitdiffstats
path: root/hunt/hunt/hunt_private.h
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-29 21:24:26 +0000
committerdholland <dholland@NetBSD.org>2014-03-29 21:24:26 +0000
commitd6724a84e4ba41305086422afc071d9c8b92c09b (patch)
treec457518bb9f57b190abf81fec13cb6c911aacdf2 /hunt/hunt/hunt_private.h
parent32a54d49158271df4ffa0cf4422f612647973022 (diff)
downloadbsdgames-darwin-d6724a84e4ba41305086422afc071d9c8b92c09b.tar.gz
bsdgames-darwin-d6724a84e4ba41305086422afc071d9c8b92c09b.tar.zst
bsdgames-darwin-d6724a84e4ba41305086422afc071d9c8b92c09b.zip
Split hunt and huntd's includes, instead of incestuously sharing a pile
of external data and function declarations between the two programs. Common constants and defines now go in hunt_common.h. Stuff that belongs only to hunt is in hunt/hunt_private.h. Stuff that belongs only to huntd is in huntd/hunt.h. Copy some declarations that are used in both programs under the same names (but are not actually the same objects) from huntd/hunt.h to hunt/hunt_private.h. Move others that are only used in hunt. Remove some entirely unused material, and tidy up standard includes.
Diffstat (limited to 'hunt/hunt/hunt_private.h')
-rw-r--r--hunt/hunt/hunt_private.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/hunt/hunt/hunt_private.h b/hunt/hunt/hunt_private.h
new file mode 100644
index 00000000..58a299c1
--- /dev/null
+++ b/hunt/hunt/hunt_private.h
@@ -0,0 +1,97 @@
+/* $NetBSD: hunt_private.h,v 1.1 2014/03/29 21:24:26 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.
+ */
+
+#include <stdbool.h>
+#include <stdio.h> /* for BUFSIZ */
+
+#ifdef INTERNET
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#else
+#include <sys/un.h>
+#endif
+
+#ifdef MONITOR
+#define C_TESTMSG() (Query_driver ? C_MESSAGE :\
+ (Show_scores ? C_SCORES :\
+ (Am_monitor ? C_MONITOR :\
+ C_PLAYER)))
+#else
+#define C_TESTMSG() (Show_scores ? C_SCORES :\
+ (Query_driver ? C_MESSAGE :\
+ C_PLAYER))
+#endif
+
+/*
+ * external variables
+ */
+
+extern bool Last_player;
+
+extern const char *Driver;
+
+extern char Buf[BUFSIZ];
+extern int Socket;
+
+#ifdef INTERNET
+extern u_short Test_port;
+#else
+extern char *Sock_name;
+#endif
+
+#ifdef INTERNET
+extern char *Send_message;
+#endif
+
+#ifdef MONITOR
+extern bool Am_monitor;
+#endif
+
+extern char map_key[256];
+extern bool no_beep;
+
+/*
+ * function types
+ */
+
+void bad_con(void) __dead;
+void bad_ver(void) __dead;
+void clear_the_screen(void);
+void do_connect(char *, char, long);
+void do_message(void);
+void otto(int, int, char);
+void playit(void);
+int quit(int);
+void intr(int);