1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/***********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef FC__UPDATE_QUEUE_H
#define FC__UPDATE_QUEUE_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef void (*uq_callback_t) (void *data);
typedef void (*uq_free_fn_t) (void *data);
#define UQ_FREEDATA(fn) ((uq_free_fn_t) fn)
/* General update queue. */
void update_queue_init(void);
void update_queue_free(void);
void update_queue_freeze(void);
void update_queue_thaw(void);
void update_queue_force_thaw(void);
bool update_queue_is_frozen(void);
void update_queue_processing_started(int request_id);
void update_queue_processing_finished(int request_id);
/* User interface. */
void update_queue_add(uq_callback_t callback, void *data);
void update_queue_add_full(uq_callback_t callback, void *data,
uq_free_fn_t free_data_func);
bool update_queue_has_callback(uq_callback_t callback);
bool update_queue_has_callback_full(uq_callback_t callback,
const void **data,
uq_free_fn_t *free_data_func);
void update_queue_connect_processing_started(int request_id,
uq_callback_t callback,
void *data);
void update_queue_connect_processing_started_full(int request_id,
uq_callback_t callback,
void *data,
uq_free_fn_t
free_data_func);
void update_queue_connect_processing_finished(int request_id,
uq_callback_t callback,
void *data);
void update_queue_connect_processing_finished_full(int request_id,
uq_callback_t callback,
void *data,
uq_free_fn_t
free_data_func);
bool update_queue_is_switching_page(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FC__UPDATE_QUEUE_H */
|