Atrinik Client  4.0
Functions | Variables
upgrader.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void upgrade_20_to_25 (const char *from, const char *to)
 
static void upgrade_25_to_30 (const char *from, const char *to)
 
void upgrader_init (void)
 
char * upgrader_get_version_partial (char *dst, size_t dstlen)
 

Variables

static const char *const client_versions []
 
static int64_t version_id_migrating = -1
 

Detailed Description

Migrates the settings from an older installation.

Author
Alex Tokar

Definition in file upgrader.c.

Function Documentation

static void upgrade_20_to_25 ( const char *  from,
const char *  to 
)
static

Upgrade 2.0 settings to 2.5.

This handles upgrading settings/keybindings from the old (2.0 and earlier) format to the new (2.5 and later) format.

Parameters
fromThe old settings directory.
toThe new setting directory.

Definition at line 55 of file upgrader.c.

static void upgrade_25_to_30 ( const char *  from,
const char *  to 
)
static

Upgrade 2.5 settings to 3.0.

Parameters
fromThe old settings directory.
toThe new setting directory.

Definition at line 259 of file upgrader.c.

char* upgrader_get_version_partial ( char *  dst,
size_t  dstlen 
)

Get the version the upgrader is currently working on.

Parameters
dstWhere to store the version.
dstlenSize of dst.
Returns
'dst' or NULL if the upgrader is not working on any version.

Definition at line 332 of file upgrader.c.

void upgrader_init ( void  )

Called before anything else on start, to check if we need to migrate settings.

Definition at line 268 of file upgrader.c.

Variable Documentation

const char* const client_versions[]
static
Initial value:
= {
"2.0", "2.5", "3.0"
}

Client versions we know about. The process how these are checked is explained in upgrader_init().

Definition at line 38 of file upgrader.c.

int64_t version_id_migrating = -1
static

client_versions entry we are currently migrating.

Definition at line 43 of file upgrader.c.