Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions | Variables
specvec.h File Reference
#include <string.h>
#include "mem.h"

Go to the source code of this file.

Macros

#define SPECVEC_TYPE   struct SPECVEC_TAG
 
#define SPECVEC_PASTE_(x, y)   x ## y
 
#define SPECVEC_PASTE(x, y)   SPECVEC_PASTE_(x,y)
 
#define SPECVEC_VECTOR   struct SPECVEC_PASTE(SPECVEC_TAG, _vector)
 
#define SPECVEC_FOO(suffix)   SPECVEC_PASTE(SPECVEC_TAG, suffix)
 
#define TYPED_VECTOR_ITERATE(atype, vector, var)
 
#define VECTOR_ITERATE_END   }}
 

Functions

static void SPECVEC_FOO() _vector_init (SPECVEC_VECTOR *tthis)
 
static void SPECVEC_FOO() _vector_reserve (SPECVEC_VECTOR *tthis, size_t size)
 
static size_t SPECVEC_FOO() _vector_size (const SPECVEC_VECTOR *tthis)
 
static SPECVEC_TYPE *SPECVEC_FOO() _vector_get (const SPECVEC_VECTOR *tthis, int svindex)
 
static void SPECVEC_FOO() _vector_copy (SPECVEC_VECTOR *to, const SPECVEC_VECTOR *from)
 
static void SPECVEC_FOO() _vector_free (SPECVEC_VECTOR *tthis)
 
static void SPECVEC_FOO() _vector_append (SPECVEC_VECTOR *tthis, SPECVEC_TYPE const pfoo)
 
static void SPECVEC_FOO() _vector_remove (SPECVEC_VECTOR *tthis, const int svindex)
 

Variables

 SPECVEC_VECTOR
 
size_t size
 
size_t size_alloc
 

Macro Definition Documentation

◆ SPECVEC_FOO

#define SPECVEC_FOO (   suffix)    SPECVEC_PASTE(SPECVEC_TAG, suffix)

Definition at line 66 of file specvec.h.

◆ SPECVEC_PASTE

#define SPECVEC_PASTE (   x,
  y 
)    SPECVEC_PASTE_(x,y)

Definition at line 62 of file specvec.h.

◆ SPECVEC_PASTE_

#define SPECVEC_PASTE_ (   x,
  y 
)    x ## y

Definition at line 61 of file specvec.h.

◆ SPECVEC_TYPE

#define SPECVEC_TYPE   struct SPECVEC_TAG

Definition at line 58 of file specvec.h.

◆ SPECVEC_VECTOR

#define SPECVEC_VECTOR   struct SPECVEC_PASTE(SPECVEC_TAG, _vector)

Definition at line 64 of file specvec.h.

◆ TYPED_VECTOR_ITERATE

#define TYPED_VECTOR_ITERATE (   atype,
  vector,
  var 
)
Value:
{ \
unsigned int myiter##var; \
for (myiter##var = 0; myiter##var < (vector)->size; myiter##var++) { \
var = &(vector)->p[myiter##var]; \
char * incite_cost
Definition comments.c:76
size_t size
Definition specvec.h:72

Definition at line 186 of file specvec.h.

◆ VECTOR_ITERATE_END

#define VECTOR_ITERATE_END   }}

Definition at line 193 of file specvec.h.

Function Documentation

◆ _vector_append()

static void SPECVEC_FOO() _vector_append ( SPECVEC_VECTOR tthis,
SPECVEC_TYPE const  pfoo 
)
inlinestatic

Add pfoo to the end of the vector

Definition at line 152 of file specvec.h.

◆ _vector_copy()

static void SPECVEC_FOO() _vector_copy ( SPECVEC_VECTOR to,
const SPECVEC_VECTOR from 
)
inlinestatic

Copy vector to vector.

"*to" must be initialized by the _init() before the call.

Definition at line 129 of file specvec.h.

◆ _vector_free()

static void SPECVEC_FOO() _vector_free ( SPECVEC_VECTOR tthis)
inlinestatic

Free the vector

Definition at line 141 of file specvec.h.

◆ _vector_get()

static SPECVEC_TYPE *SPECVEC_FOO() _vector_get ( const SPECVEC_VECTOR tthis,
int  svindex 
)
inlinestatic

Get element at position svindex

Definition at line 111 of file specvec.h.

◆ _vector_init()

static void SPECVEC_FOO() _vector_init ( SPECVEC_VECTOR tthis)
inlinestatic

Initialize the vector

Definition at line 78 of file specvec.h.

Referenced by _vector_free().

◆ _vector_remove()

static void SPECVEC_FOO() _vector_remove ( SPECVEC_VECTOR tthis,
const int  svindex 
)
inlinestatic

Remove element number svindex from the vector.

Definition at line 162 of file specvec.h.

◆ _vector_reserve()

static void SPECVEC_FOO() _vector_reserve ( SPECVEC_VECTOR tthis,
size_t  size 
)
inlinestatic

Allocate vector to at least to size 'size'

Definition at line 87 of file specvec.h.

Referenced by _vector_append(), _vector_copy(), and _vector_remove().

◆ _vector_size()

static size_t SPECVEC_FOO() _vector_size ( const SPECVEC_VECTOR tthis)
inlinestatic

Return size of the vector

Definition at line 103 of file specvec.h.

Referenced by _vector_remove().

Variable Documentation

◆ size

size_t size

Definition at line 72 of file specvec.h.

Referenced by _pq_remove(), _vector_reserve(), action_array_end(), adjust_int_map_filtered(), append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), base_fc_utf8_char_validate(), begin_lanserver_scan(), body(), build_free_small_wonders(), chain2text(), citizen_base_mood(), city_build(), city_change_size(), city_incite_cost(), city_size_add(), city_size_set(), compat_load_020400(), configure_font(), configure_single(), convert_utf8_str_to_const_surface_width(), create_and_append_settings_page(), create_main_page(), progress_bar::create_region(), create_window_skeleton(), chatwdg::default_size(), dio_input_skip(), dio_put_memory_raw(), dsend_packet_edit_city_create(), dsend_packet_edit_player_vision(), dsend_packet_edit_tile_extra(), dsend_packet_edit_tile_terrain(), dummy_write(), editor_apply_tool(), editor_tool_set_size(), enough_data(), enough_space(), fair_map_island_new(), fc_querysocket(), fc_rand_debug(), fc_randomly_debug(), fc_readsocket(), fc_real_calloc(), fc_real_malloc(), fc_real_realloc(), fc_utf8_validate(), fc_utf8_validate_len(), fc_utf8_validate_rep_dup(), fc_utf8_validate_trunc_dup(), fc_writesocket(), fill_sprite_array(), fz_fgets(), fz_from_memory(), get_help_item(), get_packet_from_connection_raw(), get_player_or_user_name(), get_text_size(), gui_update_font(), handle_alloc_failure(), handle_edit_city_create(), handle_edit_key_press(), handle_edit_key_press(), handle_edit_player_vision(), handle_edit_tile_extra(), handle_edit_tile_terrain(), historian_generic(), hud_input_box::hud_input_box(), hud_message_box::hud_message_box(), hud_text::hud_text(), fc_shortcuts_dialog::init(), load_city_thresholds_sprites(), mapgenerator3(), max_tile_trade(), MD5_Update(), meswin_dialog_popup(), netfile_memwrite_cb(), city_dialog::next_city(), next_prev_city_dlg_callback(), notify_about_incoming_packet(), notify_about_outgoing_packet(), popup_info_text(), city_dialog::prev_city(), property_page_create_objects(), propval_copy(), races_dialog::races_dialog(), recalculate_surrounders(), receive_packet_city_info_100(), receive_packet_city_short_info_100(), receive_packet_edit_city_100(), receive_packet_edit_city_create_100(), receive_packet_edit_player_vision_100(), receive_packet_edit_tile_extra_100(), receive_packet_edit_tile_terrain_100(), redraw_army_city_dialog(), redraw_supported_units_city_dialog(), report_final_scores(), report_top_cities(), science_report::reset_tree(), fc_game_tab_widget::resizeEvent(), minimap_view::resizeEvent(), ruledit_main::ruledit_main(), scanin(), science_report::science_report(), send_lanserver_response(), send_packet_data(), server_handle_packet(), server_packet_input(), city_map::set_pixmap(), set_sizes(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_player_city(), sg_load_player_city(), sg_load_player_city_citizens(), sg_load_player_city_citizens(), sg_load_player_vision_city(), sg_load_player_vision_city(), show_full_citybar(), strvec_store(), switch_city_callback(), unit_foodbox_cost(), vision_site_size_set(), voteinfo_queue_get_current(), voteinfo_queue_next(), xsize_callback(), and ysize_callback().

◆ size_alloc

size_t size_alloc

Definition at line 72 of file specvec.h.

◆ SPECVEC_VECTOR

SPECVEC_VECTOR
Initial value:
{
#define SPECVEC_TYPE
Definition specvec.h:58

Definition at line 68 of file specvec.h.