struct.h 3.0 KB

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