2023-02-02 02:18:20 -05:00
|
|
|
#if defined BASE \
|
|
|
|
|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- base */
|
2023-01-25 01:15:04 -05:00
|
|
|
#define LAUNCH_TYPE \
|
|
|
|
X(MotorCarTow),\
|
|
|
|
X(Winch),\
|
|
|
|
X(AeroTow)
|
|
|
|
#define X(type) type
|
|
|
|
enum launch_type { LAUNCH_TYPE };
|
|
|
|
#undef X
|
|
|
|
#define X(type) #type
|
|
|
|
static const char *launch_type_string[] = { LAUNCH_TYPE };
|
|
|
|
#undef X
|
|
|
|
#undef LAUNCH_TYPE
|
|
|
|
|
|
|
|
#define FLIGHT_TYPE \
|
|
|
|
X(Glider),\
|
|
|
|
X(Power)
|
|
|
|
#define X(type) type
|
|
|
|
enum flight_type { FLIGHT_TYPE };
|
|
|
|
#undef X
|
|
|
|
#define X(type) #type
|
|
|
|
static const char *flight_type_string[] = { FLIGHT_TYPE };
|
|
|
|
#undef X
|
|
|
|
#undef FLIGHT_TYPE
|
|
|
|
|
2023-02-03 14:50:10 -05:00
|
|
|
#include "pair.h"
|
2023-02-02 02:18:20 -05:00
|
|
|
|
2023-02-01 03:58:51 -05:00
|
|
|
struct glider {
|
2023-02-13 01:21:42 -05:00
|
|
|
struct pair type, reg, launch, landing;
|
2023-02-01 03:58:51 -05:00
|
|
|
enum launch_type how;
|
|
|
|
unsigned height_ft, pilot_min, dual_min, instr_min;
|
2023-02-03 14:50:10 -05:00
|
|
|
struct pair remarks;
|
2023-02-01 03:58:51 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
struct power {
|
2023-02-03 14:50:10 -05:00
|
|
|
struct pair type, reg, launch, landing, pilot, copilot;
|
2023-02-01 03:58:51 -05:00
|
|
|
unsigned dual_min, pilot_min, ifrsim_min, ifr_min;
|
2023-02-03 14:50:10 -05:00
|
|
|
struct pair remarks;
|
2023-02-01 03:58:51 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
struct flight {
|
|
|
|
enum { GLIDER, POWER } type;
|
|
|
|
union { struct glider glider; struct power power; };
|
|
|
|
};
|
|
|
|
|
2023-01-25 01:15:04 -05:00
|
|
|
/*void kjvcite_to_string(const union kjvcite, char (*)[12]);*/
|
2023-02-02 02:18:20 -05:00
|
|
|
#endif /* base --> */
|
2023-01-25 01:15:04 -05:00
|
|
|
|
|
|
|
|
2023-02-02 02:18:20 -05:00
|
|
|
#if defined GENERIC \
|
|
|
|
|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- generic */
|
2023-02-01 03:58:51 -05:00
|
|
|
struct tree_flight_node;
|
|
|
|
struct tree_flight_tree { struct tree_flight_node *node; unsigned height; };
|
|
|
|
struct flight_tree { struct tree_flight_tree root; };
|
|
|
|
struct tree_flight_ref { struct tree_flight_node *node; unsigned height, idx; };
|
|
|
|
struct tree_flight_iterator {
|
|
|
|
struct tree_flight_tree *root; struct tree_flight_ref ref; int seen;
|
2023-01-25 01:15:04 -05:00
|
|
|
};
|
2023-02-01 03:58:51 -05:00
|
|
|
struct flight_tree_iterator { struct tree_flight_iterator _; };
|
2023-02-02 02:18:20 -05:00
|
|
|
#endif /* generic --> */
|
|
|
|
|
2023-01-25 01:15:04 -05:00
|
|
|
|
2023-02-02 02:18:20 -05:00
|
|
|
#if defined PROTO \
|
|
|
|
|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- proto */
|
2023-01-25 01:15:04 -05:00
|
|
|
#include <stddef.h>
|
2023-02-02 02:18:20 -05:00
|
|
|
struct flights { struct flight_tree _; };
|
2023-02-15 02:30:57 -05:00
|
|
|
struct flights_iterator { struct flight_tree_iterator _; };
|
2023-02-02 02:18:20 -05:00
|
|
|
struct flights flights(/*const*/ struct journal *);
|
2023-02-01 03:58:51 -05:00
|
|
|
void flights_(struct flights *);
|
2023-02-02 02:18:20 -05:00
|
|
|
const char *flights_to_string(const struct flights *);
|
2023-02-15 02:30:57 -05:00
|
|
|
struct flights_iterator flights_iterator(struct flights *);
|
|
|
|
int flights_next(struct flights_iterator *, union line64 *,
|
|
|
|
const struct flight **);
|
2023-02-02 02:18:20 -05:00
|
|
|
#endif /* proto --> */
|
|
|
|
|
|
|
|
#ifdef BASE
|
|
|
|
#undef BASE
|
|
|
|
#endif
|
|
|
|
#ifdef GENERIC
|
|
|
|
#undef GENERIC
|
|
|
|
#endif
|
|
|
|
#ifdef PROTO
|
|
|
|
#undef PROTO
|
|
|
|
#endif
|