1*86d7f5d3SJohn Marino /*- 2*86d7f5d3SJohn Marino * Copyright (c) 1990, 1993 3*86d7f5d3SJohn Marino * The Regents of the University of California. All rights reserved. 4*86d7f5d3SJohn Marino * 5*86d7f5d3SJohn Marino * This code is derived from software contributed to Berkeley by 6*86d7f5d3SJohn Marino * Ed James. 7*86d7f5d3SJohn Marino * 8*86d7f5d3SJohn Marino * Redistribution and use in source and binary forms, with or without 9*86d7f5d3SJohn Marino * modification, are permitted provided that the following conditions 10*86d7f5d3SJohn Marino * are met: 11*86d7f5d3SJohn Marino * 1. Redistributions of source code must retain the above copyright 12*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer. 13*86d7f5d3SJohn Marino * 2. Redistributions in binary form must reproduce the above copyright 14*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer in the 15*86d7f5d3SJohn Marino * documentation and/or other materials provided with the distribution. 16*86d7f5d3SJohn Marino * 3. Neither the name of the University nor the names of its contributors 17*86d7f5d3SJohn Marino * may be used to endorse or promote products derived from this software 18*86d7f5d3SJohn Marino * without specific prior written permission. 19*86d7f5d3SJohn Marino * 20*86d7f5d3SJohn Marino * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21*86d7f5d3SJohn Marino * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*86d7f5d3SJohn Marino * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*86d7f5d3SJohn Marino * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24*86d7f5d3SJohn Marino * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*86d7f5d3SJohn Marino * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*86d7f5d3SJohn Marino * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*86d7f5d3SJohn Marino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*86d7f5d3SJohn Marino * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*86d7f5d3SJohn Marino * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*86d7f5d3SJohn Marino * SUCH DAMAGE. 31*86d7f5d3SJohn Marino * 32*86d7f5d3SJohn Marino * @(#)struct.h 8.1 (Berkeley) 5/31/93 33*86d7f5d3SJohn Marino */ 34*86d7f5d3SJohn Marino 35*86d7f5d3SJohn Marino /* 36*86d7f5d3SJohn Marino * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. 37*86d7f5d3SJohn Marino * 38*86d7f5d3SJohn Marino * Copy permission is hereby granted provided that this notice is 39*86d7f5d3SJohn Marino * retained on all partial or complete copies. 40*86d7f5d3SJohn Marino * 41*86d7f5d3SJohn Marino * For more info on this and all of my stuff, mail edjames@berkeley.edu. 42*86d7f5d3SJohn Marino */ 43*86d7f5d3SJohn Marino 44*86d7f5d3SJohn Marino typedef struct { 45*86d7f5d3SJohn Marino int x, y; 46*86d7f5d3SJohn Marino int dir; /* used only sometimes */ 47*86d7f5d3SJohn Marino } SCREEN_POS; 48*86d7f5d3SJohn Marino 49*86d7f5d3SJohn Marino typedef struct { 50*86d7f5d3SJohn Marino SCREEN_POS p1, p2; 51*86d7f5d3SJohn Marino } LINE; 52*86d7f5d3SJohn Marino 53*86d7f5d3SJohn Marino typedef SCREEN_POS EXIT; 54*86d7f5d3SJohn Marino typedef SCREEN_POS BEACON; 55*86d7f5d3SJohn Marino typedef SCREEN_POS AIRPORT; 56*86d7f5d3SJohn Marino 57*86d7f5d3SJohn Marino typedef struct { 58*86d7f5d3SJohn Marino int width, height; 59*86d7f5d3SJohn Marino int update_secs; 60*86d7f5d3SJohn Marino int newplane_time; 61*86d7f5d3SJohn Marino int num_exits; 62*86d7f5d3SJohn Marino int num_lines; 63*86d7f5d3SJohn Marino int num_beacons; 64*86d7f5d3SJohn Marino int num_airports; 65*86d7f5d3SJohn Marino EXIT *exit; 66*86d7f5d3SJohn Marino LINE *line; 67*86d7f5d3SJohn Marino BEACON *beacon; 68*86d7f5d3SJohn Marino AIRPORT *airport; 69*86d7f5d3SJohn Marino } C_SCREEN; 70*86d7f5d3SJohn Marino 71*86d7f5d3SJohn Marino typedef struct plane { 72*86d7f5d3SJohn Marino struct plane *next, *prev; 73*86d7f5d3SJohn Marino int status; 74*86d7f5d3SJohn Marino int plane_no; 75*86d7f5d3SJohn Marino int plane_type; 76*86d7f5d3SJohn Marino int orig_no; 77*86d7f5d3SJohn Marino int orig_type; 78*86d7f5d3SJohn Marino int dest_no; 79*86d7f5d3SJohn Marino int dest_type; 80*86d7f5d3SJohn Marino int altitude; 81*86d7f5d3SJohn Marino int new_altitude; 82*86d7f5d3SJohn Marino int dir; 83*86d7f5d3SJohn Marino int new_dir; 84*86d7f5d3SJohn Marino int fuel; 85*86d7f5d3SJohn Marino int xpos; 86*86d7f5d3SJohn Marino int ypos; 87*86d7f5d3SJohn Marino int delayd; 88*86d7f5d3SJohn Marino int delayd_no; 89*86d7f5d3SJohn Marino } PLANE; 90*86d7f5d3SJohn Marino 91*86d7f5d3SJohn Marino typedef struct { 92*86d7f5d3SJohn Marino PLANE *head, *tail; 93*86d7f5d3SJohn Marino } LIST; 94*86d7f5d3SJohn Marino 95*86d7f5d3SJohn Marino typedef struct { 96*86d7f5d3SJohn Marino char name[10]; 97*86d7f5d3SJohn Marino char host[256]; 98*86d7f5d3SJohn Marino char game[256]; 99*86d7f5d3SJohn Marino int planes; 100*86d7f5d3SJohn Marino int time; 101*86d7f5d3SJohn Marino int real_time; 102*86d7f5d3SJohn Marino } SCORE; 103*86d7f5d3SJohn Marino 104*86d7f5d3SJohn Marino #define SCORE_SCANF_FMT "%9s %255s %255s %d %d %d" 105*86d7f5d3SJohn Marino 106*86d7f5d3SJohn Marino typedef struct displacement { 107*86d7f5d3SJohn Marino int dx; 108*86d7f5d3SJohn Marino int dy; 109*86d7f5d3SJohn Marino } DISPLACEMENT; 110