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)
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 #ifndef FC__UPDATE_QUEUE_H
14 #define FC__UPDATE_QUEUE_H
18 #endif /* __cplusplus */
20 typedef void (*uq_callback_t
) (void *data
);
21 #define UQ_CALLBACK(fn) ((uq_callback_t) fn)
22 typedef void (*uq_free_fn_t
) (void *data
);
23 #define UQ_FREEDATA(fn) ((uq_free_fn_t) fn)
25 /* General update queue. */
26 void update_queue_init(void);
27 void update_queue_free(void);
29 void update_queue_freeze(void);
30 void update_queue_thaw(void);
31 void update_queue_force_thaw(void);
32 bool update_queue_is_frozen(void);
34 void update_queue_processing_started(int request_id
);
35 void update_queue_processing_finished(int request_id
);
38 void update_queue_add(uq_callback_t callback
, void *data
);
39 void update_queue_add_full(uq_callback_t callback
, void *data
,
40 uq_free_fn_t free_data_func
);
41 bool update_queue_has_callback(uq_callback_t callback
);
42 bool update_queue_has_callback_full(uq_callback_t callback
,
44 uq_free_fn_t
*free_data_func
);
46 void update_queue_connect_processing_started(int request_id
,
47 uq_callback_t callback
,
49 void update_queue_connect_processing_started_full(int request_id
,
50 uq_callback_t callback
,
54 void update_queue_connect_processing_finished(int request_id
,
55 uq_callback_t callback
,
57 void update_queue_connect_processing_finished_full(int request_id
,
58 uq_callback_t callback
,
65 #endif /* __cplusplus */
67 #endif /* FC__UPDATE_QUEUE_H */