1 /* $OpenBSD: extern.h,v 1.11 2015/12/31 16:50:29 mestre Exp $ */ 2 /* $NetBSD: extern.h,v 1.4 1995/04/27 21:22:22 mycroft Exp $ */ 3 4 /*- 5 * Copyright (c) 1990, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by 9 * Ed James. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 3. Neither the name of the University nor the names of its contributors 20 * may be used to endorse or promote products derived from this software 21 * without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)extern.h 8.1 (Berkeley) 5/31/93 36 */ 37 38 /* 39 * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. 40 * 41 * Copy permission is hereby granted provided that this notice is 42 * retained on all partial or complete copies. 43 * 44 * For more info on this and all of my stuff, mail edjames@berkeley.edu. 45 */ 46 47 #include <curses.h> 48 49 #include "def.h" 50 #include "struct.h" 51 52 extern char GAMES[]; 53 extern const char *file; 54 55 extern int clck, safe_planes, seeded, test_mode, makenoise; 56 57 extern time_t start_time; 58 59 extern FILE *filein, *fileout; 60 61 extern C_SCREEN screen, *sp; 62 63 extern LIST air, ground; 64 65 extern struct termios tty_start, tty_new; 66 67 extern DISPLACEMENT displacement[MAXDIR]; 68 69 int addplane(void); 70 void append(LIST *, PLANE *); 71 void check_adir(int, int, int); 72 void check_edge(int, int); 73 void check_edir(int, int, int); 74 void check_line(int, int, int, int); 75 void check_linepoint(int, int); 76 void check_point(int, int); 77 int checkdefs(void); 78 int compar(const void *, const void *); 79 void delete(LIST *, PLANE *); 80 int dir_deg(int); 81 int dir_no(char); 82 void done_screen(void); 83 void draw_all(void); 84 void draw_line(WINDOW *, int, int, int, int, const char *); 85 void erase_all(void); 86 int getAChar(void); 87 int getcommand(void); 88 int gettoken(void); 89 void ioaddstr(int, const char *); 90 void ioclrtobot(void); 91 void ioclrtoeol(int); 92 void ioerror(int, int, const char *); 93 void iomove(int); 94 int list_games(void); 95 int log_score(int); 96 __dead void log_score_quit(int); 97 __dead void loser(const PLANE *, const char *); 98 char name(const PLANE *); 99 int next_plane(void); 100 void noise(void); 101 int number(char); 102 int open_score_file(void); 103 void planewin(void); 104 int pop(void); 105 void push(int, int); 106 void quit(int); 107 int read_file(const char *); 108 void redraw(void); 109 void rezero(void); 110 void setseed(const char *); 111 void setup_screen(const C_SCREEN *); 112 int too_close(const PLANE *p1, const PLANE *p2, int); 113 void update(int); 114 int yyerror(const char *); 115 int yylex(void); 116 int yyparse(void); 117 const char *Left(char); 118 const char *Right(char); 119 const char *airport(char); 120 const char *beacon(char); 121 const char *benum(char); 122 const char *circle(char); 123 const char *climb(char); 124 const char *command(PLANE *); 125 const char *default_game(void); 126 const char *delayb(char); 127 const char *descend(char); 128 const char *ex_it(char); 129 PLANE *findplane(int); 130 const char *ignore(char); 131 const char *left(char); 132 const char *mark(char); 133 PLANE *newplane(void); 134 const char *okay_game(const char *); 135 const char *rel_dir(char); 136 const char *right(char); 137 const char *setalt(char); 138 const char *setplane(char); 139 const char *setrelalt(char); 140 const char *timestr(int); 141 const char *to_dir(char); 142 const char *turn(char); 143 const char *unmark(char); 144