Freeciv-3.3: /fast/freeciv/nightly/main/utility/shared.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
shared.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__SHARED_H
14#define FC__SHARED_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20#include <freeciv_config.h>
21
22#include <stdlib.h> /* size_t */
23#include <string.h> /* memset */
24#include <time.h> /* time_t */
25
26/* utility */
27#include "log.h"
28#include "support.h" /* bool, fc__attribute */
29
30/* Changing these will break network compatibility! */
31#define MAX_LEN_ADDR 256 /* See also MAXHOSTNAMELEN and RFC 1123 2.1 */
32#define MAX_LEN_PATH 4095
33
34/* Use FC_INFINITY to denote that a certain event will never occur or
35 another unreachable condition. */
36#define FC_INFINITY (1000 * 1000 * 1000)
37
38#ifndef FREECIV_TESTMATIC
39/* Initialize something for the sole purpose of silencing false compiler warning
40 * about variable possibly used uninitialized. */
41#define BAD_HEURISTIC_INIT(_ini_val_) = _ini_val_
42#else /* FREECIV_TESTMATIC */
43#define BAD_HEURISTIC_INIT(_ini_val_)
44#endif /* FREECIV_TESTMATIC */
45
46 enum fc_tristate { TRI_NO, TRI_YES, TRI_MAYBE };
47#define BOOL_TO_TRISTATE(tri) ((tri) ? TRI_YES : TRI_NO)
48
49enum fc_tristate fc_tristate_and(enum fc_tristate one,
50 enum fc_tristate two);
51enum fc_tristate fc_tristate_or(enum fc_tristate one, enum fc_tristate two);
52
53#ifndef MAX
54#define MAX(x,y) (((x)>(y))?(x):(y))
55#define MIN(x,y) (((x)<(y))?(x):(y))
56#endif
57#define CLIP(lower,current,upper) \
58 ((current)<(lower)?(lower):(current)>(upper)?(upper):(current))
59
60#ifndef ABS
61#define ABS(x) (((x) >= 0) ? (x) : -(x))
62#endif
63
64/* Note: Solaris already has a WRAP macro that is completely different. */
65#define FC_WRAP(value, range) \
66 ((value) < 0 \
67 ? ((value) % (range) != 0 ? (value) % (range) + (range) : 0) \
68 : ((value) >= (range) ? (value) % (range) : (value)))
69
70#define BOOL_VAL(x) ((x) != 0)
71#define XOR(p, q) (BOOL_VAL(p) != BOOL_VAL(q))
72#define EQ(p, q) (BOOL_VAL(p) == BOOL_VAL(q))
73
74/*
75 * DIVIDE() divides and rounds down, rather than just divides and
76 * rounds toward 0. It is assumed that the divisor is positive.
77 */
78#define DIVIDE(n, d) \
79 ( (n) / (d) - (( (n) < 0 && (n) % (d) < 0 ) ? 1 : 0) )
80
81#define MAX_UINT32 0xFFFFFFFF
82#define MAX_UINT16 0xFFFF
83#define MAX_UINT8 0xFF
84
85#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
86#define ADD_TO_POINTER(p, n) ((void *)((char *)(p)+(n)))
87
88#define FC_MEMBER(type, member) (((type *) nullptr)->member)
89#define FC_MEMBER_OFFSETOF(type, member) ((size_t) &FC_MEMBER(type, member))
90#define FC_MEMBER_SIZEOF(type, member) sizeof(FC_MEMBER(type, member))
91#define FC_MEMBER_ARRAY_SIZE(type, member) \
92 ARRAY_SIZE(FC_MEMBER(type, member))
93
94#define FC_INT_TO_PTR(i) ((void *) (intptr_t) (i))
95#define FC_PTR_TO_INT(p) ((int) (intptr_t) (p))
96
97/****************************************************************************
98 Used to initialize an array 'a' of size 'size' with value 'val' in each
99 element. Note that the value is evaluated for each element.
100****************************************************************************/
101#define INITIALIZE_ARRAY(array, size, value) \
102 { \
103 int _ini_index; \
104 \
105 for (_ini_index = 0; _ini_index < (size); _ini_index++) { \
106 (array)[_ini_index] = (value); \
107 } \
108 }
109
110#ifndef PATH_SEPARATOR
111#if defined(FREECIV_MSWINDOWS) || defined(_WIN32) || defined(__WIN32__) || defined(__EMX__) || defined(__DJGPP__)
112 /* Windows, OS/2, DOS */
113# define PATH_SEPARATOR ";"
114#else
115 /* Unix */
116# define PATH_SEPARATOR ":"
117#endif
118#endif /* PATH_SEPARATOR */
119
120#if defined(FREECIV_MSWINDOWS) || defined(_WIN32) || defined(__WIN32__) || defined(__EMX__) || defined(__DJGPP__)
121 /* Windows, OS/2, DOS */
122# define DIR_SEPARATOR "\\"
123# define DIR_SEPARATOR_CHAR '\\'
124#else
125 /* Unix */
126# define DIR_SEPARATOR_IS_DEFAULT
127# define DIR_SEPARATOR "/"
128# define DIR_SEPARATOR_CHAR '/'
129#endif
130
131#define PARENT_DIR_OPERATOR ".."
132
133const char *big_int_to_text(unsigned int mantissa, unsigned int exponent);
134const char *int_to_text(unsigned int number);
135
136bool is_ascii_name(const char *name);
137bool is_base64url(const char *s);
138bool is_safe_filename(const char *name);
139void randomize_base64url_string(char *s, size_t n);
140
141int compare_strings(const void *first, const void *second);
142int compare_strings_ptrs(const void *first, const void *second);
143int compare_strings_strvec(const char *const *first,
144 const char *const *second);
145
146char *skip_leading_spaces(char *s)
147 fc__attribute((nonnull (1)));
148void remove_leading_spaces(char *s)
149 fc__attribute((nonnull (1)));
150void remove_trailing_spaces(char *s)
151 fc__attribute((nonnull (1)));
152void remove_leading_trailing_spaces(char *s);
153
154bool check_strlen(const char *str, size_t len, const char *errmsg);
155size_t loud_strlcpy(char *buffer, const char *str, size_t len,
156 const char *errmsg);
157/* Convenience macro. */
158#define sz_loud_strlcpy(buffer, str, errmsg) \
159 loud_strlcpy(buffer, str, sizeof(buffer), errmsg)
160
161char *end_of_strn(char *str, int *nleft);
162
163bool str_to_int(const char *str, int *pint)
164 fc__attribute((nonnull (1)));
165bool str_to_uint(const char *str, unsigned int *pint)
166 fc__attribute((nonnull (1)));
167bool str_to_float(const char *str, float *pfloat)
168 fc__attribute((nonnull (1)));
169
170/**************************************************************************
171 ...
172**************************************************************************/
173 struct fileinfo {
174 char *name; /* Descriptive file name string */
175 char *fullname; /* Full absolute filename */
176 time_t mtime; /* Last modification time */
177};
178
179#define SPECLIST_TAG fileinfo
180#define SPECLIST_TYPE struct fileinfo
181#include "speclist.h"
182#define fileinfo_list_iterate(list, pnode) \
183 TYPED_LIST_ITERATE(struct fileinfo, list, pnode)
184#define fileinfo_list_iterate_end LIST_ITERATE_END
185
186char *user_home_dir(void);
187void free_user_home_dir(void);
188char *user_username(char *buf, size_t bufsz);
189char *freeciv_storage_dir(void);
190void free_freeciv_storage_dir(void);
191
192const struct strvec *get_data_dirs(void);
193const struct strvec *get_save_dirs(void);
194const struct strvec *get_scenario_dirs(void);
195
196void free_data_dir_names(void);
197
198struct strvec *fileinfolist(const struct strvec *dirs, const char *suffix);
199struct fileinfo_list *fileinfolist_infix(const struct strvec *dirs,
200 const char *infix, bool nodups);
201const char *fileinfoname(const struct strvec *dirs, const char *filename);
202void free_fileinfo_data(void);
203
204void init_nls(void);
205void free_nls(void);
206const char *setup_langname(void);
207void switch_lang(const char *lang);
208
209void dont_run_as_root(const char *argv0, const char *fallback);
210
211/*** Matching prefixes: ***/
212
213 enum m_pre_result {
214 M_PRE_EXACT, /* Matches with exact length */
215 M_PRE_ONLY, /* Only matching prefix */
216 M_PRE_AMBIGUOUS, /* First of multiple matching prefixes */
217 M_PRE_EMPTY, /* Prefix is empty string (no match) */
218 M_PRE_LONG, /* Prefix is too long (no match) */
219 M_PRE_FAIL, /* No match at all */
220 M_PRE_LAST /* Flag value */
221};
222
223const char *m_pre_description(enum m_pre_result result);
224
225/* Function type to access a name from an index: */
226 typedef const char *(*m_pre_accessor_fn_t)(int);
227
228/* Function type to compare prefix: */
229 typedef int (*m_pre_strncmp_fn_t)(const char *, const char *, size_t n);
230
231/* Function type to calculate effective string length: */
232 typedef size_t (m_strlen_fn_t)(const char *str);
233
234enum m_pre_result match_prefix(m_pre_accessor_fn_t accessor_fn,
235 size_t n_names,
236 size_t max_len_name,
237 m_pre_strncmp_fn_t cmp_fn,
238 m_strlen_fn_t len_fn,
239 const char *prefix,
240 int *ind_result);
241enum m_pre_result match_prefix_full(m_pre_accessor_fn_t accessor_fn,
242 size_t n_names,
243 size_t max_len_name,
244 m_pre_strncmp_fn_t cmp_fn,
245 m_strlen_fn_t len_fn,
246 const char *prefix,
247 int *ind_result,
248 int *matches,
249 int max_matches,
250 int *pnum_matches);
251
252char *get_multicast_group(bool ipv6_preferred);
253void free_multicast_group(void);
254void interpret_tilde(char *buf, size_t buf_size, const char *filename);
255char *interpret_tilde_alloc(const char *filename);
256char *skip_to_basename(char *filepath);
257
258#define DIRMODE_DEFAULT (-1)
259
260bool make_dir(const char *pathname, int mode)
261 fc__attribute((nonnull (1)));
262bool make_dir_for_file(char *filename)
263 fc__attribute((nonnull (1)));
264
265bool path_is_absolute(const char *filename);
266
267char scanin(const char **buf, char *delimiters, char *dest, int size);
268
269void array_shuffle(int *array, int n);
270
271void format_time_duration(time_t t, char *buf, int maxlen);
272
273bool wildcard_fit_string(const char *pattern, const char *test);
274
275/* Custom format strings. */
276struct cf_sequence;
277
278 int fc_snprintcf(char *buf, size_t buf_len, const char *format, ...)
279 fc__attribute((nonnull (1, 3))); /* Not a printf format. */
280 int fc_vsnprintcf(char *buf, size_t buf_len, const char *format,
281 const struct cf_sequence *sequences, size_t sequences_num)
282 fc__attribute((nonnull (1, 3, 4)));
283
284/* Tools for fc_snprintcf(). */
285 static inline struct cf_sequence cf_bool_seq(char letter, bool value);
286 static inline struct cf_sequence cf_trans_bool_seq(char letter, bool value);
287 static inline struct cf_sequence cf_char_seq(char letter, char value);
288 static inline void cf_int_seq(char letter, int value, struct cf_sequence *out);
289 static inline struct cf_sequence cf_hexa_seq(char letter, int value);
290 static inline struct cf_sequence cf_float_seq(char letter, float value);
291 static inline struct cf_sequence cf_ptr_seq(char letter, const void *value);
292 static inline struct cf_sequence cf_str_seq(char letter, const char *value);
293 static inline struct cf_sequence cf_end(void);
294
295 enum cf_type {
296 CF_BOOLEAN,
297 CF_TRANS_BOOLEAN,
298 CF_CHARACTER,
299 CF_INTEGER,
300 CF_HEXA,
301 CF_FLOAT,
302 CF_POINTER,
303 CF_STRING,
304
305 CF_LAST = -1
306};
307
308 struct cf_sequence {
309 enum cf_type type;
310 char letter;
311 union {
312 bool bool_value;
313 char char_value;
314 int int_value;
315 float float_value;
316 const void *ptr_value;
317 const char *str_value;
318 };
319};
320
321/************************************************************************/
324 static inline struct cf_sequence cf_bool_seq(char letter, bool value)
325{
326 struct cf_sequence sequence;
327
328 sequence.type = CF_BOOLEAN;
329 sequence.letter = letter;
330 sequence.bool_value = value;
331
332 return sequence;
333}
334
335/************************************************************************/
339 static inline struct cf_sequence cf_trans_bool_seq(char letter, bool value)
340{
341 struct cf_sequence sequence;
342
343 sequence.type = CF_TRANS_BOOLEAN;
344 sequence.letter = letter;
345 sequence.bool_value = value;
346
347 return sequence;
348}
349
350/************************************************************************/
353 static inline struct cf_sequence cf_char_seq(char letter, char value)
354{
355 struct cf_sequence sequence;
356
357 sequence.type = CF_CHARACTER;
358 sequence.letter = letter;
359 sequence.char_value = value;
360
361 return sequence;
362}
363
364/************************************************************************/
367 static inline void cf_int_seq(char letter, int value, struct cf_sequence *out)
368{
369 out->type = CF_INTEGER;
370 out->letter = letter;
371 out->int_value = value;
372}
373
374/************************************************************************/
377 static inline struct cf_sequence cf_hexa_seq(char letter, int value)
378{
379 struct cf_sequence sequence;
380
381 sequence.type = CF_HEXA;
382 sequence.letter = letter;
383 sequence.int_value = value;
384
385 return sequence;
386}
387
388/************************************************************************/
391 static inline struct cf_sequence cf_float_seq(char letter, float value)
392{
393 struct cf_sequence sequence;
394
395 sequence.type = CF_FLOAT;
396 sequence.letter = letter;
397 sequence.float_value = value;
398
399 return sequence;
400}
401
402/************************************************************************/
405 static inline struct cf_sequence cf_ptr_seq(char letter, const void *value)
406{
407 struct cf_sequence sequence;
408
409 sequence.type = CF_POINTER;
410 sequence.letter = letter;
411 sequence.ptr_value = value;
412
413 return sequence;
414}
415
416/************************************************************************/
419 static inline struct cf_sequence cf_str_seq(char letter, const char *value)
420{
421 struct cf_sequence sequence;
422
423 sequence.type = CF_STRING;
424 sequence.letter = letter;
425 sequence.str_value = value;
426
427 return sequence;
428}
429
430/************************************************************************/
433 static inline struct cf_sequence cf_end(void)
434{
435 struct cf_sequence sequence;
436
437 sequence.type = CF_LAST;
438
439 return sequence;
440}
441
442bool formats_match(const char *format1, const char *format2);
443
444#ifdef __cplusplus
445}
446#endif /* __cplusplus */
447
448#endif /* FC__SHARED_H */
str
#define str
Definition astring.c:76
n
#define n
Definition astring.c:77
buf_size
const size_t buf_size
Definition audio_sdl.c:53
incite_cost
char * incite_cost
Definition comments.c:74
bufsz
static const int bufsz
Definition helpdlg.c:70
name
const char * name
Definition inputfile.c:127
log.h
len
int len
Definition packhand.c:127
compare_strings
int compare_strings(const void *first, const void *second)
Definition shared.c:363
fc_tristate
fc_tristate
Definition shared.h:46
TRI_YES
@ TRI_YES
Definition shared.h:46
TRI_NO
@ TRI_NO
Definition shared.h:46
TRI_MAYBE
@ TRI_MAYBE
Definition shared.h:46
format_time_duration
void format_time_duration(time_t t, char *buf, int maxlen)
Definition shared.c:1965
m_pre_strncmp_fn_t
int(* m_pre_strncmp_fn_t)(const char *, const char *, size_t n)
Definition shared.h:229
compare_strings_ptrs
int compare_strings_ptrs(const void *first, const void *second)
Definition shared.c:373
remove_leading_spaces
void remove_leading_spaces(char *s) fc__attribute((nonnull(1)))
Definition shared.c:405
user_username
char * user_username(char *buf, size_t bufsz)
Definition shared.c:704
fc_vsnprintcf
int int fc_vsnprintcf(char *buf, size_t buf_len, const char *format, const struct cf_sequence *sequences, size_t sequences_num) fc__attribute((nonnull(1
cf_bool_seq
int int static struct cf_sequence cf_bool_seq(char letter, bool value)
Definition shared.h:324
fc_tristate_and
enum fc_tristate fc_tristate_and(enum fc_tristate one, enum fc_tristate two)
Definition shared.c:127
m_strlen_fn_t
size_t() m_strlen_fn_t(const char *str)
Definition shared.h:232
cf_char_seq
static struct cf_sequence cf_char_seq(char letter, char value)
Definition shared.h:353
dont_run_as_root
void dont_run_as_root(const char *argv0, const char *fallback)
Definition shared.c:1539
make_dir
bool make_dir(const char *pathname, int mode) fc__attribute((nonnull(1)))
Definition shared.c:1776
wildcard_fit_string
bool wildcard_fit_string(const char *pattern, const char *test)
Definition shared.c:2153
check_strlen
bool check_strlen(const char *str, size_t len, const char *errmsg)
Definition shared.c:493
fileinfoname
const char * fileinfoname(const struct strvec *dirs, const char *filename)
Definition shared.c:1094
remove_trailing_spaces
void remove_trailing_spaces(char *s) fc__attribute((nonnull(1)))
Definition shared.c:422
user_home_dir
char * user_home_dir(void)
Definition shared.c:627
free_user_home_dir
void free_user_home_dir(void)
Definition shared.c:658
cf_end
static struct cf_sequence cf_end(void)
Definition shared.h:433
cf_ptr_seq
static struct cf_sequence cf_ptr_seq(char letter, const void *value)
Definition shared.h:405
init_nls
void init_nls(void)
Definition shared.c:1463
m_pre_description
const char * m_pre_description(enum m_pre_result result)
Definition shared.c:1561
cf_int_seq
static void cf_int_seq(char letter, int value, struct cf_sequence *out)
Definition shared.h:367
cf_float_seq
static struct cf_sequence cf_float_seq(char letter, float value)
Definition shared.h:391
cf_str_seq
static struct cf_sequence cf_str_seq(char letter, const char *value)
Definition shared.h:419
cf_trans_bool_seq
static struct cf_sequence cf_trans_bool_seq(char letter, bool value)
Definition shared.h:339
skip_leading_spaces
char * skip_leading_spaces(char *s) fc__attribute((nonnull(1)))
Definition shared.c:392
fileinfolist
struct strvec * fileinfolist(const struct strvec *dirs, const char *suffix)
Definition shared.c:1020
free_data_dir_names
void free_data_dir_names(void)
Definition shared.c:859
match_prefix_full
enum m_pre_result match_prefix_full(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result, int *matches, int max_matches, int *pnum_matches)
Definition shared.c:1603
get_scenario_dirs
const struct strvec * get_scenario_dirs(void)
Definition shared.c:971
str_to_uint
bool str_to_uint(const char *str, unsigned int *pint) fc__attribute((nonnull(1)))
Definition shared.c:547
cf_type
cf_type
Definition shared.h:295
CF_POINTER
@ CF_POINTER
Definition shared.h:302
CF_HEXA
@ CF_HEXA
Definition shared.h:300
CF_CHARACTER
@ CF_CHARACTER
Definition shared.h:298
CF_INTEGER
@ CF_INTEGER
Definition shared.h:299
CF_TRANS_BOOLEAN
@ CF_TRANS_BOOLEAN
Definition shared.h:297
CF_LAST
@ CF_LAST
Definition shared.h:305
CF_BOOLEAN
@ CF_BOOLEAN
Definition shared.h:296
CF_STRING
@ CF_STRING
Definition shared.h:303
CF_FLOAT
@ CF_FLOAT
Definition shared.h:301
loud_strlcpy
size_t loud_strlcpy(char *buffer, const char *str, size_t len, const char *errmsg)
Definition shared.c:503
interpret_tilde_alloc
char * interpret_tilde_alloc(const char *filename)
Definition shared.c:1727
cf_hexa_seq
static struct cf_sequence cf_hexa_seq(char letter, int value)
Definition shared.h:377
interpret_tilde
void interpret_tilde(char *buf, size_t buf_size, const char *filename)
Definition shared.c:1710
compare_strings_strvec
int compare_strings_strvec(const char *const *first, const char *const *second)
Definition shared.c:383
is_base64url
bool is_base64url(const char *s)
Definition shared.c:321
free_multicast_group
void free_multicast_group(void)
Definition shared.c:1695
free_fileinfo_data
void free_fileinfo_data(void)
Definition shared.c:1151
end_of_strn
char * end_of_strn(char *str, int *nleft)
Definition shared.c:478
path_is_absolute
bool path_is_absolute(const char *filename)
Definition shared.c:1881
free_nls
void free_nls(void)
Definition shared.c:1522
make_dir_for_file
bool make_dir_for_file(char *filename) fc__attribute((nonnull(1)))
Definition shared.c:1859
str_to_int
bool str_to_int(const char *str, int *pint) fc__attribute((nonnull(1)))
Definition shared.c:515
formats_match
bool formats_match(const char *format1, const char *format2)
Definition shared.c:2443
int_to_text
const char * int_to_text(unsigned int number)
Definition shared.c:237
scanin
char scanin(const char **buf, char *delimiters, char *dest, int size)
Definition shared.c:1920
get_save_dirs
const struct strvec * get_save_dirs(void)
Definition shared.c:934
skip_to_basename
char * skip_to_basename(char *filepath)
Definition shared.c:1750
str_to_float
bool str_to_float(const char *str, float *pfloat) fc__attribute((nonnull(1)))
Definition shared.c:579
array_shuffle
void array_shuffle(int *array, int n)
Definition shared.c:2008
m_pre_result
m_pre_result
Definition shared.h:213
M_PRE_EXACT
@ M_PRE_EXACT
Definition shared.h:214
M_PRE_ONLY
@ M_PRE_ONLY
Definition shared.h:215
M_PRE_LAST
@ M_PRE_LAST
Definition shared.h:220
M_PRE_LONG
@ M_PRE_LONG
Definition shared.h:218
M_PRE_AMBIGUOUS
@ M_PRE_AMBIGUOUS
Definition shared.h:216
M_PRE_EMPTY
@ M_PRE_EMPTY
Definition shared.h:217
M_PRE_FAIL
@ M_PRE_FAIL
Definition shared.h:219
match_prefix
enum m_pre_result match_prefix(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result)
Definition shared.c:1580
is_ascii_name
bool is_ascii_name(const char *name)
Definition shared.c:286
fc_tristate_or
enum fc_tristate fc_tristate_or(enum fc_tristate one, enum fc_tristate two)
Definition shared.c:143
fc_snprintcf
int fc_snprintcf(char *buf, size_t buf_len, const char *format,...) fc__attribute((nonnull(1
setup_langname
const char * setup_langname(void)
Definition shared.c:1281
randomize_base64url_string
void randomize_base64url_string(char *s, size_t n)
Definition shared.c:343
get_multicast_group
char * get_multicast_group(bool ipv6_preferred)
Definition shared.c:1664
free_freeciv_storage_dir
void free_freeciv_storage_dir(void)
Definition shared.c:689
m_pre_accessor_fn_t
const char *(* m_pre_accessor_fn_t)(int)
Definition shared.h:226
is_safe_filename
bool is_safe_filename(const char *name)
Definition shared.c:256
remove_leading_trailing_spaces
void remove_leading_trailing_spaces(char *s)
Definition shared.c:444
big_int_to_text
const char * big_int_to_text(unsigned int mantissa, unsigned int exponent)
Definition shared.c:162
get_data_dirs
const struct strvec * get_data_dirs(void)
Definition shared.c:886
freeciv_storage_dir
char * freeciv_storage_dir(void)
Definition shared.c:671
switch_lang
void switch_lang(const char *lang)
Definition shared.c:1434
fileinfolist_infix
struct fileinfo_list * fileinfolist_infix(const struct strvec *dirs, const char *infix, bool nodups)
Definition shared.c:1204
speclist.h
size
size_t size
Definition specvec.h:72
cf_sequence
Definition shared.h:308
cf_sequence::ptr_value
const void * ptr_value
Definition shared.h:316
cf_sequence::str_value
const char * str_value
Definition shared.h:317
cf_sequence::int_value
int int_value
Definition shared.h:314
cf_sequence::bool_value
bool bool_value
Definition shared.h:312
cf_sequence::letter
char letter
Definition shared.h:310
cf_sequence::float_value
float float_value
Definition shared.h:315
cf_sequence::char_value
char char_value
Definition shared.h:313
cf_sequence::type
enum cf_type type
Definition shared.h:309
fileinfo
Definition shared.h:173
fileinfo::mtime
time_t mtime
Definition shared.h:176
fileinfo::fullname
char * fullname
Definition shared.h:175
fileinfo::name
char * name
Definition shared.h:174
strvec
Definition string_vector.c:29
support.h
fc__attribute
#define fc__attribute(x)
Definition support.h:99
bool
#define bool
Definition support.h:71