navit
0.5.3-trunk
|
Go to the source code of this file.
Data Structures | |
struct | range |
struct | attr |
Macros | |
#define | ATTR2(x, y) attr_##y=x, |
#define | ATTR(x) attr_##x, |
#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, |
#define | AF_ONEWAY (1<<0) |
#define | AF_ONEWAYREV (1<<1) |
#define | AF_NOPASS (AF_ONEWAY|AF_ONEWAYREV) |
#define | AF_ONEWAYMASK (AF_ONEWAY|AF_ONEWAYREV) |
#define | AF_SEGMENTED (1<<2) |
#define | AF_ROUNDABOUT (1<<3) |
#define | AF_ROUNDABOUT_VALID (1<<4) |
#define | AF_ONEWAY_EXCEPTION (1<<5) |
#define | AF_SPEED_LIMIT (1<<6) |
#define | AF_RESERVED1 (1<<7) |
#define | AF_SIZE_OR_WEIGHT_LIMIT (1<<8) |
#define | AF_THROUGH_TRAFFIC_LIMIT (1<<9) |
#define | AF_TOLL (1<<10) |
#define | AF_SEASONAL (1<<11) |
#define | AF_UNPAVED (1<<12) |
#define | AF_FORD (1<<13) |
#define | AF_UNDERGROUND (1<<14) |
#define | AF_HIGH_OCCUPANCY_CAR_ONLY (1<<18) |
#define | AF_DANGEROUS_GOODS (1<<19) |
#define | AF_EMERGENCY_VEHICLES (1<<20) |
#define | AF_TRANSPORT_TRUCK (1<<21) |
#define | AF_DELIVERY_TRUCK (1<<22) |
#define | AF_PUBLIC_BUS (1<<23) |
#define | AF_TAXI (1<<24) |
#define | AF_HIGH_OCCUPANCY_CAR (1<<25) |
#define | AF_CAR (1<<26) |
#define | AF_MOTORCYCLE (1<<27) |
#define | AF_MOPED (1<<28) |
#define | AF_HORSE (1<<29) |
#define | AF_BIKE (1<<30) |
#define | AF_PEDESTRIAN (1<<31) |
#define | AF_PBH (AF_PEDESTRIAN|AF_BIKE|AF_HORSE) |
#define | AF_MOTORIZED_FAST (AF_MOTORCYCLE|AF_CAR|AF_HIGH_OCCUPANCY_CAR|AF_TAXI|AF_PUBLIC_BUS|AF_DELIVERY_TRUCK|AF_TRANSPORT_TRUCK|AF_EMERGENCY_VEHICLES) |
#define | AF_ALL (AF_PBH|AF_MOPED|AF_MOTORIZED_FAST) |
#define | AF_DISTORTIONMASK (AF_ALL|AF_ONEWAYMASK) |
#define | AF_DG_ANY (1<<0) |
#define | AF_DG_WATER_HARMFUL (1<<1) |
#define | AF_DG_EXPLOSIVE (1<<2) |
#define | AF_DG_FLAMMABLE (1<<3) |
#define | ATTR_REL_MINABS -0x40000000 |
#define | ATTR_REL_MAXABS 0x40000000 |
#define | ATTR_REL_MINREL -0x1FFFFFFF |
#define | ATTR_REL_MAXREL 0x20000000 |
#define | ATTR_REL_RELSHIFT 0x60000000 |
#define | ATTR_IS_INT(x) ((x) >= attr_type_int_begin && (x) <= attr_type_int_end) |
#define | ATTR_IS_DOUBLE(x) ((x) >= attr_type_double_begin && (x) <= attr_type_double_end) |
#define | ATTR_IS_STRING(x) ((x) >= attr_type_string_begin && (x) <= attr_type_string_end) |
#define | ATTR_IS_OBJECT(x) ((x) >= attr_type_object_begin && (x) <= attr_type_object_end) |
#define | ATTR_IS_ITEM(x) ((x) >= attr_type_item_begin && (x) <= attr_type_item_end) |
#define | ATTR_IS_COORD_GEO(x) ((x) >= attr_type_coord_geo_begin && (x) <= attr_type_coord_geo_end) |
#define | ATTR_IS_NUMERIC(x) (ATTR_IS_INT(x) || ATTR_IS_DOUBLE(x)) |
#define | ATTR_IS_COLOR(x) ((x) >= attr_type_color_begin && (x) <= attr_type_color_end) |
#define | ATTR_IS_PCOORD(x) ((x) >= attr_type_pcoord_begin && (x) <= attr_type_pcoord_end) |
#define | ATTR_IS_COORD(x) ((x) >= attr_type_coord_begin && (x) <= attr_type_coord_end) |
#define | ATTR_IS_GROUP(x) ((x) >= attr_type_group_begin && (x) <= attr_type_group_end) |
#define | ATTR_INT(x, y) ((struct attr){attr_##x,{.num=y}}) |
#define | ATTR_OBJECT(x, y) ((struct attr){attr_##x,{.navit=y}}) |
Enumerations | |
enum | attr_type { ATTR, ATTR } |
enum | attr_format { attr_format_default =0, attr_format_with_units =1 } |
enum | attr_position_valid { attr_position_valid_invalid, attr_position_valid_static, attr_position_valid_extrapolated_time, attr_position_valid_extrapolated_spatial, attr_position_valid_valid } |
Functions | |
void | attr_create_hash (void) |
void | attr_destroy_hash (void) |
enum attr_type | attr_from_name (const char *name) |
Converts a string to an attr_type. More... | |
char * | attr_to_name (enum attr_type attr) |
Converts an attr_type to a string. More... | |
struct attr * | attr_new_from_text (const char *name, const char *value) |
Creates an attribute from text information. More... | |
char * | attr_to_text_ext (struct attr *attr, char *sep, enum attr_format fmt, enum attr_format def_fmt, struct map *map) |
Converts attribute data to human-readable text. More... | |
char * | attr_to_text (struct attr *attr, struct map *map, int pretty) |
Converts an attribute to a string that can be displayed. More... | |
struct attr * | attr_search (struct attr **attrs, struct attr *last, enum attr_type attr) |
Searches for an attribute of a given type. More... | |
int | attr_generic_get_attr (struct attr **attrs, struct attr **def_attrs, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
Generic get function. More... | |
struct attr ** | attr_generic_set_attr (struct attr **attrs, struct attr *attr) |
Generic set function. More... | |
struct attr ** | attr_generic_add_attr (struct attr **attrs, struct attr *attr) |
Generic add function. More... | |
struct attr ** | attr_generic_add_attr_list (struct attr **attrs, struct attr **add) |
struct attr ** | attr_generic_prepend_attr (struct attr **attrs, struct attr *attr) |
struct attr ** | attr_generic_remove_attr (struct attr **attrs, struct attr *attr) |
Removes an attribute from an attribute list. More... | |
enum attr_type | attr_type_begin (enum attr_type type) |
int | attr_data_size (struct attr *attr) |
void * | attr_data_get (struct attr *attr) |
void | attr_data_set (struct attr *attr, void *data) |
void | attr_data_set_le (struct attr *attr, void *data) |
void | attr_free_content (struct attr *attr) |
void | attr_free (struct attr *attr) |
void | attr_dup_content (struct attr *src, struct attr *dst) |
struct attr * | attr_dup (struct attr *attr) |
void | attr_list_free (struct attr **attrs) |
Frees a list of attributes. More... | |
struct attr ** | attr_list_dup (struct attr **attrs) |
Duplicates a list of attributes. More... | |
struct attr ** | attr_list_append (struct attr **attrs, struct attr *attr) |
int | attr_from_line (char *line, char *name, int *pos, char *val_ret, char *name_ret) |
int | attr_types_contains (enum attr_type *types, enum attr_type type) |
Checks if an enumeration of attribute types contains a specific attribute. More... | |
int | attr_types_contains_default (enum attr_type *types, enum attr_type type, int deflt) |
Check if an enumeration of attribute types contains a specific attribute. More... | |
int | attr_rel2real (int attrval, int whole, int treat_neg_as_rel) |
Derive absolute value from relative attribute, given value of the whole range. More... | |
#define AF_ALL (AF_PBH|AF_MOPED|AF_MOTORIZED_FAST) |
#define AF_BIKE (1<<30) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_CAR (1<<26) |
Referenced by binfile_attr_get(), flags_to_text(), osm_add_tag(), and traffic_message_parse_events().
#define AF_DANGEROUS_GOODS (1<<19) |
#define AF_DELIVERY_TRUCK (1<<22) |
Referenced by flags_to_text(), osm_add_tag(), and traffic_message_parse_events().
#define AF_DG_ANY (1<<0) |
#define AF_DG_EXPLOSIVE (1<<2) |
#define AF_DG_FLAMMABLE (1<<3) |
#define AF_DG_WATER_HARMFUL (1<<1) |
#define AF_DISTORTIONMASK (AF_ALL|AF_ONEWAYMASK) |
Referenced by route_graph_add_traffic_distortion(), and route_graph_set_traffic_distortion().
#define AF_EMERGENCY_VEHICLES (1<<20) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_FORD (1<<13) |
Referenced by flags_to_text().
#define AF_HIGH_OCCUPANCY_CAR (1<<25) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_HIGH_OCCUPANCY_CAR_ONLY (1<<18) |
Referenced by osm_add_tag().
#define AF_HORSE (1<<29) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_MOPED (1<<28) |
Referenced by flags_to_text(), osm_add_tag(), and traffic_message_parse_events().
#define AF_MOTORCYCLE (1<<27) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_MOTORIZED_FAST (AF_MOTORCYCLE|AF_CAR|AF_HIGH_OCCUPANCY_CAR|AF_TAXI|AF_PUBLIC_BUS|AF_DELIVERY_TRUCK|AF_TRANSPORT_TRUCK|AF_EMERGENCY_VEHICLES) |
Referenced by flags_to_text(), and traffic_message_parse_events().
#define AF_NOPASS (AF_ONEWAY|AF_ONEWAYREV) |
#define AF_ONEWAY (1<<0) |
Referenced by flags_to_text(), navigation_itm_new(), osm_add_tag(), point_attr_get(), request_navit_traffic_export_gpx(), route_check_roundabout(), route_destination_reached(), route_graph_add_traffic_distortion(), route_graph_process_restriction_segment(), search_attr_get(), street_get(), traffic_message_add_segments(), traffic_route_append(), traffic_route_get_seg_cost(), and traffic_route_prepend().
#define AF_ONEWAY_EXCEPTION (1<<5) |
Referenced by flags_to_text().
#define AF_ONEWAYMASK (AF_ONEWAY|AF_ONEWAYREV) |
#define AF_ONEWAYREV (1<<1) |
Referenced by flags_to_text(), osm_add_tag(), request_navit_traffic_export_gpx(), route_check_roundabout(), route_destination_reached(), route_graph_add_traffic_distortion(), route_graph_process_restriction_segment(), street_get(), traffic_message_add_segments(), traffic_route_append(), traffic_route_get_seg_cost(), and traffic_route_prepend().
#define AF_PBH (AF_PEDESTRIAN|AF_BIKE|AF_HORSE) |
#define AF_PEDESTRIAN (1<<31) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_PUBLIC_BUS (1<<23) |
Referenced by flags_to_text(), osm_add_tag(), and traffic_message_parse_events().
#define AF_RESERVED1 (1<<7) |
Referenced by flags_to_text().
#define AF_ROUNDABOUT (1<<3) |
#define AF_ROUNDABOUT_VALID (1<<4) |
Referenced by flags_to_text(), osm_add_tag(), and route_check_roundabout().
#define AF_SEASONAL (1<<11) |
Referenced by flags_to_text().
#define AF_SEGMENTED (1<<2) |
Referenced by flags_to_text(), point_attr_get(), route_extract_segment_from_path(), route_graph_add_segment(), route_graph_add_street(), route_graph_clone_segment(), route_graph_segment_is_duplicate(), route_path_add_item_from_graph(), route_segment_data_field_pos(), route_segment_data_size(), search_attr_get(), and traffic_location_populate_route_graph().
#define AF_SIZE_OR_WEIGHT_LIMIT (1<<8) |
#define AF_SPEED_LIMIT (1<<6) |
Referenced by flags_to_text(), osd_speed_warner_draw(), osd_text_draw(), osm_add_tag(), rm_attr_get(), route_get_traffic_distortion(), route_graph_add_segment(), route_graph_add_street(), route_graph_add_traffic_distortion(), route_graph_clone_segment(), route_seg_speed(), route_segment_data_field_pos(), route_segment_data_size(), rp_attr_get(), street_get_data(), traffic_location_populate_route_graph(), and traffic_message_add_segments().
#define AF_TAXI (1<<24) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_THROUGH_TRAFFIC_LIMIT (1<<9) |
Referenced by flags_to_text(), osm_add_tag(), and route_through_traffic_allowed().
#define AF_TOLL (1<<10) |
Referenced by flags_to_text(), and osm_add_tag().
#define AF_TRANSPORT_TRUCK (1<<21) |
Referenced by flags_to_text(), osm_add_tag(), and traffic_message_parse_events().
#define AF_UNDERGROUND (1<<14) |
Referenced by flags_to_text(), osm_add_tag(), route_graph_point_is_endpoint_candidate(), tracking_update(), and tracking_value().
#define AF_UNPAVED (1<<12) |
Referenced by flags_to_text().
#define ATTR | ( | x | ) | attr_##x, |
#define ATTR2 | ( | x, | |
y | |||
) | attr_##y=x, |
#define ATTR_INT | ( | x, | |
y | |||
) | ((struct attr){attr_##x,{.num=y}}) |
Referenced by navigation_set_turnaround().
#define ATTR_IS_COLOR | ( | x | ) | ((x) >= attr_type_color_begin && (x) <= attr_type_color_end) |
#define ATTR_IS_COORD | ( | x | ) | ((x) >= attr_type_coord_begin && (x) <= attr_type_coord_end) |
Referenced by navit_get_coord().
#define ATTR_IS_COORD_GEO | ( | x | ) | ((x) >= attr_type_coord_geo_begin && (x) <= attr_type_coord_geo_end) |
Referenced by gui_internal_append_attr(), gui_internal_cmd2_pois(), and gui_internal_cmd2_position().
#define ATTR_IS_DOUBLE | ( | x | ) | ((x) >= attr_type_double_begin && (x) <= attr_type_double_end) |
Referenced by NGQProxy::getAttr(), map_new_csv(), navit_cmd_map_item_set_attr(), save_map_csv(), and NGQProxy::setAttr().
#define ATTR_IS_GROUP | ( | x | ) | ((x) >= attr_type_group_begin && (x) <= attr_type_group_end) |
Referenced by binfile_attr_get(), and item_bin_add_attr().
#define ATTR_IS_INT | ( | x | ) | ((x) >= attr_type_int_begin && (x) <= attr_type_int_end) |
Referenced by command_call_function(), NGQProxy::getAttr(), gui_internal_append_attr(), gui_internal_cmd2(), gui_internal_cmd2_pois(), gui_internal_cmd2_position(), gui_internal_cmd_escape(), gui_internal_cmd_menu2(), map_new_csv(), navit_cmd_map_item_set_attr(), navit_cmd_set_center(), navit_get_coord(), save_map_csv(), set_std_osd_attr(), and NGQProxy::setAttr().
#define ATTR_IS_ITEM | ( | x | ) | ((x) >= attr_type_item_begin && (x) <= attr_type_item_end) |
Referenced by navit_cmd_map_item_set_attr().
#define ATTR_IS_NUMERIC | ( | x | ) | (ATTR_IS_INT(x) || ATTR_IS_DOUBLE(x)) |
Referenced by navit_cmd_push_int(), and navit_cmd_set_int_var().
#define ATTR_IS_OBJECT | ( | x | ) | ((x) >= attr_type_object_begin && (x) <= attr_type_object_end) |
Referenced by command_call_function(), get_int_bool(), result_op(), and save_vehicle_xml().
#define ATTR_IS_PCOORD | ( | x | ) | ((x) >= attr_type_pcoord_begin && (x) <= attr_type_pcoord_end) |
Referenced by navit_get_coord().
#define ATTR_IS_STRING | ( | x | ) | ((x) >= attr_type_string_begin && (x) <= attr_type_string_end) |
Referenced by binmap_search_destroy(), binmap_search_new(), command_call_function(), get_int_bool(), NGQProxy::getAttr(), gui_internal_append_attr(), gui_internal_cmd2_bookmarks(), gui_internal_cmd2_pois(), gui_internal_cmd2_position(), gui_internal_cmd2_set(), gui_internal_cmd_escape(), gui_internal_cmd_img(), gui_internal_cmd_menu2(), gui_internal_onclick(), map_new_csv(), navit_cmd_get_attr_var(), navit_cmd_get_int_var(), navit_cmd_map_add_curr_pos(), navit_cmd_map_item_set_attr(), navit_cmd_say(), navit_cmd_set_attr_var(), navit_cmd_set_destination(), navit_cmd_set_int_var(), navit_cmd_switch_layout_day_night(), navit_cmd_toggle_layer(), navit_get_coord(), osd_cmd_odometer_reset(), result_op(), save_map_csv(), NGQProxy::setAttr(), and write_countrydir().
Referenced by command_saved_new().
#define ATTR_REL_MAXABS 0x40000000 |
Maximum value for an absolute attribute value.
Referenced by attr_new_from_text(), and attr_rel2real().
#define ATTR_REL_MAXREL 0x20000000 |
Maximum value for an relative attribute value (without value shift).
Referenced by attr_new_from_text().
#define ATTR_REL_MINABS -0x40000000 |
Minimum value for an absolute attribute value.
Referenced by attr_new_from_text().
#define ATTR_REL_MINREL -0x1FFFFFFF |
Minimum value for an relative attribute value (without value shift).
Referenced by attr_new_from_text().
#define ATTR_REL_RELSHIFT 0x60000000 |
Value shift for relative values. This value is added to an attribute values to indicate a relative value.
Referenced by attr_new_from_text(), attr_rel2real(), osd_button_adjust_sizes(), osd_button_new(), osd_image_new(), and osd_std_calculate_sizes().
#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, |
enum attr_format |
enum attr_position_valid |
Indicates whether a position is valid
enum attr_type |
void attr_create_hash | ( | void | ) |
References attr_hash, attr_names, and attr_name::name.
Referenced by config_load().
void* attr_data_get | ( | struct attr * | attr | ) |
References attr::data, attr::num, attr::range, attr::type, and attr::u.
Referenced by attr_bin_write_attr(), and binfile_attr_set().
void attr_data_set | ( | struct attr * | attr, |
void * | data | ||
) |
References attr::data, data, attr::num, attr::type, and attr::u.
Referenced by item_bin_dump().
void attr_data_set_le | ( | struct attr * | attr, |
void * | data | ||
) |
References attr::data, data, le16_to_cpu, le32_to_cpu, range::max, range::min, attr::num, attr::range, attr::type, and attr::u.
Referenced by binfile_attr_get().
int attr_data_size | ( | struct attr * | attr | ) |
References attr_to_name(), attr::attr_types, attr::color, attr::coord_geo, dbg, attr::item_types, lvl_error, attr::num, attr::num64, attr::numd, attr::range, attr::str, attr::type, and attr::u.
Referenced by attr_bin_write_attr(), attr_dup_content(), and binfile_attr_set().
void attr_destroy_hash | ( | void | ) |
References attr_hash.
Referenced by config_load().
References attr_dup_content().
Referenced by attr_generic_add_attr(), attr_generic_prepend_attr(), attr_generic_set_attr(), attr_list_dup(), csv_attr_set(), gui_internal_cmd_escape(), gui_internal_set_click_coord(), gui_internal_set_position_coord(), map_search_new_mg(), navit_cmd_get_attr_var(), navit_cmd_get_int_var(), navit_cmd_set_attr_var(), quadtree_data_dup(), search_list_search(), and tracking_get_attr().
References attr_data_size(), attr::data, HAS_OBJECT_FUNC, attr::item_type, attr::num, size, attr::type, and attr::u.
Referenced by attr_dup(), command_call_function(), command_object_get_attr(), navit_cmd_map_add_curr_pos(), navit_cmd_push_int(), navit_cmd_set_int_var(), and tm_attr_get().
void attr_free | ( | struct attr * | attr | ) |
References attr_free_content_do().
Referenced by attr_destroy_py(), attr_generic_remove_attr(), attr_generic_set_attr(), attr_list_free(), attr_resolve(), csv_attr_set(), gui_internal_html_submit_set(), gui_internal_set_click_coord(), gui_internal_set_position_coord(), map_rect_destroy_shapefile(), map_search_destroy_mg(), navit_cmd_set_attr_var(), navit_destroy(), osd_marker_init(), quadtree_item_free_do(), search_list_search_free(), tracking_destroy(), and tracking_get_attr().
void attr_free_content | ( | struct attr * | attr | ) |
References attr_free_content_do().
Referenced by result_free().
int attr_from_line | ( | char * | line, |
char * | name, | ||
int * | pos, | ||
char * | val_ret, | ||
char * | name_ret | ||
) |
References dbg, lvl_debug, p, and startup::pos.
Referenced by attr_resolve(), map_rect_get_item_shapefile(), map_rect_get_item_textfile(), parse_option(), and textfile_attr_get().
enum attr_type attr_from_name | ( | const char * | name | ) |
Converts a string to an attr_type.
This function reads a string and returns the corresponding attr_type.
name | The attribute name |
References attr_hash, attr_match(), and attr_names.
Referenced by attr_new_from_text(), attr_type_get_from_message(), command_attr_type(), command_call_function(), decode_attr_type_from_iter(), NGQProxy::getAttr(), NGQProxyNavit::getAttrList(), navit_cmd_map_item_set_attr(), navit_get_attr_py(), osd_text_prepare(), parse_filter(), NGQProxy::setAttr(), start_element(), textfile_attr_get(), and variant_to_attr_type().
Generic add function.
This function will insert a new attribute into the list.
attrs | Points to the array of attribute pointers to be updated |
attr | The new attribute. |
References attr_dup(), attr_to_name(), attr::attrs, dbg, lvl_debug, and attr::type.
Referenced by announcement_add_attr(), attr_generic_add_attr_list(), cursor_add_attr(), eval_list(), graphics_new(), gui_internal_cmd_escape(), gui_internal_dbus_signal(), gui_internal_get_data(), gui_new(), layout_add_attr(), maps_new(), mapset_add_attr(), navit_add_attr(), navit_cmd_fmt_coordinates(), navit_cmd_strjoin(), navit_object_add_attr(), roadprofile_add_attr(), tm_item_update_attrs(), vehicle_add_attr(), and vehicleprofile_add_attr().
References attr_generic_add_attr(), and attr::attrs.
Referenced by config_new().
int attr_generic_get_attr | ( | struct attr ** | attrs, |
struct attr ** | def_attrs, | ||
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
Generic get function.
This function searches an attribute list for an attribute of a given type and stores it in the attr parameter. If no match is found in attrs and the def_attrs argument is supplied, def_attrs is searched for the attribute type and the first match (if any) is returned.
Searching for attr_any or attr_any_xml is supported, but def_attrs will not be searched in that case.
An iterator can be specified to get multiple attributes of the same type: The first call will return the first match from attr; each subsequent call with the same iterator will return the next match. After obtaining the last match from attr, def_attrs is searched in the same manner. If no more matching attributes are found in either of them, false is returned.
attrs | Points to the array of attribute pointers to be searched |
def_attrs | Points to a list of pointers to default attributes. If an attribute is not found in attrs, the function will return the first match from def_attrs. This parameter may be NULL. |
type | The attribute type to search for |
attr | Points to a struct attr |
iter | An iterator. This parameter may be NULL. |
References attr_match(), and attr::attrs.
Referenced by announcement_get_attr(), config_get_attr(), get_string_from_attr_list(), graphics_get_attr(), gui_get_attr(), log_get_attr(), map_get_attr(), messagelist_new(), navit_get_attr(), navit_object_get_attr(), roadprofile_get_attr(), route_new(), speech_get_attr(), tm_find_item(), tracking_new(), vehicle_get_attr(), and vehicleprofile_get_attr().
References attr_dup(), and attr::attrs.
Referenced by navit_object_add_attr(), osd_new(), and search_list_common_addattr().
Removes an attribute from an attribute list.
If attrs
contains attr
, a new attribute list is created (which contains all attributes, except for attr
) and both attrs
(the original attribute list) and attr
are freed.
If attrs
does not contain attr
, this function is a no-op.
attrs | The attribute list |
attr | The attribute to remove from the list |
References attr_free(), attr::attrs, attr::data, type, attr::type, and attr::u.
Referenced by announcement_remove_attr(), mapset_remove_attr(), navit_object_remove_attr(), navit_remove_attr(), roadprofile_remove_attr(), tm_item_update_attrs(), vehicle_remove_attr(), and vehicleprofile_remove_attr().
Generic set function.
This function will search the list for the first attribute of the same type as the supplied new one and replace it with that. If the list does not contain an attribute whose type matches that of the new one, the new attribute is inserted into the list.
attrs | Points to the array of attribute pointers to be updated (if NULL, this function will create a new list containing only the new attribute) |
attr | The new attribute. |
References attr_dup(), attr_free(), attr_to_name(), attr::attrs, dbg, lvl_debug, and attr::type.
Referenced by announcement_set_attr(), gui_set_attr(), map_set_attr(), navit_object_set_attr(), roadprofile_set_attr(), speech_set_attr(), tm_add_item(), vehicle_set_attr(), vehicle_set_default_name(), and vehicleprofile_set_attr().
Duplicates a list of attributes.
This creates a deep copy, i.e. the attributes in the list are copied as well.
It is safe to call this function with a NULL argument; in this case, NULL will be returned.
attrs | The attribute list to copy |
References attr_dup().
Referenced by announcement_new(), graphics_new(), gui_new(), log_new(), map_new(), maps_new(), mapset_new(), navit_new(), navit_object_new(), osd_new(), profile_option_new(), roadprofile_dup(), roadprofile_new(), script_new(), tm_add_item(), vehicle_new(), and vehicleprofile_new().
void attr_list_free | ( | struct attr ** | attrs | ) |
Frees a list of attributes.
This frees the pointer array as well as the attributes referenced by the pointers.
It is safe to call this function with a NULL argument; doing so is a no-op.
attrs | The attribute list to free |
References attr_free().
Referenced by command_call_function(), config_destroy(), eval_list(), graphics_free(), gui_internal_dbus_signal(), layer_destroy(), log_destroy(), map_destroy(), maps_new(), mapset_destroy(), navit_destroy(), navit_object_destroy(), osd_destroy(), osd_new(), profile_option_destroy(), roadprofile_destroy(), script_destroy(), search_list_common_destroy(), tm_add_item(), tm_item_destroy(), and vehicle_destroy().
struct attr* attr_new_from_text | ( | const char * | name, |
const char * | value | ||
) |
Creates an attribute from text information.
This function creates an attribute from two strings specifying the name and the value.
name | The name of the new attribute |
value | The value of the new attribute |
References color::a, attr_name::attr, attr_from_name(), ATTR_REL_MAXABS, ATTR_REL_MAXREL, ATTR_REL_MINABS, ATTR_REL_MINREL, ATTR_REL_RELSHIFT, attr::attr_types, color::b, attr::color, attr::coord_geo, coord_parse(), attr::dash, dbg, color::g, item_from_name(), attr::item_type, attr::item_types, lvl_debug, lvl_error, range::max, max, range::min, attr::num, startup::pos, projection_mg, color::r, attr::range, attr::str, transform_to_geo(), attr::type, and attr::u.
Referenced by attr_new_py(), attr_resolve(), command_set_attr(), convert_to_attrs(), gui_internal_html_submit_set(), osd_marker_init(), and parse_option().
int attr_rel2real | ( | int | attrval, |
int | whole, | ||
int | treat_neg_as_rel | ||
) |
Derive absolute value from relative attribute, given value of the whole range.
attrval | Value of u.num member of attribute capable of holding relative values. |
whole | Range counted as 100%. |
treat_neg_as_rel | Replace negative absolute values with whole+attr.u.num. |
References ATTR_REL_MAXABS, and ATTR_REL_RELSHIFT.
Referenced by osd_std_calculate_sizes().
Searches for an attribute of a given type.
This function searches an array of pointers to attributes for a given attribute type and returns the first match.
attrs | Points to the array of attribute pointers to be searched |
last | Not used |
attr_type | The attribute type to search for. Generic types (such as attr_any or attr_any_xml) are NOT supported. |
References attr::attrs, dbg, lvl_debug, and lvl_info.
Referenced by announcement_new(), coord_new_from_attrs(), cursor_new(), debug_new(), element_set_background_color(), element_set_circle_radius(), element_set_circle_width(), element_set_color(), element_set_polyline_dash(), element_set_polyline_directed(), element_set_polyline_offset(), element_set_polyline_width(), element_set_text_size(), espeak_new(), file_create(), gmap_new(), graphics_android_new(), graphics_gtk_drawing_area_new(), graphics_new(), graphics_null_new(), graphics_opengl_new(), graphics_qt5_new(), graphics_qt_qpainter_new(), graphics_sdl_new(), graphics_win32_new(), gui_gtk_new(), gui_internal_add_vehicle_profile(), gui_internal_command_init(), gui_internal_new(), gui_new(), gui_qml_new(), gui_qt5_qml_new(), icon_new(), itemgra_new(), layout_new(), log_new(), map_filter_new(), map_new(), map_new_binfile(), map_new_csv(), map_new_garmin_img(), map_new_mg(), map_new_shapefile(), map_new_textfile(), map_route_occluded_new(), maps_new(), navigation_map_new(), navigation_new(), osd_button_new(), osd_cmd_interface_new(), osd_compass_new(), osd_gps_status_new(), osd_image_new(), osd_j1850_new(), osd_nav_next_turn_new(), osd_nav_toggle_announcer_new(), osd_navigation_status_new(), osd_new(), osd_odometer_new(), osd_route_guard_new(), osd_set_std_attr(), osd_speed_cam_new(), osd_speed_warner_new(), osd_stopwatch_new(), osd_text_new(), osd_volume_new(), plugin_new(), qt5_espeak_init_espeak(), qt5_espeak_init_language(), route_map_new_helper(), script_run(), seg_data_equals(), speech_android_new(), speech_new(), speechd_new(), tm_item_update_attrs(), tracking_map_new(), traffic_new(), vehicle_file_new_file(), vehicle_gpsd_new_gpsd(), vehicle_gpsd_position_attr_get(), vehicle_gypsy_new_gypsy(), vehicle_gypsy_position_attr_get(), vehicle_iphone_new(), vehicle_log_gpx(), vehicle_maemo_new_maemo(), vehicle_maemo_position_attr_get(), vehicle_new(), vehicle_qt5_position_attr_get(), vehicle_set_default_name(), vehicle_wince_new(), and vehicleprofile_new().
char* attr_to_name | ( | enum attr_type | attr | ) |
Converts an attr_type to a string.
attr | The attribute type to be converted. |
References attr_names, and attr_name::name.
Referenced by android_search_idle(), attr_data_size(), attr_generic_add_attr(), attr_generic_set_attr(), attr_resolve(), attr_to_text_ext(), binfile_attr_get(), command_call_function(), command_evaluate_to_attr(), command_get_attr(), command_object_get_attr(), config_new(), dump(), encode_attr(), get_int_bool(), NGQPoint::getInformation(), getProperty(), gui_internal_append_attr(), gui_internal_cmd_debug(), gui_internal_cmd_view_attributes(), gui_internal_set_attr(), gui_qml_set_attr(), housenumber_attr_get(), invoke(), item_bin_dump(), item_dump_attr(), itemgra_add_attr(), map_search_get_item_mg(), map_search_new_mg(), map_search_setup(), navigation_get_attr(), navit_get_attr(), navit_object_add_attr(), navit_object_ref(), navit_object_set_attr(), navit_object_unref(), navit_set_attr_do(), osd_text_draw(), pedestrian_navit_init(), point_attr_get(), popup_show_attr_val(), route_set_attr(), rp_attr_get(), save_map_csv(), save_vehicle_xml(), search_attr_get(), search_by_address_attr(), search_list_level(), search_list_search(), street_name_attr_get(), textfile_attr_get(), tm_dump_item_to_textfile(), town_attr_get(), tracking_get_attr(), traffic_new(), vehicle_android_position_attr_get(), vehicle_demo_set_attr_do(), vehicle_null_position_attr_get(), vehicle_qt5_position_attr_get(), vehicleprofile_apply_attrs(), and vehicleprofile_set_attr_do().
Converts an attribute to a string that can be displayed.
This function is just a wrapper around
.
attr | The attribute to convert |
map | The translation map, see |
pretty | Not used |
References attr_format_default, and attr_to_text_ext().
Referenced by encode_attr(), get_string(), NGQPoint::getInformation(), gui_internal_cmd_debug(), gui_internal_cmd_match_expand(), gui_internal_cmd_view_attributes(), item_bin_dump(), item_dump_attr(), navit_cmd_spawn(), navit_cmd_strjoin(), osd_text_format_attr(), popup_show_attr_val(), route_get_destination_description(), save_vehicle_xml(), and tm_dump_item_to_textfile().
char* attr_to_text_ext | ( | struct attr * | attr, |
char * | sep, | ||
enum attr_format | fmt, | ||
enum attr_format | def_fmt, | ||
struct map * | map | ||
) |
Converts attribute data to human-readable text.
attr | The attribute to be formatted |
sep | The separator to insert between a numeric value and its unit. If NULL, nothing will be inserted. |
fmt | Set to if is of type attr_destination_length attr_destination_time |
def_fmt | Not used |
map | The translation map. This is only needed for string type attributes or group type attributes which might contain strings. It can be NULL for other attribute types. If a string type attribute is encountered and is NULL, the string will be returned unchanged. |
References color::a, attr_format_with_units, attr_to_name(), attr_to_text_ext(), attr::attrs, color::b, attr::color, attr::coord_geo, attr::data, data, flags_to_text(), color::g, g_strconcat_printf(), item::id_hi, item::id_lo, attr::item, item_to_name(), attr::item_types, coord_geo::lat, coord_geo::lng, LONGLONG_FMT, item::map, map_convert_free(), map_convert_string(), map_get_attr(), nav_status_to_text(), attr::num, attr::num64, attr::numd, color::r, attr::str, item::type, type, attr::type, and attr::u.
Referenced by attr_to_text(), attr_to_text_ext(), and gui_internal_populate_route_table().
Checks if an enumeration of attribute types contains a specific attribute.
types | Points to a NULL-terminated array of pointers to enum attr_type |
type | The attr_type to be searched for |
Referenced by attr_types_contains_default().
Check if an enumeration of attribute types contains a specific attribute.
This function is mostly identical to
but returns the supplied default value if
is empty.
types | Points to a NULL-terminated array of pointers to enum attr_type |
type | The attr_type to be searched for |
deflt | The default value to return if is empty. |
References attr_types_contains().
Referenced by vehicle_log_gpx().