#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 "pair.h"

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

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

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

#include "../src/journal.h" /* line64 */

#define TREE_NAME flight
#define TREE_KEY union line64
#define TREE_VALUE struct flight
#define TREE_HEAD
#include "../src/tree.h"

struct flight_tree flights(/*const*/ struct journal *);
void flights_(struct flight_tree *);
const char *flights_to_string(const struct flight_tree *);
struct flight_tree_iterator flights_iterator(struct flight_tree *);
int flights_next(struct flight_tree_iterator *, union line64 *,
	const struct flight **);
