X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/77e3814f0c0e3dea4d0032e25666f77e6f83bfff..dd31685baaeeabf86d840ca1d26e6ab2d63da2e3:/atc/struct.h diff --git a/atc/struct.h b/atc/struct.h index 3a5ab490..52ba1dcf 100644 --- a/atc/struct.h +++ b/atc/struct.h @@ -1,6 +1,8 @@ +/* $NetBSD: struct.h,v 1.10 2014/03/22 22:58:56 dholland Exp $ */ + /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Ed James. @@ -13,11 +15,7 @@ * 2. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)struct.h 5.2 (Berkeley) 4/30/90 + * @(#)struct.h 8.1 (Berkeley) 5/31/93 */ /* @@ -45,6 +43,8 @@ * For more info on this and all of my stuff, mail edjames@berkeley.edu. */ +#include + typedef struct { int x, y; int dir; /* used only sometimes */ @@ -62,25 +62,32 @@ typedef struct { int width, height; int update_secs; int newplane_time; - int num_exits; - int num_lines; - int num_beacons; - int num_airports; + unsigned num_exits; + unsigned num_lines; + unsigned num_beacons; + unsigned num_airports; EXIT *exit; LINE *line; BEACON *beacon; AIRPORT *airport; } C_SCREEN; +enum places { + T_NODEST = 0, + T_BEACON = 1, + T_EXIT = 2, + T_AIRPORT = 3 +}; + typedef struct plane { struct plane *next, *prev; int status; int plane_no; int plane_type; - int orig_no; - int orig_type; - int dest_no; - int dest_type; + unsigned orig_no; + enum places orig_type; + unsigned dest_no; + enum places dest_type; int altitude; int new_altitude; int dir; @@ -88,8 +95,8 @@ typedef struct plane { int fuel; int xpos; int ypos; - int delayd; - int delayd_no; + bool delayd; + unsigned delayd_no; } PLANE; typedef struct { @@ -97,7 +104,7 @@ typedef struct { } LIST; typedef struct { - char name[10]; + char name[33]; char host[256]; char game[256]; int planes; @@ -105,6 +112,10 @@ typedef struct { int real_time; } SCORE; +#define SCORE_SCANF_FMT "%9s %255s %255s %d %d %d" +#define SCORE_NAME_LEN 33 +#define SCORE_GAME_LEN 256 + typedef struct displacement { int dx; int dy;