Freeciv-3.3
Loading...
Searching...
No Matches
Macros | Functions | Variables
mpdb.c File Reference
#include <sqlite3.h>
#include "capability.h"
#include "fcintl.h"
#include "mem.h"
#include "registry.h"
#include "download.h"
#include "mpdb.h"

Go to the source code of this file.

Macros

#define MPDB_CAPSTR   "+mpdb"
 
#define MPDB_FORMAT_VERSION   "1"
 

Functions

static int mpdb_query (sqlite3 *handle, const char *query)
 
void load_install_info_list (const char *filename)
 
void create_mpdb (const char *filename, bool scenario_db)
 
void open_mpdb (const char *filename, bool scenario_db)
 
void close_mpdbs (void)
 
bool mpdb_update_modpack (const char *name, enum modpack_type type, const char *version)
 
const charmpdb_installed_version (const char *name, enum modpack_type type)
 

Variables

static sqlite3main_handle = NULL
 
static sqlite3scenario_handle = NULL
 

Macro Definition Documentation

◆ MPDB_CAPSTR

#define MPDB_CAPSTR   "+mpdb"

Definition at line 31 of file mpdb.c.

◆ MPDB_FORMAT_VERSION

#define MPDB_FORMAT_VERSION   "1"

Definition at line 33 of file mpdb.c.

Function Documentation

◆ close_mpdbs()

void close_mpdbs ( void  )

Close open databases

Definition at line 202 of file mpdb.c.

Referenced by main(), and main().

◆ create_mpdb()

void create_mpdb ( const char filename,
bool  scenario_db 
)

Create modpack database

Definition at line 134 of file mpdb.c.

Referenced by load_install_info_lists().

◆ load_install_info_list()

void load_install_info_list ( const char filename)

Construct install info list from file.

Definition at line 43 of file mpdb.c.

Referenced by load_install_info_lists().

◆ mpdb_installed_version()

const char * mpdb_installed_version ( const char name,
enum modpack_type  type 
)

◆ mpdb_query()

static int mpdb_query ( sqlite3 handle,
const char query 
)
static

SQL query to database

Definition at line 109 of file mpdb.c.

Referenced by create_mpdb(), and mpdb_update_modpack().

◆ mpdb_update_modpack()

bool mpdb_update_modpack ( const char name,
enum modpack_type  type,
const char version 
)

Update modpack information in database

Definition at line 213 of file mpdb.c.

Referenced by download_modpack_recursive(), and load_install_info_list().

◆ open_mpdb()

void open_mpdb ( const char filename,
bool  scenario_db 
)

Open existing database

Definition at line 181 of file mpdb.c.

Referenced by load_install_info_lists().

Variable Documentation

◆ main_handle

sqlite3* main_handle = NULL
static

◆ scenario_handle

sqlite3* scenario_handle = NULL
static