Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
modpack.c File Reference
#include "capability.h"
#include "registry.h"
#include "section_file.h"
#include "shared.h"
#include "game.h"
#include "modpack.h"
#include "speclist.h"

Go to the source code of this file.

Data Structures

struct  modpack_cache_item
 

Macros

#define SPECLIST_TAG   modpack_cache
 
#define SPECLIST_TYPE   struct modpack_cache_item
 
#define modpack_cache_iterate(mplist, item)    TYPED_LIST_ITERATE(struct modpack_cache_item, mplist, item)
 
#define modpack_cache_iterate_end   LIST_ITERATE_END
 

Functions

void modpacks_init (void)
 
void modpacks_free (void)
 
bool modpack_check_capabilities (struct section_file *file, const char *us_capstr, const char *filename, bool verbose)
 
struct fileinfo_listget_modpacks_list (void)
 
const charmodpack_has_ruleset (struct section_file *sf)
 
const charmodpack_serv_file (struct section_file *sf)
 
const charmodpack_rulesetdir (struct section_file *sf)
 
const charmodpack_cache_ruleset (struct section_file *sf)
 
const charmodpack_file_from_ruleset_cache (const char *name)
 
void modpack_ruleset_cache_iterate (mrc_cb cb, void *data)
 

Variables

static struct modpack_cache_listmodpack_rulesets
 

Macro Definition Documentation

◆ modpack_cache_iterate

#define modpack_cache_iterate (   mplist,
  item 
)     TYPED_LIST_ITERATE(struct modpack_cache_item, mplist, item)

Definition at line 39 of file modpack.c.

◆ modpack_cache_iterate_end

#define modpack_cache_iterate_end   LIST_ITERATE_END

Definition at line 41 of file modpack.c.

◆ SPECLIST_TAG

#define SPECLIST_TAG   modpack_cache

Definition at line 35 of file modpack.c.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct modpack_cache_item

Definition at line 36 of file modpack.c.

Function Documentation

◆ get_modpacks_list()

struct fileinfo_list * get_modpacks_list ( void  )

Get list of modpack meta info files.

Definition at line 107 of file modpack.c.

Referenced by cache_rulesets().

◆ modpack_cache_ruleset()

const char * modpack_cache_ruleset ( struct section_file sf)

Add modpack/ruleset mapping to cache, if modpack has ruleset. Return name of the modpack, if the mapping exist.

Definition at line 165 of file modpack.c.

Referenced by cache_rulesets().

◆ modpack_check_capabilities()

bool modpack_check_capabilities ( struct section_file file,
const char us_capstr,
const char filename,
bool  verbose 
)

Check modpack file capabilities.

Definition at line 74 of file modpack.c.

Referenced by modpack_has_ruleset().

◆ modpack_file_from_ruleset_cache()

const char * modpack_file_from_ruleset_cache ( const char name)

Find filename by name of the modpack, from the ruleset cache

Definition at line 188 of file modpack.c.

Referenced by handle_ruleset_select(), and ruleset_cache_listcmd_cb().

◆ modpack_has_ruleset()

const char * modpack_has_ruleset ( struct section_file sf)

Return name of the modpack if contains a ruleset. If it does not contain ruleset, return NULL.

Definition at line 121 of file modpack.c.

Referenced by modpack_cache_ruleset().

◆ modpack_ruleset_cache_iterate()

void modpack_ruleset_cache_iterate ( mrc_cb  cb,
void data 
)

Call callback for each item in the ruleset cache.

Definition at line 202 of file modpack.c.

Referenced by send_ruleset_choices(), and show_rulesets().

◆ modpack_rulesetdir()

const char * modpack_rulesetdir ( struct section_file sf)

Return rulesetdir for the modpack, if any.

Definition at line 152 of file modpack.c.

Referenced by handle_ruleset_select(), and ruleset_cache_listcmd_cb().

◆ modpack_serv_file()

const char * modpack_serv_file ( struct section_file sf)

Return .serv file name for the modpack, if any.

Definition at line 140 of file modpack.c.

Referenced by handle_ruleset_select(), and ruleset_cache_listcmd_cb().

◆ modpacks_free()

void modpacks_free ( void  )

Free the memory associated with modpacks system

Definition at line 58 of file modpack.c.

Referenced by game_free().

◆ modpacks_init()

void modpacks_init ( void  )

Initialize modpacks system

Definition at line 48 of file modpack.c.

Referenced by game_init().

Variable Documentation

◆ modpack_rulesets

struct modpack_cache_list* modpack_rulesets
static