+/* $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.
* 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.
*
* 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
*/
/*
* For more info on this and all of my stuff, mail edjames@berkeley.edu.
*/
+#include <stdbool.h>
+
typedef struct {
int x, y;
int dir; /* used only sometimes */
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;
int fuel;
int xpos;
int ypos;
- int delayd;
- int delayd_no;
+ bool delayd;
+ unsigned delayd_no;
} PLANE;
typedef struct {
} LIST;
typedef struct {
- char name[10];
+ char name[33];
char host[256];
char game[256];
int planes;
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;