Freeciv21
Develop your civilization from humble roots to a global empire
mpdb.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #ifndef FC__MPDB_H
14 #define FC__MPDB_H
15 
16 // common
17 #include "fc_types.h"
18 
19 // modinst
20 #include "download.h"
21 
22 struct install_info {
24  enum modpack_type type;
26 };
27 
28 #define SPECLIST_TAG install_info
29 #define SPECLIST_TYPE struct install_info
30 #include "speclist.h"
31 
32 #define install_info_list_iterate(ii_list, item) \
33  TYPED_LIST_ITERATE(struct install_info, ii_list, item)
34 #define install_info_list_iterate_end LIST_ITERATE_END
35 
36 // Backward compatibility to pre-sqlite database versions
37 void load_install_info_list(const char *filename);
38 
39 void create_mpdb(const char *filename, bool scenario_db);
40 void open_mpdb(const char *filename, bool scenario_db);
41 void close_mpdbs();
42 
43 bool mpdb_update_modpack(const char *name, enum modpack_type type,
44  const char *version);
45 const char *mpdb_installed_version(const char *name, enum modpack_type type);
46 
47 #endif // FC__MPDB_H
#define MAX_LEN_NAME
Definition: fc_types.h:61
const char * name
Definition: inputfile.cpp:118
void close_mpdbs()
Close open databases.
Definition: mpdb.cpp:198
void load_install_info_list(const char *filename)
Construct install info list from file.
Definition: mpdb.cpp:39
const char * mpdb_installed_version(const char *name, enum modpack_type type)
Return version of modpack.
Definition: mpdb.cpp:251
void create_mpdb(const char *filename, bool scenario_db)
Create modpack database.
Definition: mpdb.cpp:132
void open_mpdb(const char *filename, bool scenario_db)
Open existing database.
Definition: mpdb.cpp:177
bool mpdb_update_modpack(const char *name, enum modpack_type type, const char *version)
Update modpack information in database.
Definition: mpdb.cpp:209
enum modpack_type type
Definition: mpdb.h:24
char name[MAX_LEN_NAME]
Definition: mpdb.h:23
char version[MAX_LEN_NAME]
Definition: mpdb.h:25