libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
odb.h
1/*
2 * CDDL HEADER START
3 *
4 * This file and its contents are supplied under the terms of the
5 * Common Development and Distribution License ("CDDL"), version 1.0.
6 * You may only use this file in accordance with the terms of version
7 * 1.0 of the CDDL.
8 *
9 * A full copy of the text of the CDDL should have accompanied this
10 * source. A copy of the CDDL is also available via the Internet at
11 * http://www.illumos.org/license/CDDL.
12 *
13 * CDDL HEADER END
14 */
15/*
16 * Copyright 2018 Saso Kiselkov. All rights reserved.
17 */
18
19#ifndef _ACF_UTILS_ODB_H_
20#define _ACF_UTILS_ODB_H_
21
22#include <time.h>
23
24#include "geom.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30typedef enum {
31 OBST_BLDG, /* building */
32 OBST_TOWER, /* tower */
33 OBST_STACK, /* smoke stack */
34 OBST_RIG, /* elevated rig */
35 OBST_POLE, /* (utility) pole */
36 OBST_OTHER /* some other kind of obstacle */
37} obst_type_t;
38
39typedef enum {
40 OBST_LIGHT_UNK, /* lighting status unknown */
41 OBST_LIGHT_NONE, /* not lighted */
42 OBST_LIGHT_LIGHTED, /* lighted by unknown type of light */
43 OBST_LIGHT_RED, /* continuous red */
44 OBST_LIGHT_STROBE_WR_MED, /* med intensity white & red strobe */
45 OBST_LIGHT_STROBE_WR_HI, /* high intensity white & red strobe */
46 OBST_LIGHT_STROBE_W_MED, /* medium intensity white strobe */
47 OBST_LIGHT_STROBE_W_HI, /* high intensity white strobe */
48 OBST_LIGHT_FLOOD, /* flood light */
49 OBST_LIGHT_DUAL_MED_CAT, /* dual medium catenary */
50 OBST_LIGHT_SYNC_RED /* synchronized red */
51} obst_light_t;
52
53typedef struct odb_s odb_t;
54typedef void (*add_obst_cb_t)(obst_type_t type, geo_pos3_t pos,
55 float agl, obst_light_t light, unsigned quant, void *userinfo);
56
57API_EXPORT odb_t *odb_init(const char *xpdir, const char *cainfo);
58API_EXPORT void odb_fini(odb_t *odb);
59
60API_EXPORT void odb_set_unload_delay(odb_t *odb, unsigned seconds);
61API_EXPORT time_t odb_get_cc_refresh_date(odb_t *odb, const char *cc);
62API_EXPORT bool_t odb_refresh_cc(odb_t *odb, const char *cc);
63API_EXPORT bool_t odb_get_obstacles(odb_t *odb, int lat, int lon,
64 add_obst_cb_t cb, void *userinfo);
65
66API_EXPORT void odb_set_proxy(odb_t *odb, const char *proxy);
67API_EXPORT size_t odb_get_proxy(odb_t *odb, char *proxy, size_t cap);
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* _ACF_UTILS_ODB_H_ */
Definition odb.c:77