Freeciv-3.3
Loading...
Searching...
No Matches
global_worklist.h
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#ifndef FC__GLOBAL_WORKLIST_H
14#define FC__GLOBAL_WORKLIST_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "registry.h"
22#include "shared.h"
23
24/* common */
25#include "worklist.h"
26
27struct global_worklist; /* Opaque type. */
28struct global_worklist_list; /* Opaque type. */
29
30void global_worklists_init(void);
31void global_worklists_free(void);
32void global_worklists_build(void);
34
35void global_worklists_load(struct section_file *file);
36void global_worklists_save(struct section_file *file);
38
39struct global_worklist *global_worklist_new(const char *name);
41
43
46 const struct worklist *pwl);
47const struct worklist *global_worklist_get(const struct global_worklist *pgwl);
48int global_worklist_id(const struct global_worklist *pgwl);
49void global_worklist_set_name(struct global_worklist *pgwl, const char *name);
50const char *global_worklist_name(const struct global_worklist *pgwl);
51
52#define SPECLIST_TAG global_worklist
53#define SPECLIST_TYPE struct global_worklist
54#include "speclist.h"
55
56/* Iterates all global worklists, include the ones which are not valid. */
57#define global_worklists_iterate_all(pgwl) \
58 if (client.worklists) { \
59 TYPED_LIST_ITERATE(struct global_worklist, client.worklists, pgwl)
60#define global_worklists_iterate_all_end \
61 LIST_ITERATE_END \
62 }
63
64/* Iterates all valid global worklists. */
65#define global_worklists_iterate(pgwl) \
66 global_worklists_iterate_all(pgwl) { \
67 if (global_worklist_is_valid(pgwl)) {
68#define global_worklists_iterate_end \
69 } \
70 } global_worklists_iterate_all_end;
71
72#ifdef __cplusplus
73}
74#endif /* __cplusplus */
75
76#endif /* FC__GLOBAL_WORKLIST_H */
char * incite_cost
Definition comments.c:76
struct global_worklist * global_worklist_by_id(int id)
bool global_worklist_set(struct global_worklist *pgwl, const struct worklist *pwl)
const char * global_worklist_name(const struct global_worklist *pgwl)
int global_worklist_id(const struct global_worklist *pgwl)
int global_worklists_number(void)
bool global_worklist_is_valid(const struct global_worklist *pgwl)
void global_worklist_destroy(struct global_worklist *pgwl)
void global_worklists_build(void)
const struct worklist * global_worklist_get(const struct global_worklist *pgwl)
void global_worklists_load(struct section_file *file)
void global_worklists_init(void)
void global_worklists_free(void)
struct global_worklist * global_worklist_new(const char *name)
void global_worklists_unbuild(void)
void global_worklists_save(struct section_file *file)
void global_worklist_set_name(struct global_worklist *pgwl, const char *name)
const char * name
Definition inputfile.c:127