summaryrefslogtreecommitdiff
path: root/navit/attr.h
diff options
context:
space:
mode:
Diffstat (limited to 'navit/attr.h')
-rw-r--r--navit/attr.h136
1 files changed, 69 insertions, 67 deletions
diff --git a/navit/attr.h b/navit/attr.h
index f8aa8dd4a..a9e4d9467 100644
--- a/navit/attr.h
+++ b/navit/attr.h
@@ -35,8 +35,8 @@ enum attr_type {
#define ATTR2(x,y) attr_##y=x,
#define ATTR(x) attr_##x,
-/* Special macro for unused attribute types. Creates a placeholder entry
- * in the enum so the following values do not change. */
+ /* Special macro for unused attribute types. Creates a placeholder entry
+ * in the enum so the following values do not change. */
#define ATTR_UNUSED ATTR_UNUSED_L(__LINE__)
#define ATTR_UNUSED_L(x) ATTR_UNUSED_WITH_LINE_NUMBER(x)
#define ATTR_UNUSED_WITH_LINE_NUMBER(x) ATTR_UNUSED_##x,
@@ -52,8 +52,8 @@ enum attr_type {
};
enum attr_format {
- attr_format_default=0,
- attr_format_with_units=1,
+ attr_format_default=0,
+ attr_format_with_units=1,
};
#define AF_ONEWAY (1<<0)
@@ -120,19 +120,19 @@ enum attr_format {
/** Indicates whether a position is valid **/
enum attr_position_valid {
- attr_position_valid_invalid, /**< The position is invalid and should be discarded. **/
- attr_position_valid_static, /**< The position is valid but the vehicle is not moving, or moving very slowly.
+ attr_position_valid_invalid, /**< The position is invalid and should be discarded. **/
+ attr_position_valid_static, /**< The position is valid but the vehicle is not moving, or moving very slowly.
Calculations that involve the difference between two consecutive positions,
such as bearing, may therefore be inaccurate. **/
- attr_position_valid_extrapolated_time, /**< FIXME: this description is just my (mvglasow) guess; this value is not used anywhere as of r5957.
+ attr_position_valid_extrapolated_time, /**< FIXME: this description is just my (mvglasow) guess; this value is not used anywhere as of r5957.
The position is the vehicle's last known position, and the consumer of the
information should be aware that the vehicle may have moved since. **/
- attr_position_valid_extrapolated_spatial, /**< FIXME: this description is just my (mvglasow) guess; this value is not used anywhere as of r5957.
+ attr_position_valid_extrapolated_spatial, /**< FIXME: this description is just my (mvglasow) guess; this value is not used anywhere as of r5957.
The position is a prediction of the vehicle's current position, based on
its last known position, the time elapsed since it was obtained and possibly
other factors. This would be used for positions obtained through inertial
navigation. **/
- attr_position_valid_valid, /**< The position is valid and can be used for all purposes. **/
+ attr_position_valid_valid, /**< The position is valid and can be used for all purposes. **/
};
#define ATTR_IS_INT(x) ((x) >= attr_type_int_begin && (x) <= attr_type_int_end)
@@ -151,66 +151,67 @@ enum attr_position_valid {
#define ATTR_OBJECT(x,y) ((struct attr){attr_##x,{.navit=y}})
struct range {
- short min, max;
+ short min, max;
};
struct attr {
- enum attr_type type;
- union {
- char *str;
- void *data;
- long num;
- struct item *item;
- enum item_type item_type;
- enum projection projection;
- double * numd;
- struct color *color;
- struct coord_geo *coord_geo;
- struct navit *navit;
- struct callback *callback;
- struct callback_list *callback_list;
- struct vehicle *vehicle;
- struct layout *layout;
- struct layer *layer;
- struct map *map;
- struct mapset *mapset;
- struct log *log;
- struct route *route;
- struct navigation *navigation;
- struct coord *coord;
- struct pcoord *pcoord;
- struct gui *gui;
- struct graphics *graphics;
- struct tracking *tracking;
- struct itemgra *itemgra;
- struct plugin *plugin;
- struct plugins *plugins;
- struct polygon *polygon;
- struct polyline *polyline;
- struct circle *circle;
- struct text *text;
- struct icon *icon;
- struct image *image;
- struct arrows *arrows;
- struct element *element;
- struct speech *speech;
- struct cursor *cursor;
- struct displaylist *displaylist;
- struct transformation *transformation;
- struct vehicleprofile *vehicleprofile;
- struct roadprofile *roadprofile;
- struct bookmarks *bookmarks;
- struct config *config;
- struct osd *osd;
- struct range range;
- struct navit_object *navit_object;
- struct traffic *traffic;
- int *dash;
- enum item_type *item_types;
- enum attr_type *attr_types;
- long long *num64;
- struct attr *attrs;
- } u;
+ enum attr_type type;
+ union {
+ char *str;
+ void *data;
+ long num;
+ struct item *item;
+ enum item_type item_type;
+ enum projection projection;
+ double * numd;
+ struct color *color;
+ struct coord_geo *coord_geo;
+ struct navit *navit;
+ struct callback *callback;
+ struct callback_list *callback_list;
+ struct vehicle *vehicle;
+ struct layout *layout;
+ struct layer *layer;
+ struct map *map;
+ struct mapset *mapset;
+ struct log *log;
+ struct route *route;
+ struct navigation *navigation;
+ struct coord *coord;
+ struct pcoord *pcoord;
+ struct gui *gui;
+ struct graphics *graphics;
+ struct tracking *tracking;
+ struct itemgra *itemgra;
+ struct plugin *plugin;
+ struct plugins *plugins;
+ struct polygon *polygon;
+ struct polyline *polyline;
+ struct circle *circle;
+ struct text *text;
+ struct icon *icon;
+ struct image *image;
+ struct arrows *arrows;
+ struct element *element;
+ struct speech *speech;
+ struct cursor *cursor;
+ struct displaylist *displaylist;
+ struct transformation *transformation;
+ struct vehicleprofile *vehicleprofile;
+ struct roadprofile *roadprofile;
+ struct bookmarks *bookmarks;
+ struct config *config;
+ struct osd *osd;
+ struct range range;
+ struct navit_object *navit_object;
+ struct traffic *traffic;
+ int *dash;
+ enum item_type *item_types;
+ enum attr_type *attr_types;
+ long long *num64;
+ struct attr *attrs;
+ struct poly_hole *poly_hole;
+ } u;
};
struct attr_iter;
@@ -223,7 +224,8 @@ struct attr *attr_new_from_text(const char *name, const char *value);
char *attr_to_text_ext(struct attr *attr, char *sep, enum attr_format fmt, enum attr_format def_fmt, struct map *map);
char *attr_to_text(struct attr *attr, struct map *map, int pretty);
struct attr *attr_search(struct attr **attrs, struct attr *last, enum attr_type attr);
-int attr_generic_get_attr(struct attr **attrs, struct attr **def_attrs, enum attr_type type, struct attr *attr, struct attr_iter *iter);
+int attr_generic_get_attr(struct attr **attrs, struct attr **def_attrs, enum attr_type type, struct attr *attr,
+ struct attr_iter *iter);
struct attr **attr_generic_set_attr(struct attr **attrs, struct attr *attr);
struct attr **attr_generic_add_attr(struct attr **attrs, struct attr *attr);
struct attr **attr_generic_add_attr_list(struct attr **attrs, struct attr **add);