Freeciv-3.3
|
Go to the source code of this file.
Data Structures | |
struct | astring |
Macros | |
#define | str _private_str_ |
#define | n _private_n_ |
#define | n_alloc _private_n_alloc_ |
#define | ASTRING_INIT { nullptr, 0, 0 } |
#define n_alloc _private_n_alloc_ |
#define str _private_str_ |
Replace the spaces by line breaks when the line length is over the desired one.
Definition at line 302 of file astring.c.
Referenced by popup_info_text(), text_happiness_buildings(), and text_happiness_wonders().
const char * astr_build_and_list | ( | struct astring * | astr, |
const char *const * | items, | ||
size_t | number | ||
) |
Build a localized string with the given items. Items will be "and"-separated.
See also astr_build_or_list(), strvec_to_and_list().
Definition at line 351 of file astring.c.
Referenced by helptext_advance(), helptext_extra(), helptext_nation(), helptext_terrain(), helptext_unit(), popup_info_text(), role_units_translations(), setting_match_prefix(), strvec_to_and_list(), and update_source_label().
Build a localized string with the given items. Items will be "or"-separated.
See also astr_build_and_list(), strvec_to_or_list().
Definition at line 313 of file astring.c.
Referenced by cmdlevel_command(), explain_why_no_action_enabled(), helptext_unit(), illegal_action_msg(), req_text_insert(), role_units_translations(), and strvec_to_or_list().
Returns the real size requested for the string.
Definition at line 117 of file astring.h.
Referenced by get_token_value(), and read_a_line().
Sets the content to the empty string.
Definition at line 201 of file astring.c.
Referenced by action_prepare_ui_name(), action_prob_explain(), astr_copy(), astr_reserve(), concat_tile_activity_text(), fileinfoname(), format_duration(), get_bulb_tooltip(), get_global_warming_tooltip(), get_government_tooltip(), get_info_label_text(), get_info_label_text_popup(), get_nearest_city_text(), get_nuclear_winter_tooltip(), get_ping_time_text(), get_report_title(), get_science_goal_text(), get_science_target_text(), get_score_text(), get_spaceship_descr(), get_timeout_label_text(), get_token_eol(), get_token_value(), get_unit_info_label_text1(), get_unit_info_label_text2(), move_points_text_full(), popup_info_text(), read_a_line(), science_dialog_text(), text_happiness_cities(), text_happiness_luxuries(), text_happiness_nationality(), text_happiness_units(), and unit_description().
Returns whether the string is empty or not.
Definition at line 125 of file astring.h.
Referenced by ai_level_help(), astr_copy(), have_line(), and inf_log_str().
Free the memory associated with astr, and return astr to same state as after astr_init().
Definition at line 148 of file astring.c.
Referenced by action_prepare_ui_name(), actions_free(), ai_level_help(), check_for_game_over(), client_start_server(), cmdlevel_command(), create_advances_list(), create_improvements_list(), create_present_supported_units_widget_list(), create_races_dialog(), do_tech_parasite_effects(), effect_list_sanity_cb(), enabler_first_self_contradiction(), enabler_tile_tgt_local_diplrel_implies_claimed(), explain_why_no_action_enabled(), free_fileinfo_data(), get_bulb_tooltip(), get_science_goal_text(), get_unit_info_label_text2(), helptext_advance(), helptext_extra(), helptext_government(), helptext_nation(), helptext_terrain(), helptext_unit(), illegal_action_msg(), inf_close_partial(), insert_allows_single(), luascript_report(), mapimg_help(), notify_illegal_armistice_units(), units_select::paint(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_info_text(), popup_sabotage_dialog(), popup_sabotage_dialog(), real_players_dialog_update(), redraw_unit_info_label(), req_text_insert(), req_vec_change_translation(), req_vec_get_first_contradiction(), req_vec_get_first_missing_univ(), req_vec_get_first_redundant_req(), request_unit_goto(), sanity_check_ruleset_data(), save_action_auto_uflag_block(), science_dialog_text(), secfile_from_input_file(), setting_bitwise_to_str(), setting_match_prefix(), spy_steal_popup_shared(), spy_steal_shared(), text_happiness_buildings(), text_happiness_wonders(), unit_select_dialog_popup(), and update_source_label().
Initialize the struct.
Definition at line 139 of file astring.c.
Referenced by check_for_game_over(), do_tech_parasite_effects(), helptext_nation(), init_zeros(), mapimg_help(), req_to_fstring(), secfile_from_input_file(), and update_source_label().
Returns the length of the string.
Definition at line 101 of file astring.h.
Referenced by astr_add(), astr_add_line(), astr_vadd(), at_eol(), check_include(), get_token_value(), mapimg_help(), and read_a_line().
Check that astr has enough size to hold n, and realloc to a bigger size if necessary. Here n must be big enough to include the trailing ascii-null if required. The requested n is stored in astr->n. The actual amount allocated may be larger than n, and is stored in astr->n_alloc.
Definition at line 179 of file astring.c.
Referenced by astr_build_and_list(), astr_build_or_list(), astr_clear(), astr_vadd_at(), get_token_value(), and read_a_line().
Returns the string.
Definition at line 93 of file astring.h.
Referenced by action_prepare_ui_name(), action_prob_explain(), action_prob_to_text(), ai_level_help(), check_for_game_over(), check_include(), client_start_server(), concat_tile_activity_text(), create_advances_list(), create_improvements_list(), create_present_supported_units_widget_list(), create_races_dialog(), delegate_player_str(), do_tech_parasite_effects(), fileinfoname(), format_duration(), get_act_sel_action_custom_text(), get_airlift_text(), get_bulb_tooltip(), get_global_warming_tooltip(), get_government_tooltip(), get_info_label_text(), get_info_label_text_popup(), get_nearest_city_text(), get_nuclear_winter_tooltip(), get_ping_time_text(), get_report_title(), get_science_goal_text(), get_science_target_text(), get_score_text(), get_spaceship_descr(), get_tile_output_text(), get_timeout_label_text(), get_token_entry_name(), get_token_eol(), get_token_section_name(), get_token_value(), get_token_white_char(), get_unit_info_label_text1(), get_unit_info_label_text2(), helptext_government(), helptext_nation(), helptext_unit(), illegal_action_msg(), inf_log_str(), inf_token(), luascript_report(), mapimg_help(), move_points_text_full(), notify_illegal_armistice_units(), units_select::paint(), popup_action_selection(), popup_advanced_terrain_dialog(), popup_info_text(), popup_sabotage_dialog(), popup_sabotage_dialog(), read_a_line(), real_players_dialog_update(), redraw_unit_info_label(), req_text_insert(), req_to_fstring(), request_unit_goto(), science_dialog_text(), secfile_from_input_file(), setting_bitwise_to_str(), spy_steal_popup_shared(), spy_steal_shared(), ssetv_human_readable(), text_happiness_buildings(), text_happiness_cities(), text_happiness_luxuries(), text_happiness_nationality(), text_happiness_units(), text_happiness_wonders(), unit_description(), unit_select_dialog_popup(), and update_source_label().
Return the raw string to the caller, and return astr to same state as after astr_init(). Freeing the string's storage becomes the caller's responsibility.
Definition at line 163 of file astring.c.
Referenced by ai_level_help(), fc__attribute(), fc__attribute(), players_vision_callback(), players_vision_callback(), players_war_callback(), and players_war_callback().
Free astr handling API resources
Definition at line 406 of file astring.c.
Referenced by libfreeciv_free().