Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/global_worklist.h Source File

Freeciv-3.1

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);
33void global_worklists_unbuild(void);
34
35void global_worklists_load(struct section_file *file);
36void global_worklists_save(struct section_file *file);
37int global_worklists_number(void);
38
39struct global_worklist *global_worklist_new(const char *name);
40void global_worklist_destroy(struct global_worklist *pgwl);
41
42struct global_worklist *global_worklist_by_id(int id);
43
44bool global_worklist_is_valid(const struct global_worklist *pgwl);
45bool global_worklist_set(struct global_worklist *pgwl,
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 */
global_worklist_by_id
struct global_worklist * global_worklist_by_id(int id)
Definition global_worklist.c:298
global_worklist_set
bool global_worklist_set(struct global_worklist *pgwl, const struct worklist *pwl)
Definition global_worklist.c:263
global_worklist_name
const char * global_worklist_name(const struct global_worklist *pgwl)
Definition global_worklist.c:323
global_worklist_id
int global_worklist_id(const struct global_worklist *pgwl)
Definition global_worklist.c:288
global_worklists_number
int global_worklists_number(void)
Definition global_worklist.c:173
global_worklist_is_valid
bool global_worklist_is_valid(const struct global_worklist *pgwl)
Definition global_worklist.c:255
global_worklist_destroy
void global_worklist_destroy(struct global_worklist *pgwl)
Definition global_worklist.c:214
global_worklists_build
void global_worklists_build(void)
Definition global_worklist.c:100
global_worklist_get
const struct worklist * global_worklist_get(const struct global_worklist *pgwl)
Definition global_worklist.c:276
global_worklists_load
void global_worklists_load(struct section_file *file)
Definition global_worklist.c:390
global_worklists_init
void global_worklists_init(void)
Definition global_worklist.c:76
global_worklists_free
void global_worklists_free(void)
Definition global_worklist.c:86
global_worklist_new
struct global_worklist * global_worklist_new(const char *name)
Definition global_worklist.c:244
global_worklists_unbuild
void global_worklists_unbuild(void)
Definition global_worklist.c:145
global_worklists_save
void global_worklists_save(struct section_file *file)
Definition global_worklist.c:465
global_worklist_set_name
void global_worklist_set_name(struct global_worklist *pgwl, const char *name)
Definition global_worklist.c:312
name
const char * name
Definition inputfile.c:127
registry.h
shared.h
speclist.h
global_worklist
Definition global_worklist.c:49
section_file
Definition section_file.h:36
worklist
Definition worklist.h:28
worklist.h