Freeciv-3.3
Loading...
Searching...
No Matches
setcompat.c
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
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* ANSI */
19#include <stdlib.h>
20
21/* utility */
22#include "support.h"
23
24/* server */
25#include "settings.h"
26
27#include "setcompat.h"
28
30 const char *old_name;
31 const char *new_name;
32};
33
35{
36 { "spaceship_travel_time", "spaceship_travel_pct" },
37 { NULL, NULL }
38};
39
40
41/**********************************************************************/
45static const char *setcompat_name_generic(const char *old_name,
47{
48 int i;
49
50 for (i = 0; compats[i].old_name != NULL; i++) {
52 return compats[i].new_name;
53 }
54 }
55
56 return old_name;
57}
58
59/**********************************************************************/
66
67/**********************************************************************/
71 const char *val)
72{
73 if (!fc_strcasecmp("compresstype", setting_name(pset))
74 && !fc_strcasecmp("BZIP2", val)) {
75#ifdef FREECIV_HAVE_LIBZSTD
76 return "ZSTD";
77#elif FREECIV_HAVE_LIBLZMA
78 return "XZ";
79#elif FREECIV_HAVE_LIBZ
80 return "LIBZ";
81#else
82 return "PLAIN";
83#endif
84 }
85
86 return NULL;
87}
char * incite_cost
Definition comments.c:76
static const char * setcompat_name_generic(const char *old_name, struct set_name_compat *compats)
Definition setcompat.c:45
static struct set_name_compat set_name_compat_S3_1_to_S3_2[]
Definition setcompat.c:34
const char * setcompat_S3_2_val_from_S3_1(struct setting *pset, const char *val)
Definition setcompat.c:70
const char * setcompat_S3_2_name_from_S3_1(const char *old_name)
Definition setcompat.c:62
const char * setting_name(const struct setting *pset)
Definition settings.c:3333
const char * new_name
Definition setcompat.c:31
const char * old_name
Definition setcompat.c:30
int fc_strcasecmp(const char *str0, const char *str1)
Definition support.c:186