xref: /netbsd-src/games/hunt/hunt/hunt_private.h (revision 1182a44c59cae4d586117d55eca24b4b8b173211)
1 /*	$NetBSD: hunt_private.h,v 1.10 2021/05/02 12:50:45 rillig Exp $	*/
2 
3 /*
4  * Copyright (c) 1983-2003, Regents of the University of California.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * + Redistributions of source code must retain the above copyright
12  *   notice, this list of conditions and the following disclaimer.
13  * + Redistributions in binary form must reproduce the above copyright
14  *   notice, this list of conditions and the following disclaimer in the
15  *   documentation and/or other materials provided with the distribution.
16  * + Neither the name of the University of California, San Francisco nor
17  *   the names of its contributors may be used to endorse or promote
18  *   products derived from this software without specific prior written
19  *   permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #include <stdbool.h>
35 #include <stdio.h> /* for BUFSIZ */
36 
37 #ifdef INTERNET
38 #include <netinet/in.h>
39 #include <netdb.h>
40 #include <arpa/inet.h>
41 #include <net/if.h>
42 #else
43 #include <sys/un.h>
44 #endif
45 
46 /*
47  * external variables
48  */
49 
50 extern bool Last_player;
51 
52 extern char Buf[BUFSIZ];
53 extern int huntsocket;
54 
55 #ifdef INTERNET
56 extern char *Send_message;
57 #endif
58 
59 #ifdef MONITOR
60 extern bool Am_monitor;
61 #endif
62 
63 extern char map_key[256];
64 extern bool no_beep;
65 
66 #ifdef INTERNET
67 /* XXX this had to be made public to split off server.c; fix it up */
68 extern SOCKET Daemon;
69 #endif
70 
71 /*
72  * function types
73  */
74 
75 /* in connect.c */
76 void do_connect(const char *, size_t, char, int32_t);
77 
78 /* in hunt.c */
79 __dead void bad_con(void);
80 __dead void bad_ver(void);
81 __dead __printflike(2, 3) void leave(int, const char *, ...);
82 __dead __printflike(2, 3) void leavex(int, const char *, ...);
83 void intr(int);
84 
85 /* in otto.c */
86 void otto(int, int, char);
87 
88 /* in playit.c */
89 void playit(void);
90 int quit(int);
91 void clear_the_screen(void);
92 void do_message(void);
93 
94 /* in server.c */
95 #ifdef INTERNET
96 void serverlist_setup(const char *, uint16_t);
97 void serverlist_query(unsigned short msg);
98 unsigned serverlist_num(void);
99 const struct sockaddr_storage *serverlist_gethost(unsigned, socklen_t *);
100 unsigned short serverlist_getresponse(unsigned);
101 #endif
102