Freeciv-3.3: /fast/freeciv/nightly/main/client/update_queue.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
update_queue.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "log.h"
20#include "support.h" /* bool */
21
22/* common */
23#include "city.h"
24#include "connection.h"
25#include "player.h"
26
27/* client/include */
28#include "canvas_g.h"
29#include "citydlg_g.h"
30#include "cityrep_g.h"
31#include "dialogs_g.h"
32#include "gui_main_g.h"
33#include "menu_g.h"
34#include "pages_g.h"
35#include "plrdlg_g.h"
36#include "ratesdlg_g.h"
37#include "repodlgs_g.h"
38
39/* client */
40#include "client_main.h"
41#include "connectdlg_common.h"
42#include "options.h"
43#include "tilespec.h"
44#include "zoom.h"
45
46#include "update_queue.h"
47
48
49/* Data type in 'update_queue'. */
50 struct update_queue_data {
51 void *data;
52 uq_free_fn_t free_data_func;
53};
54
55static void update_queue_data_destroy(struct update_queue_data *pdata);
56
57/* 'struct update_queue_hash' and related functions. */
58#define SPECHASH_TAG update_queue
59#define SPECHASH_IKEY_TYPE uq_callback_t
60#define SPECHASH_IDATA_TYPE struct update_queue_data *
61#define SPECHASH_IDATA_FREE update_queue_data_destroy
62#include "spechash.h"
63#define update_queue_hash_iterate(hash, callback, uq_data) \
64 TYPED_HASH_ITERATE(uq_callback_t, const struct update_queue_data *, \
65 hash, callback, uq_data)
66#define update_queue_hash_iterate_end HASH_ITERATE_END
67
68/* Type of data listed in 'processing_started_waiting_queue' and
69 * 'processing_finished_waiting_queue'. Real type is
70 * 'struct waiting_queue_list'. */
71 struct waiting_queue_data {
72 uq_callback_t callback;
73 struct update_queue_data *uq_data;
74};
75
76/* 'struct waiting_queue_list' and related functions. */
77#define SPECLIST_TAG waiting_queue
78#define SPECLIST_TYPE struct waiting_queue_data
79#include "speclist.h"
80#define waiting_queue_list_iterate(list, data) \
81 TYPED_LIST_ITERATE(struct waiting_queue_data, list, data)
82#define waiting_queue_list_iterate_end LIST_ITERATE_END
83
84/* 'struct waiting_queue_hash' and related functions. */
85#define SPECHASH_TAG waiting_queue
86#define SPECHASH_INT_KEY_TYPE
87#define SPECHASH_IDATA_TYPE struct waiting_queue_list *
88#define SPECHASH_IDATA_FREE waiting_queue_list_destroy
89#include "spechash.h"
90
91 static struct update_queue_hash *update_queue = NULL;
92 static struct waiting_queue_hash *processing_started_waiting_queue = NULL;
93 static struct waiting_queue_hash *processing_finished_waiting_queue = NULL;
94 static int update_queue_frozen_level = 0;
95 static bool update_queue_has_idle_callback = FALSE;
96
97static void update_unqueue(void *data);
98static inline void update_queue_push(uq_callback_t callback,
99 struct update_queue_data *uq_data);
100
101/************************************************************************/
104static inline struct update_queue_data *
105update_queue_data_new(void *data, uq_free_fn_t free_data_func)
106{
107 struct update_queue_data *uq_data = fc_malloc(sizeof(*uq_data));
108
109 uq_data->data = data;
110 uq_data->free_data_func = free_data_func;
111 return uq_data;
112}
113
114/************************************************************************/
117 static void update_queue_data_destroy(struct update_queue_data *uq_data)
118{
119 fc_assert_ret(NULL != uq_data);
120 if (NULL != uq_data->free_data_func) {
121 uq_data->free_data_func(uq_data->data);
122 }
123 free(uq_data);
124}
125
126/************************************************************************/
129static inline struct waiting_queue_data *
130waiting_queue_data_new(uq_callback_t callback, void *data,
131 uq_free_fn_t free_data_func)
132{
133 struct waiting_queue_data *wq_data = fc_malloc(sizeof(*wq_data));
134
135 wq_data->callback = callback;
136 wq_data->uq_data = update_queue_data_new(data, free_data_func);
137 return wq_data;
138}
139
140/************************************************************************/
143 static void waiting_queue_data_destroy(struct waiting_queue_data *wq_data)
144{
145 fc_assert_ret(NULL != wq_data);
146 if (NULL != wq_data->uq_data) {
147 /* May be NULL, see waiting_queue_data_extract(). */
148 update_queue_data_destroy(wq_data->uq_data);
149 }
150 free(wq_data);
151}
152
153/************************************************************************/
156static inline struct update_queue_data *
157waiting_queue_data_extract(struct waiting_queue_data *wq_data)
158{
159 struct update_queue_data *uq_data = wq_data->uq_data;
160
161 wq_data->uq_data = NULL;
162 return uq_data;
163}
164
165
166/************************************************************************/
169 void update_queue_init(void)
170{
171 if (NULL != update_queue) {
172 /* Already initialized. */
173 fc_assert(NULL != processing_started_waiting_queue);
174 fc_assert(NULL != processing_finished_waiting_queue);
175 return;
176 }
177 fc_assert(NULL == processing_started_waiting_queue);
178 fc_assert(NULL == processing_finished_waiting_queue);
179
180 update_queue = update_queue_hash_new();
181 processing_started_waiting_queue = waiting_queue_hash_new();
182 processing_finished_waiting_queue = waiting_queue_hash_new();
183 update_queue_frozen_level = 0;
184 update_queue_has_idle_callback = FALSE;
185}
186
187/************************************************************************/
190 void update_queue_free(void)
191{
192 fc_assert(NULL != update_queue);
193 fc_assert(NULL != processing_started_waiting_queue);
194 fc_assert(NULL != processing_finished_waiting_queue);
195
196 if (NULL != update_queue) {
197 update_queue_hash_destroy(update_queue);
198 update_queue = NULL;
199 }
200 if (NULL != processing_started_waiting_queue) {
201 waiting_queue_hash_destroy(processing_started_waiting_queue);
202 processing_started_waiting_queue = NULL;
203 }
204 if (NULL != processing_finished_waiting_queue) {
205 waiting_queue_hash_destroy(processing_finished_waiting_queue);
206 processing_finished_waiting_queue = NULL;
207 }
208
209 update_queue_frozen_level = 0;
210 update_queue_has_idle_callback = FALSE;
211}
212
213/************************************************************************/
216 void update_queue_freeze(void)
217{
218 update_queue_frozen_level++;
219}
220
221/************************************************************************/
224 void update_queue_thaw(void)
225{
226 update_queue_frozen_level--;
227 if (0 == update_queue_frozen_level
228 && !update_queue_has_idle_callback
229 && NULL != update_queue
230 && 0 < update_queue_hash_size(update_queue)) {
231 update_queue_has_idle_callback = TRUE;
232 add_idle_callback(update_unqueue, NULL);
233 } else if (0 > update_queue_frozen_level) {
234 log_error("update_queue_frozen_level < 0, repairing...");
235 update_queue_frozen_level = 0;
236 }
237}
238
239/************************************************************************/
242 void update_queue_force_thaw(void)
243{
244 while (update_queue_is_frozen()) {
245 update_queue_thaw();
246 }
247}
248
249/************************************************************************/
252 bool update_queue_is_frozen(void)
253{
254 return (0 < update_queue_frozen_level);
255}
256
257/************************************************************************/
260static inline void
261waiting_queue_execute_pending_requests(struct waiting_queue_hash *hash,
262 int request_id)
263{
264 struct waiting_queue_list *list;
265
266 if (NULL == hash || !waiting_queue_hash_lookup(hash, request_id, &list)) {
267 return;
268 }
269
270 waiting_queue_list_iterate(list, wq_data) {
271 update_queue_push(wq_data->callback, waiting_queue_data_extract(wq_data));
272 } waiting_queue_list_iterate_end;
273 waiting_queue_hash_remove(hash, request_id);
274}
275
276/************************************************************************/
279 void update_queue_processing_started(int request_id)
280{
281 waiting_queue_execute_pending_requests(processing_started_waiting_queue,
282 request_id);
283}
284
285/************************************************************************/
288 void update_queue_processing_finished(int request_id)
289{
290 waiting_queue_execute_pending_requests(processing_finished_waiting_queue,
291 request_id);
292}
293
294/************************************************************************/
297 static void update_unqueue(void *data)
298{
299 struct update_queue_hash *hash;
300
301 if (NULL == update_queue) {
302 update_queue_has_idle_callback = FALSE;
303 return;
304 }
305
306 if (update_queue_is_frozen() || !tileset_is_fully_loaded()) {
307 /* Cannot update now, let's add it again. */
308 update_queue_has_idle_callback = FALSE;
309 return;
310 }
311
312 /* Replace the old list, don't do recursive stuff, and don't write in the
313 * hash table when we are reading it. */
314 hash = update_queue;
315 update_queue = update_queue_hash_new();
316 update_queue_has_idle_callback = FALSE;
317
318 /* Invoke callbacks. */
319 update_queue_hash_iterate(hash, callback, uq_data) {
320 callback(uq_data->data);
321 } update_queue_hash_iterate_end;
322 update_queue_hash_destroy(hash);
323}
324
325/************************************************************************/
329 static inline void update_queue_push(uq_callback_t callback,
330 struct update_queue_data *uq_data)
331{
332 update_queue_hash_replace(update_queue, callback, uq_data);
333
334 if (!update_queue_has_idle_callback
335 && !update_queue_is_frozen()) {
336 update_queue_has_idle_callback = TRUE;
337 add_idle_callback(update_unqueue, NULL);
338 }
339}
340
341/************************************************************************/
345 void update_queue_add(uq_callback_t callback, void *data)
346{
347 if (NULL != update_queue) {
348 update_queue_push(callback, update_queue_data_new(data, NULL));
349 }
350}
351
352/************************************************************************/
356 void update_queue_add_full(uq_callback_t callback, void *data,
357 uq_free_fn_t free_data_func)
358{
359 if (NULL != update_queue) {
360 update_queue_push(callback, update_queue_data_new(data, free_data_func));
361 }
362}
363
364/************************************************************************/
367 bool update_queue_has_callback(uq_callback_t callback)
368{
369 return (NULL != update_queue
370 && update_queue_hash_lookup(update_queue, callback, NULL));
371}
372
373/************************************************************************/
378 bool update_queue_has_callback_full(uq_callback_t callback,
379 const void **data,
380 uq_free_fn_t *free_data_func)
381{
382 if (NULL != update_queue) {
383 struct update_queue_data *uq_data;
384
385 if (update_queue_hash_lookup(update_queue, callback, &uq_data)) {
386 if (NULL != data) {
387 *data = uq_data->data;
388 }
389 if (NULL != free_data_func) {
390 *free_data_func = uq_data->free_data_func;
391 }
392 return TRUE;
393 }
394 }
395 return FALSE;
396}
397
398/************************************************************************/
401static inline void
402waiting_queue_add_pending_request(struct waiting_queue_hash *hash,
403 int request_id, uq_callback_t callback,
404 void *data, uq_free_fn_t free_data_func)
405{
406 if (NULL != hash) {
407 struct waiting_queue_list *list;
408
409 if (!waiting_queue_hash_lookup(hash, request_id, &list)) {
410 /* The list doesn't exist yet for that request, create it. */
411 list = waiting_queue_list_new_full(waiting_queue_data_destroy);
412 waiting_queue_hash_insert(hash, request_id, list);
413 }
414 waiting_queue_list_append(list, waiting_queue_data_new(callback, data,
415 free_data_func));
416 }
417}
418
419/************************************************************************/
423 void update_queue_connect_processing_started(int request_id,
424 uq_callback_t callback,
425 void *data)
426{
427 waiting_queue_add_pending_request(processing_started_waiting_queue,
428 request_id, callback, data, NULL);
429}
430
431/************************************************************************/
435 void update_queue_connect_processing_started_full(int request_id,
436 uq_callback_t callback,
437 void *data,
438 uq_free_fn_t
439 free_data_func)
440{
441 waiting_queue_add_pending_request(processing_started_waiting_queue,
442 request_id, callback, data,
443 free_data_func);
444}
445
446/************************************************************************/
450 void update_queue_connect_processing_finished(int request_id,
451 uq_callback_t callback,
452 void *data)
453{
454 waiting_queue_add_pending_request(processing_finished_waiting_queue,
455 request_id, callback, data, NULL);
456}
457
458/************************************************************************/
462 void update_queue_connect_processing_finished_full(int request_id,
463 uq_callback_t callback,
464 void *data,
465 uq_free_fn_t
466 free_data_func)
467{
468 waiting_queue_add_pending_request(processing_finished_waiting_queue,
469 request_id, callback, data,
470 free_data_func);
471}
472
473/************************************************************************/
476 static void set_client_page_callback(void *data)
477{
478 enum client_pages page = FC_PTR_TO_INT(data);
479
480 real_set_client_page(page);
481
482 if (page == PAGE_GAME) {
483 if (has_zoom_support()) {
484 if (gui_options.zoom_set) {
485 zoom_set(gui_options.zoom_default_level);
486 } else {
487 zoom_1_0();
488 }
489 }
490 }
491}
492
493/************************************************************************/
496 void set_client_page(enum client_pages page)
497{
498 log_debug("Requested page: %s.", client_pages_name(page));
499
500 update_queue_add(set_client_page_callback, FC_INT_TO_PTR(page));
501}
502
503/************************************************************************/
506 void client_start_server_and_set_page(enum client_pages page)
507{
508 log_debug("Requested server start + page: %s.", client_pages_name(page));
509
510 if (client_start_server()) {
511 update_queue_connect_processing_finished(client.conn.client.last_request_id_used,
512 set_client_page_callback,
513 FC_INT_TO_PTR(page));
514 }
515}
516
517/************************************************************************/
520 enum client_pages get_client_page(void)
521{
522 const void *data;
523
524 if (update_queue_has_callback_full(set_client_page_callback,
525 &data, NULL)) {
526 return FC_PTR_TO_INT(data);
527 } else {
528 return get_current_client_page();
529 }
530}
531
532/************************************************************************/
535 bool update_queue_is_switching_page(void)
536{
537 return update_queue_has_callback(set_client_page_callback);
538}
539
540/************************************************************************/
543 static void menus_update_callback(void *data)
544{
545 if (FC_PTR_TO_INT(data)) {
546 real_menus_init();
547 }
548 real_menus_update();
549}
550
551/************************************************************************/
554 void menus_init(void)
555{
556 update_queue_add(menus_update_callback, FC_INT_TO_PTR(TRUE));
557}
558
559/************************************************************************/
562 void menus_update(void)
563{
564 if (!update_queue_has_callback(menus_update_callback)) {
565 update_queue_add(menus_update_callback, FC_INT_TO_PTR(FALSE));
566 }
567}
568
569/************************************************************************/
572 void multipliers_dialog_update(void)
573{
574 update_queue_add(real_multipliers_dialog_update, NULL);
575}
576
577/************************************************************************/
580 static void cities_update_callback(void *data)
581{
582#ifdef FREECIV_DEBUG
583#define NEED_UPDATE(city_update, action) \
584 if (city_update & need_update) { \
585 action; \
586 need_update &= ~city_update; \
587 }
588#else /* FREECIV_DEBUG */
589#define NEED_UPDATE(city_update, action) \
590 if (city_update & need_update) { \
591 action; \
592 }
593#endif /* FREECIV_DEBUG */
594
595 cities_iterate(pcity) {
596 enum city_updates need_update = pcity->client.need_updates;
597
598 if (CU_NO_UPDATE == need_update) {
599 continue;
600 }
601
602 /* Clear all updates. */
603 pcity->client.need_updates = CU_NO_UPDATE;
604
605 NEED_UPDATE(CU_UPDATE_REPORT, real_city_report_update_city(pcity));
606 NEED_UPDATE(CU_UPDATE_DIALOG, real_city_dialog_refresh(pcity));
607 NEED_UPDATE(CU_POPUP_DIALOG, real_city_dialog_popup(pcity));
608
609#ifdef FREECIV_DEBUG
610 if (CU_NO_UPDATE != need_update) {
611 log_error("Some city updates not handled "
612 "for city %s (id %d): %d left.",
613 city_name_get(pcity), pcity->id, need_update);
614 }
615#endif /* FREECIV_DEBUG */
616 } cities_iterate_end;
617#undef NEED_UPDATE
618}
619
620/************************************************************************/
623 void popup_city_dialog(struct city *pcity)
624{
625 pcity->client.need_updates |= CU_POPUP_DIALOG;
626 update_queue_add(cities_update_callback, NULL);
627}
628
629/************************************************************************/
632 void refresh_city_dialog(struct city *pcity)
633{
634 pcity->client.need_updates |= CU_UPDATE_DIALOG;
635 update_queue_add(cities_update_callback, NULL);
636}
637
638/************************************************************************/
641 void city_report_dialog_update_city(struct city *pcity)
642{
643 pcity->client.need_updates |= CU_UPDATE_REPORT;
644 update_queue_add(cities_update_callback, NULL);
645}
646
647/************************************************************************/
650 void conn_list_dialog_update(void)
651{
652 update_queue_add(real_conn_list_dialog_update, NULL);
653}
654
655/************************************************************************/
658 void players_dialog_update(void)
659{
660 update_queue_add(real_players_dialog_update, NULL);
661}
662
663/************************************************************************/
666 void city_report_dialog_update(void)
667{
668 update_queue_add(real_city_report_dialog_update, NULL);
669}
670
671/************************************************************************/
674 void science_report_dialog_update(void)
675{
676 update_queue_add(real_science_report_dialog_update, NULL);
677}
678
679/************************************************************************/
682 void economy_report_dialog_update(void)
683{
684 update_queue_add(real_economy_report_dialog_update, NULL);
685}
686
687/************************************************************************/
690 void units_report_dialog_update(void)
691{
692 update_queue_add(real_units_report_dialog_update, NULL);
693}
694
695/************************************************************************/
698 void unit_select_dialog_update(void)
699{
700 update_queue_add(unit_select_dialog_update_real, NULL);
701}
canvas_g.h
city_name_get
const char * city_name_get(const struct city *pcity)
Definition city.c:1128
city.h
cities_iterate_end
#define cities_iterate_end
Definition city.h:517
cities_iterate
#define cities_iterate(pcity)
Definition city.h:512
city_updates
city_updates
Definition city.h:298
CU_POPUP_DIALOG
@ CU_POPUP_DIALOG
Definition city.h:302
CU_UPDATE_REPORT
@ CU_UPDATE_REPORT
Definition city.h:300
CU_UPDATE_DIALOG
@ CU_UPDATE_DIALOG
Definition city.h:301
CU_NO_UPDATE
@ CU_NO_UPDATE
Definition city.h:299
citydlg_g.h
cityrep_g.h
client
struct civclient client
Definition client_main.c:150
client_main.h
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
incite_cost
char * incite_cost
Definition comments.c:74
client_start_server
bool client_start_server(void)
Definition connectdlg_common.c:224
connectdlg_common.h
connection.h
dialogs_g.h
has_zoom_support
bool has_zoom_support(void)
Definition canvas.c:61
real_city_dialog_popup
void real_city_dialog_popup(struct city *pcity)
Definition citydlg.c:558
real_city_dialog_refresh
void real_city_dialog_refresh(struct city *pcity)
Definition citydlg.c:480
real_city_report_dialog_update
void real_city_report_dialog_update(void *unused)
Definition cityrep.c:1454
real_city_report_update_city
void real_city_report_update_city(struct city *pcity)
Definition cityrep.c:1489
unit_select_dialog_update_real
void unit_select_dialog_update_real(void *unused)
Definition dialogs.c:386
real_multipliers_dialog_update
void real_multipliers_dialog_update(void *unused)
Definition gamedlgs.c:293
add_idle_callback
void add_idle_callback(void(callback)(void *), void *data)
Definition gui_main.c:2427
real_menus_init
void real_menus_init(void)
Definition menu.c:2910
real_menus_update
void real_menus_update(void)
Definition menu.c:2353
get_current_client_page
enum client_pages get_current_client_page(void)
Definition pages.c:3329
real_set_client_page
void real_set_client_page(enum client_pages new_page)
Definition pages.c:3337
real_conn_list_dialog_update
void real_conn_list_dialog_update(void *unused)
Definition pages.c:2328
real_players_dialog_update
void real_players_dialog_update(void *unused)
Definition plrdlg.c:730
real_units_report_dialog_update
void real_units_report_dialog_update(void *unused)
Definition repodlgs.c:1794
real_economy_report_dialog_update
void real_economy_report_dialog_update(void *unused)
Definition repodlgs.c:1268
real_science_report_dialog_update
void real_science_report_dialog_update(void *unused)
Definition repodlgs.c:751
hash
static GHashTable * hash
Definition wldlg.c:322
gui_main_g.h
log.h
fc_assert_ret
#define fc_assert_ret(condition)
Definition log.h:191
fc_assert
#define fc_assert(condition)
Definition log.h:176
log_debug
#define log_debug(message,...)
Definition log.h:115
log_error
#define log_error(message,...)
Definition log.h:103
fc_malloc
#define fc_malloc(sz)
Definition mem.h:34
menu_g.h
gui_options
struct client_options gui_options
Definition options.c:71
options.h
pages_g.h
player.h
plrdlg_g.h
ratesdlg_g.h
repodlgs_g.h
FC_PTR_TO_INT
#define FC_PTR_TO_INT(p)
Definition shared.h:95
FC_INT_TO_PTR
#define FC_INT_TO_PTR(i)
Definition shared.h:94
spechash.h
speclist.h
callback
Definition gui_main.c:2404
city
Definition city.h:320
city::need_updates
enum city_updates need_updates
Definition city.h:481
city::client
struct city::@17::@20 client
civclient::conn
struct connection conn
Definition client_main.h:96
client_options::zoom_set
bool zoom_set
Definition options.h:231
client_options::zoom_default_level
float zoom_default_level
Definition options.h:232
connection::client
struct connection::@58::@63 client
connection::last_request_id_used
int last_request_id_used
Definition connection.h:187
update_queue_data
Definition update_queue.c:50
update_queue_data::data
void * data
Definition update_queue.c:51
update_queue_data::free_data_func
uq_free_fn_t free_data_func
Definition update_queue.c:52
waiting_queue_data
Definition update_queue.c:71
waiting_queue_data::callback
uq_callback_t callback
Definition update_queue.c:72
waiting_queue_data::uq_data
struct update_queue_data * uq_data
Definition update_queue.c:73
support.h
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
tileset_is_fully_loaded
bool tileset_is_fully_loaded(void)
Definition tilespec.c:7536
tilespec.h
waiting_queue_list_iterate
#define waiting_queue_list_iterate(list, data)
Definition update_queue.c:80
waiting_queue_add_pending_request
static void waiting_queue_add_pending_request(struct waiting_queue_hash *hash, int request_id, uq_callback_t callback, void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:402
update_queue_is_switching_page
bool update_queue_is_switching_page(void)
Definition update_queue.c:535
update_queue_free
void update_queue_free(void)
Definition update_queue.c:190
client_start_server_and_set_page
void client_start_server_and_set_page(enum client_pages page)
Definition update_queue.c:506
waiting_queue_data_extract
static struct update_queue_data * waiting_queue_data_extract(struct waiting_queue_data *wq_data)
Definition update_queue.c:157
conn_list_dialog_update
void conn_list_dialog_update(void)
Definition update_queue.c:650
update_queue_is_frozen
bool update_queue_is_frozen(void)
Definition update_queue.c:252
economy_report_dialog_update
void economy_report_dialog_update(void)
Definition update_queue.c:682
set_client_page
void set_client_page(enum client_pages page)
Definition update_queue.c:496
multipliers_dialog_update
void multipliers_dialog_update(void)
Definition update_queue.c:572
update_queue_push
static void update_queue_push(uq_callback_t callback, struct update_queue_data *uq_data)
Definition update_queue.c:329
update_queue_hash_iterate
#define update_queue_hash_iterate(hash, callback, uq_data)
Definition update_queue.c:63
update_queue_connect_processing_finished_full
void update_queue_connect_processing_finished_full(int request_id, uq_callback_t callback, void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:462
update_queue_add_full
void update_queue_add_full(uq_callback_t callback, void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:356
city_report_dialog_update_city
void city_report_dialog_update_city(struct city *pcity)
Definition update_queue.c:641
update_queue_connect_processing_started
void update_queue_connect_processing_started(int request_id, uq_callback_t callback, void *data)
Definition update_queue.c:423
update_queue
static struct update_queue_hash * update_queue
Definition update_queue.c:91
processing_finished_waiting_queue
static struct waiting_queue_hash * processing_finished_waiting_queue
Definition update_queue.c:93
science_report_dialog_update
void science_report_dialog_update(void)
Definition update_queue.c:674
update_queue_thaw
void update_queue_thaw(void)
Definition update_queue.c:224
waiting_queue_data_destroy
static void waiting_queue_data_destroy(struct waiting_queue_data *wq_data)
Definition update_queue.c:143
update_queue_init
void update_queue_init(void)
Definition update_queue.c:169
update_queue_data_new
static struct update_queue_data * update_queue_data_new(void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:105
popup_city_dialog
void popup_city_dialog(struct city *pcity)
Definition update_queue.c:623
update_queue_has_callback_full
bool update_queue_has_callback_full(uq_callback_t callback, const void **data, uq_free_fn_t *free_data_func)
Definition update_queue.c:378
update_unqueue
static void update_unqueue(void *data)
Definition update_queue.c:297
set_client_page_callback
static void set_client_page_callback(void *data)
Definition update_queue.c:476
cities_update_callback
static void cities_update_callback(void *data)
Definition update_queue.c:580
refresh_city_dialog
void refresh_city_dialog(struct city *pcity)
Definition update_queue.c:632
update_queue_freeze
void update_queue_freeze(void)
Definition update_queue.c:216
update_queue_force_thaw
void update_queue_force_thaw(void)
Definition update_queue.c:242
update_queue_connect_processing_started_full
void update_queue_connect_processing_started_full(int request_id, uq_callback_t callback, void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:435
update_queue_processing_finished
void update_queue_processing_finished(int request_id)
Definition update_queue.c:288
processing_started_waiting_queue
static struct waiting_queue_hash * processing_started_waiting_queue
Definition update_queue.c:92
update_queue_data_destroy
static void update_queue_data_destroy(struct update_queue_data *pdata)
Definition update_queue.c:117
update_queue_has_idle_callback
static bool update_queue_has_idle_callback
Definition update_queue.c:95
units_report_dialog_update
void units_report_dialog_update(void)
Definition update_queue.c:690
update_queue_connect_processing_finished
void update_queue_connect_processing_finished(int request_id, uq_callback_t callback, void *data)
Definition update_queue.c:450
update_queue_add
void update_queue_add(uq_callback_t callback, void *data)
Definition update_queue.c:345
players_dialog_update
void players_dialog_update(void)
Definition update_queue.c:658
waiting_queue_data_new
static struct waiting_queue_data * waiting_queue_data_new(uq_callback_t callback, void *data, uq_free_fn_t free_data_func)
Definition update_queue.c:130
NEED_UPDATE
#define NEED_UPDATE(city_update, action)
menus_update
void menus_update(void)
Definition update_queue.c:562
update_queue_processing_started
void update_queue_processing_started(int request_id)
Definition update_queue.c:279
menus_update_callback
static void menus_update_callback(void *data)
Definition update_queue.c:543
city_report_dialog_update
void city_report_dialog_update(void)
Definition update_queue.c:666
update_queue_frozen_level
static int update_queue_frozen_level
Definition update_queue.c:94
menus_init
void menus_init(void)
Definition update_queue.c:554
update_queue_has_callback
bool update_queue_has_callback(uq_callback_t callback)
Definition update_queue.c:367
waiting_queue_list_iterate_end
#define waiting_queue_list_iterate_end
Definition update_queue.c:82
waiting_queue_execute_pending_requests
static void waiting_queue_execute_pending_requests(struct waiting_queue_hash *hash, int request_id)
Definition update_queue.c:261
get_client_page
enum client_pages get_client_page(void)
Definition update_queue.c:520
unit_select_dialog_update
void unit_select_dialog_update(void)
Definition update_queue.c:698
update_queue_hash_iterate_end
#define update_queue_hash_iterate_end
Definition update_queue.c:66
update_queue.h
uq_free_fn_t
void(* uq_free_fn_t)(void *data)
Definition update_queue.h:24
uq_callback_t
void(* uq_callback_t)(void *data)
Definition update_queue.h:23
zoom_1_0
void zoom_1_0(void)
Definition zoom.c:70
zoom_set
void zoom_set(float new_zoom)
Definition zoom.c:53
zoom.h