interpret/src/flights.h

85 lines
2.2 KiB
C

#if defined BASE \
|| !defined BASE && !defined PRIVATE && !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 "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; };
};
/*void kjvcite_to_string(const union kjvcite, char (*)[12]);*/
#endif /* base --> */
#if defined PRIVATE \
|| !defined BASE && !defined PRIVATE && !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 PRIVATE && !defined PROTO /* <!-- proto */
#include <stddef.h>
struct flights { struct flight_tree _; };
struct flights_iterator { struct flight_tree_iterator _; };
struct flights flights(/*const*/ struct journal *);
void flights_(struct flights *);
const char *flights_to_string(const struct flights *);
struct flights_iterator flights_iterator(struct flights *);
int flights_next(struct flights_iterator *, union line64 *,
const struct flight **);
#endif /* proto --> */
#ifdef BASE
#undef BASE
#endif
#ifdef PRIVATE
#undef PRIVATE
#endif
#ifdef PROTO
#undef PROTO
#endif