#if defined BASE \
	|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- base */
#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

#include "helper.h"

struct glider {
	struct substring type, reg, launch;
	enum launch_type how;
	unsigned height_ft, pilot_min, dual_min, instr_min;
	struct substring remarks;
};

struct power {
	struct substring type, reg, launch, landing, pilot, copilot;
	unsigned dual_min, pilot_min, ifrsim_min, ifr_min;
	struct substring remarks;
};

struct flight {
	enum { GLIDER, POWER } type;
	union { struct glider glider; struct power power; };
};

/*void kjvcite_to_string(const union kjvcite, char (*)[12]);*/
#endif /* base --> */


#if defined GENERIC \
	|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- generic */
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;
};
struct flight_tree_iterator { struct tree_flight_iterator _; };
#endif /* generic --> */


#if defined PROTO \
	|| !defined BASE && !defined GENERIC && !defined PROTO /* <!-- proto */
#include <stddef.h>
struct flights { struct flight_tree _; };
struct flight *flights_add(struct flights *, const union line64);
struct flights flights(/*const*/ struct journal *);
void flights_(struct flights *);
const char *flights_to_string(const struct flights *);
#endif /* proto --> */

#ifdef BASE
#undef BASE
#endif
#ifdef GENERIC
#undef GENERIC
#endif
#ifdef PROTO
#undef PROTO
#endif
