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 |
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, 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_free_g (struct attr *attr, void *unused) |
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 (const char *line, const char *name, int *pos, char *val_ret, char *name_ret) |
Retrieves an attribute from a line in textfile format. More... | |
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) |
#define AF_CAR (1<<26) |
#define AF_DANGEROUS_GOODS (1<<19) |
#define AF_DELIVERY_TRUCK (1<<22) |
#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) |
#define AF_EMERGENCY_VEHICLES (1<<20) |
#define AF_FORD (1<<13) |
#define AF_HIGH_OCCUPANCY_CAR (1<<25) |
#define AF_HIGH_OCCUPANCY_CAR_ONLY (1<<18) |
#define AF_HORSE (1<<29) |
#define AF_MOPED (1<<28) |
#define AF_MOTORCYCLE (1<<27) |
#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_NOPASS (AF_ONEWAY|AF_ONEWAYREV) |
#define AF_ONEWAY (1<<0) |
#define AF_ONEWAY_EXCEPTION (1<<5) |
#define AF_ONEWAYMASK (AF_ONEWAY|AF_ONEWAYREV) |
#define AF_ONEWAYREV (1<<1) |
#define AF_PBH (AF_PEDESTRIAN|AF_BIKE|AF_HORSE) |
#define AF_PEDESTRIAN (1<<31) |
#define AF_PUBLIC_BUS (1<<23) |
#define AF_RESERVED1 (1<<7) |
#define AF_ROUNDABOUT (1<<3) |
#define AF_ROUNDABOUT_VALID (1<<4) |
#define AF_SEASONAL (1<<11) |
#define AF_SEGMENTED (1<<2) |
#define AF_SIZE_OR_WEIGHT_LIMIT (1<<8) |
#define AF_SPEED_LIMIT (1<<6) |
#define AF_TAXI (1<<24) |
#define AF_THROUGH_TRAFFIC_LIMIT (1<<9) |
#define AF_TOLL (1<<10) |
#define AF_TRANSPORT_TRUCK (1<<21) |
#define AF_UNDERGROUND (1<<14) |
#define AF_UNPAVED (1<<12) |
#define ATTR | ( | x | ) | attr_##x, |
#define ATTR2 | ( | x, | |
y | |||
) | attr_##y=x, |
#define ATTR_INT | ( | x, | |
y | |||
) | ((struct attr){attr_##x,{.num=y}}) |
#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) |
#define ATTR_IS_COORD_GEO | ( | x | ) | ((x) >= attr_type_coord_geo_begin && (x) <= attr_type_coord_geo_end) |
#define ATTR_IS_DOUBLE | ( | x | ) | ((x) >= attr_type_double_begin && (x) <= attr_type_double_end) |
#define ATTR_IS_GROUP | ( | x | ) | ((x) >= attr_type_group_begin && (x) <= attr_type_group_end) |
#define ATTR_IS_INT | ( | x | ) | ((x) >= attr_type_int_begin && (x) <= attr_type_int_end) |
#define ATTR_IS_ITEM | ( | x | ) | ((x) >= attr_type_item_begin && (x) <= attr_type_item_end) |
#define ATTR_IS_NUMERIC | ( | x | ) | (ATTR_IS_INT(x) || ATTR_IS_DOUBLE(x)) |
#define ATTR_IS_OBJECT | ( | x | ) | ((x) >= attr_type_object_begin && (x) <= attr_type_object_end) |
#define ATTR_IS_PCOORD | ( | x | ) | ((x) >= attr_type_pcoord_begin && (x) <= attr_type_pcoord_end) |
#define ATTR_IS_STRING | ( | x | ) | ((x) >= attr_type_string_begin && (x) <= attr_type_string_end) |
#define ATTR_REL_MAXABS 0x40000000 |
Maximum value for an absolute attribute value.
#define ATTR_REL_MAXREL 0x20000000 |
Maximum value for an relative attribute value (without value shift).
#define ATTR_REL_MINABS -0x40000000 |
Minimum value for an absolute attribute value.
#define ATTR_REL_MINREL -0x1FFFFFFF |
Minimum value for an relative attribute value (without value shift).
#define ATTR_REL_RELSHIFT 0x60000000 |
Value shift for relative values. This value is added to an attribute values to indicate a relative value.
#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 |
Attribute type values, created using macro magic.
void attr_create_hash | ( | void | ) |
References attr_hash, attr_names, and 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, poly_hole::coord, poly_hole::coord_count, attr::coord_geo, dbg, attr::item_types, lvl_error, attr::num, attr::num64, attr::numd, attr::poly_hole, 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_free_g(), 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(), 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 navit_destroy(), and result_free().
void attr_free_g | ( | struct attr * | attr, |
void * | unused | ||
) |
References attr_free().
Referenced by navit_destroy().
int attr_from_line | ( | const char * | line, |
const char * | name, | ||
int * | pos, | ||
char * | val_ret, | ||
char * | name_ret | ||
) |
Retrieves an attribute from a line in textfile format.
If name
is NULL, this function returns the first attribute found; otherwise it looks for an attribute named name
.
If pos
is specified, it acts as an offset pointer: Any data in line
before *pos
will be skipped. When the function returns, the value pointed to by pos
will be incremented by the number of characters parsed. This can be used to iteratively retrieve all attributes: declare a local variable, set it to zero, then iteratively call this function with a pointer to the same variable until it returns false.
val_ret
must be allocated (and later freed) by the caller, and have sufficient capacity to hold the parsed value including the terminating NULL character. The minimum safe size is strlen(line) - strlen(name) - *pos
(assuming zero for NULL pointers).
[in] | line | The line to parse, must be non-NULL and pointing to a NUL terminated string |
[in] | name | The name of the attribute to retrieve; can be NULL (see description) |
[in,out] | pos | As input, if pointer is non-NULL, this argument contains the character index inside line from which to start the search (see description) |
[out] | val_ret | Points to a buffer which will receive the value as text |
[out] | name_ret | Points to a buffer which will receive the actual name of the attribute found in the line, if NULL this argument won't be used. Note that the buffer provided here should be long enough to contain the attribute name + a terminating NUL character |
References dbg, lvl_debug, lvl_warning, name, p, startup::pos, and strncpy_unescape().
Referenced by attr_resolve(), map_rect_get_item_shapefile(), map_rect_get_item_textfile(), parse_option(), and traffic_message_restore_segments().
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 |
Referenced by attr_new_from_text(), command_call_function(), NGQProxy::getAttr(), NGQProxyNavit::getAttrList(), navit_cmd_map_item_set_attr(), navit_get_attr_py(), osd_text_prepare(), parse_filter(), NGQProxy::setAttr(), and start_element().
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(), 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.
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 which will receive the attribute |
iter | An iterator. This parameter may be NULL. |
References attr_match(), attr::attrs, and type.
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.
Attributes are matched based on their type
and u.data
members, thus attr
can be a shallow copy of the attribute, and can match multiple attributes in the list. The attr
argument itself is not changed.
attrs | The attribute list |
attr | The attribute to remove from the list |
References attr_free(), attr::attrs, attr::data, attr::type, 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(), 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(), and attr::attrs.
Referenced by announcement_new(), graphics_new(), gui_new(), log_new(), map_new(), mapset_new(), navit_new(), navit_object_new(), osd_new(), profile_option_new(), roadprofile_dup(), roadprofile_new(), script_new(), tm_add_item(), traffic_message_restore_segments(), 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(), and attr::attrs.
Referenced by command_call_function(), config_destroy(), eval_list(), graphics_free(), gui_internal_dbus_signal(), layer_destroy(), log_destroy(), map_destroy(), mapset_destroy(), navit_destroy(), navit_object_destroy(), osd_destroy(), osd_new(), parsed_item_destroy(), profile_option_destroy(), roadprofile_destroy(), script_destroy(), search_list_common_destroy(), tm_add_item(), tm_item_destroy(), traffic_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_from_name(), ATTR_REL_MAXABS, ATTR_REL_MAXREL, ATTR_REL_MINABS, ATTR_REL_MINREL, ATTR_REL_RELSHIFT, attr::attr_types, color::b, c, 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, name, attr::num, startup::pos, projection_mg, color::r, attr::range, attr::str, transform_to_geo(), attr::type, attr::u, and value.
Referenced by attr_new_py(), attr_resolve(), command_set_attr(), convert_to_attrs(), gui_internal_html_submit_set(), osd_marker_init(), parse_option(), and traffic_message_restore_segments().
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. |
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 |
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_arrows_width(), element_set_background_color(), element_set_circle_radius(), element_set_circle_width(), element_set_color(), element_set_oneway(), element_set_polyline_dash(), element_set_polyline_directed(), element_set_polyline_offset(), element_set_polyline_width(), element_set_spikes_distance(), element_set_spikes_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_svg_debug_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(), 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(), polygon_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_map_new(), traffic_new(), vehicle_file_new_file(), vehicle_gpsd_new_gpsd(), vehicle_gypsy_new_gypsy(), vehicle_iphone_new(), vehicle_log_gpx(), 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_attr_type(), command_call_function(), command_get_attr(), command_object_get_attr(), 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(), housenumber_attr_get(), invoke(), item_bin_dump(), item_dump_attr(), itemgra_add_attr(), 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(), 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(), tm_item_dump_to_file(), town_attr_get(), tracking_get_attr(), traffic_new(), 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_strjoin(), osd_text_format_attr(), popup_show_attr_val(), route_get_destination_description(), save_vehicle_xml(), and tm_item_dump_to_file().
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 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::attrs, color::b, attr::color, poly_hole::coord_count, 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, attr::poly_hole, color::r, attr::str, attr::type, item::type, type, and attr::u.
Referenced by attr_to_text(), 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(), type, and types.
Referenced by vehicle_log_gpx().