Angband
Data Structures | Macros | Functions | Variables
init.c File Reference

Various game initialization routines. More...

#include "angband.h"
#include "buildid.h"
#include "cave.h"
#include "cmds.h"
#include "cmd-core.h"
#include "datafile.h"
#include "effects.h"
#include "game-event.h"
#include "generate.h"
#include "hint.h"
#include "init.h"
#include "mon-init.h"
#include "mon-list.h"
#include "mon-lore.h"
#include "mon-msg.h"
#include "mon-util.h"
#include "monster.h"
#include "obj-ignore.h"
#include "obj-init.h"
#include "obj-list.h"
#include "obj-make.h"
#include "obj-pile.h"
#include "obj-power.h"
#include "obj-randart.h"
#include "obj-slays.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "object.h"
#include "option.h"
#include "player.h"
#include "player-history.h"
#include "player-quest.h"
#include "player-spell.h"
#include "player-timed.h"
#include "project.h"
#include "randname.h"
#include "store.h"
#include "trap.h"
#include "list-equip-slots.h"
#include "list-object-flags.h"
#include "list-elements.h"
#include "list-effects.h"
#include "list-trap-flags.h"
#include "list-terrain-flags.h"
#include "list-mon-race-flags.h"
#include "list-player-flags.h"

Data Structures

struct  name
 

Intialize random names

More...
 
struct  names_parse
 

Macros

#define EQUIP(a, b, c, d, e, f)   #a,
 
#define OF(a)   #a,
 
#define ELEM(a)   #a,
 
#define EFFECT(x, a, b, c, d, e)   #x,
 
#define TRF(a, b)   #a,
 
#define TF(a, b)   #a,
 
#define RF(a, b, c)   #a,
 
#define PF(a, b, c)   #a,
 
#define BUILD_DIRECTORY_PATH(dest, basepath, dirname)
 

Functions

errr grab_effect_data (struct parser *p, struct effect *effect)
 
void init_file_paths (const char *configpath, const char *libpath, const char *datapath)
 Find the default paths to all of our important sub-directories. More...
 
void create_needed_dirs (void)
 Create any missing directories. More...
 
static enum parser_error parse_constants_level_max (struct parser *p)
 

Initialize game constants

More...
 
static enum parser_error parse_constants_mon_gen (struct parser *p)
 
static enum parser_error parse_constants_mon_play (struct parser *p)
 
static enum parser_error parse_constants_dun_gen (struct parser *p)
 
static enum parser_error parse_constants_world (struct parser *p)
 
static enum parser_error parse_constants_carry_cap (struct parser *p)
 
static enum parser_error parse_constants_store (struct parser *p)
 
static enum parser_error parse_constants_obj_make (struct parser *p)
 
static enum parser_error parse_constants_player (struct parser *p)
 
struct parserinit_parse_constants (void)
 
static errr run_parse_constants (struct parser *p)
 
static errr finish_parse_constants (struct parser *p)
 
static void cleanup_constants (void)
 
void init_game_constants (void)
 Initialize game constants. More...
 
static void cleanup_game_constants (void)
 Free the game constants. More...
 
static enum parser_error parse_names_section (struct parser *p)
 
static enum parser_error parse_names_word (struct parser *p)
 
struct parserinit_parse_names (void)
 
static errr run_parse_names (struct parser *p)
 
static errr finish_parse_names (struct parser *p)
 
static void cleanup_names (void)
 
static enum parser_error parse_trap_name (struct parser *p)
 

Intialize traps

More...
 
static enum parser_error parse_trap_graphics (struct parser *p)
 
static enum parser_error parse_trap_appear (struct parser *p)
 
static enum parser_error parse_trap_visibility (struct parser *p)
 
static enum parser_error parse_trap_flags (struct parser *p)
 
static enum parser_error parse_trap_effect (struct parser *p)
 
static enum parser_error parse_trap_param (struct parser *p)
 
static enum parser_error parse_trap_dice (struct parser *p)
 
static enum parser_error parse_trap_expr (struct parser *p)
 
static enum parser_error parse_trap_effect_xtra (struct parser *p)
 
static enum parser_error parse_trap_param_xtra (struct parser *p)
 
static enum parser_error parse_trap_dice_xtra (struct parser *p)
 
static enum parser_error parse_trap_expr_xtra (struct parser *p)
 
static enum parser_error parse_trap_save_flags (struct parser *p)
 
static enum parser_error parse_trap_desc (struct parser *p)
 
static enum parser_error parse_trap_msg (struct parser *p)
 
static enum parser_error parse_trap_msg_good (struct parser *p)
 
static enum parser_error parse_trap_msg_bad (struct parser *p)
 
static enum parser_error parse_trap_msg_xtra (struct parser *p)
 
struct parserinit_parse_trap (void)
 
static errr run_parse_trap (struct parser *p)
 
static errr finish_parse_trap (struct parser *p)
 
static void cleanup_trap (void)
 
static enum parser_error parse_feat_name (struct parser *p)
 

Intialize terrain

More...
 
static enum parser_error parse_feat_graphics (struct parser *p)
 
static enum parser_error parse_feat_mimic (struct parser *p)
 
static enum parser_error parse_feat_priority (struct parser *p)
 
static enum parser_error parse_feat_flags (struct parser *p)
 
static enum parser_error parse_feat_info (struct parser *p)
 
static enum parser_error parse_feat_desc (struct parser *p)
 
static enum parser_error parse_feat_walk_msg (struct parser *p)
 
static enum parser_error parse_feat_run_msg (struct parser *p)
 
static enum parser_error parse_feat_hurt_msg (struct parser *p)
 
static enum parser_error parse_feat_die_msg (struct parser *p)
 
static enum parser_error parse_feat_resist_flag (struct parser *p)
 
struct parserinit_parse_feat (void)
 
static errr run_parse_feat (struct parser *p)
 
static errr finish_parse_feat (struct parser *p)
 
static void cleanup_feat (void)
 
static enum parser_error parse_body_body (struct parser *p)
 

Intialize player bodies

More...
 
static enum parser_error parse_body_slot (struct parser *p)
 
struct parserinit_parse_body (void)
 
static errr run_parse_body (struct parser *p)
 
static errr finish_parse_body (struct parser *p)
 
static void cleanup_body (void)
 
static struct history_chartfindchart (struct history_chart *hs, unsigned int idx)
 
static enum parser_error parse_history_chart (struct parser *p)
 
static enum parser_error parse_history_phrase (struct parser *p)
 
struct parserinit_parse_history (void)
 
static errr run_parse_history (struct parser *p)
 
static errr finish_parse_history (struct parser *p)
 
static void cleanup_history (void)
 
static enum parser_error parse_p_race_name (struct parser *p)
 

Intialize player races

More...
 
static enum parser_error parse_p_race_stats (struct parser *p)
 
static enum parser_error parse_p_race_skill_disarm_phys (struct parser *p)
 
static enum parser_error parse_p_race_skill_disarm_magic (struct parser *p)
 
static enum parser_error parse_p_race_skill_device (struct parser *p)
 
static enum parser_error parse_p_race_skill_save (struct parser *p)
 
static enum parser_error parse_p_race_skill_stealth (struct parser *p)
 
static enum parser_error parse_p_race_skill_search (struct parser *p)
 
static enum parser_error parse_p_race_skill_melee (struct parser *p)
 
static enum parser_error parse_p_race_skill_shoot (struct parser *p)
 
static enum parser_error parse_p_race_skill_throw (struct parser *p)
 
static enum parser_error parse_p_race_skill_dig (struct parser *p)
 
static enum parser_error parse_p_race_info (struct parser *p)
 
static enum parser_error parse_p_race_history (struct parser *p)
 
static enum parser_error parse_p_race_height (struct parser *p)
 
static enum parser_error parse_p_race_weight (struct parser *p)
 
static enum parser_error parse_p_race_obj_flags (struct parser *p)
 
static enum parser_error parse_p_race_play_flags (struct parser *p)
 
static enum parser_error parse_p_race_values (struct parser *p)
 
struct parserinit_parse_p_race (void)
 
static errr run_parse_p_race (struct parser *p)
 
static errr finish_parse_p_race (struct parser *p)
 
static void cleanup_p_race (void)
 
static enum parser_error parse_realm_name (struct parser *p)
 

Initialize player magic realms

More...
 
static enum parser_error parse_realm_stat (struct parser *p)
 
static enum parser_error parse_realm_verb (struct parser *p)
 
static enum parser_error parse_realm_spell_noun (struct parser *p)
 
static enum parser_error parse_realm_book_noun (struct parser *p)
 
struct parserinit_parse_realm (void)
 
static errr run_parse_realm (struct parser *p)
 
static errr finish_parse_realm (struct parser *p)
 
static void cleanup_realm (void)
 
static enum parser_error parse_class_name (struct parser *p)
 

Initialize player classes

More...
 
static enum parser_error parse_class_stats (struct parser *p)
 
static enum parser_error parse_class_skill_disarm_phys (struct parser *p)
 
static enum parser_error parse_class_skill_disarm_magic (struct parser *p)
 
static enum parser_error parse_class_skill_device (struct parser *p)
 
static enum parser_error parse_class_skill_save (struct parser *p)
 
static enum parser_error parse_class_skill_stealth (struct parser *p)
 
static enum parser_error parse_class_skill_search (struct parser *p)
 
static enum parser_error parse_class_skill_melee (struct parser *p)
 
static enum parser_error parse_class_skill_shoot (struct parser *p)
 
static enum parser_error parse_class_skill_throw (struct parser *p)
 
static enum parser_error parse_class_skill_dig (struct parser *p)
 
static enum parser_error parse_class_info (struct parser *p)
 
static enum parser_error parse_class_attack (struct parser *p)
 
static enum parser_error parse_class_title (struct parser *p)
 
static enum parser_error parse_class_equip (struct parser *p)
 
static enum parser_error parse_class_flags (struct parser *p)
 
static enum parser_error parse_class_realm (struct parser *p)
 
static enum parser_error parse_class_magic (struct parser *p)
 
static enum parser_error parse_class_book (struct parser *p)
 
static enum parser_error parse_class_spell (struct parser *p)
 
static enum parser_error parse_class_effect (struct parser *p)
 
static enum parser_error parse_class_param (struct parser *p)
 
static enum parser_error parse_class_dice (struct parser *p)
 
static enum parser_error parse_class_expr (struct parser *p)
 
static enum parser_error parse_class_desc (struct parser *p)
 
struct parserinit_parse_class (void)
 
static errr run_parse_class (struct parser *p)
 
static errr finish_parse_class (struct parser *p)
 
static void cleanup_class (void)
 
static enum parser_error parse_flavor_flavor (struct parser *p)
 
static enum parser_error parse_flavor_kind (struct parser *p)
 
struct parserinit_parse_flavor (void)
 
static errr run_parse_flavor (struct parser *p)
 
static errr finish_parse_flavor (struct parser *p)
 
static void cleanup_flavor (void)
 
static enum parser_error parse_hint (struct parser *p)
 

Initialize hints

More...
 
struct parserinit_parse_hints (void)
 
static errr run_parse_hints (struct parser *p)
 
static errr finish_parse_hints (struct parser *p)
 
static void cleanup_hints (void)
 
void init_arrays (void)
 Initialize just the internal arrays. More...
 
static void cleanup_arrays (void)
 Free all the internal arrays. More...
 
bool init_angband (void)
 Initialise Angband's data stores and allocate memory for structures, etc, so that the game can get started. More...
 
void cleanup_angband (void)
 Free all the stuff initialised in init_angband() More...
 

Variables

struct angband_constantsz_info
 Structure (not array) of game constants. More...
 
const char * ANGBAND_SYS = "xxx"
 
char * ANGBAND_DIR_GAMEDATA
 Various directories. More...
 
char * ANGBAND_DIR_CUSTOMIZE
 
char * ANGBAND_DIR_HELP
 
char * ANGBAND_DIR_SCREENS
 
char * ANGBAND_DIR_FONTS
 
char * ANGBAND_DIR_TILES
 
char * ANGBAND_DIR_SOUNDS
 
char * ANGBAND_DIR_ICONS
 
char * ANGBAND_DIR_USER
 
char * ANGBAND_DIR_SAVE
 
char * ANGBAND_DIR_SCORES
 
char * ANGBAND_DIR_INFO
 
char * ANGBAND_DIR_ARCHIVE
 
static const char * slots []
 
const char * list_obj_flag_names []
 
const char * list_element_names []
 
static const char * effect_list []
 
static const char * trap_flags []
 
static const char * terrain_flags []
 
static const char * mon_race_flags []
 
static const char * player_info_flags []
 
static struct file_parser constants_parser
 
static struct file_parser names_parser
 
static struct file_parser trap_parser
 
static struct file_parser feat_parser
 
static struct file_parser body_parser
 
static struct history_charthistories
 

Initialize player histories

More...
 
static struct file_parser history_parser
 
static struct file_parser p_race_parser
 
static struct file_parser realm_parser
 
static struct file_parser class_parser
 
static wchar_t flavor_glyph
 

Intialize flavors

More...
 
static unsigned int flavor_tval
 
struct file_parser flavor_parser
 
static struct file_parser hints_parser
 
struct {
   const char *   name
 
   struct file_parser *   parser
 
pl []
 

Game data initialization

More...
 
static struct init_module arrays_module
 
struct init_module z_quark_module
 
struct init_module generate_module
 The generate module, which initialises template rooms and vaults Should it clean up? More...
 
struct init_module rune_module
 
struct init_module obj_make_module
 
struct init_module ignore_module
 
struct init_module mon_make_module
 
struct init_module player_module
 
struct init_module store_module
 
struct init_module messages_module
 
struct init_module options_module
 
static struct init_modulemodules []
 

Detailed Description

Various game initialization routines.

Copyright (c) 1997 Ben Harrison

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

This file is used to initialize various variables and arrays for the Angband game.

Several of the arrays for Angband are built from data files in the "lib/gamedata" directory.

Macro Definition Documentation

#define BUILD_DIRECTORY_PATH (   dest,
  basepath,
  dirname 
)
Value:
{ \
path_build(buf, sizeof(buf), (basepath), (dirname)); \
dest = string_make(buf); \
}
png_bytep buf
Definition: libpng12/png.h:2815
size_t path_build(char *buf, size_t len, const char *base, const char *leaf)
Create a new path string by appending a 'leaf' to 'base'.
Definition: z-file.c:170
char * string_make(const char *str)
Duplicates an existing string str, allocating as much memory as necessary.
Definition: z-virt.c:88

Referenced by init_file_paths().

#define EFFECT (   x,
  a,
  b,
  c,
  d,
 
)    #x,
#define ELEM (   a)    #a,
#define EQUIP (   a,
  b,
  c,
  d,
  e,
 
)    #a,
#define OF (   a)    #a,
#define PF (   a,
  b,
 
)    #a,
#define RF (   a,
  b,
 
)    #a,
#define TF (   a,
 
)    #a,
#define TRF (   a,
 
)    #a,

Function Documentation

void cleanup_angband ( void  )
static void cleanup_arrays ( void  )
static

Free all the internal arrays.

References cleanup_parser(), i, N_ELEMENTS, and pl.

static void cleanup_body ( void  )
static
static void cleanup_class ( void  )
static
static void cleanup_constants ( void  )
static

References mem_free().

static void cleanup_feat ( void  )
static
static void cleanup_flavor ( void  )
static
static void cleanup_game_constants ( void  )
static

Free the game constants.

References cleanup_parser().

Referenced by cleanup_angband().

static void cleanup_hints ( void  )
static
static void cleanup_history ( void  )
static
static void cleanup_names ( void  )
static
static void cleanup_p_race ( void  )
static
static void cleanup_realm ( void  )
static
static void cleanup_trap ( void  )
static
void create_needed_dirs ( void  )

Create any missing directories.

We create only those dirs which may be empty (user/, save/, scores/, info/, help/). The others are assumed to contain required files and therefore must exist at startup (edit/, pref/, file/, xtra/).

ToDo: Only create the directories when actually writing files.

References ANGBAND_DIR_ARCHIVE, ANGBAND_DIR_HELP, ANGBAND_DIR_INFO, ANGBAND_DIR_SAVE, ANGBAND_DIR_SCORES, ANGBAND_DIR_USER, dir_create(), path_build(), and quit_fmt().

Referenced by main().

static struct history_chart* findchart ( struct history_chart hs,
unsigned int  idx 
)
static
static errr finish_parse_body ( struct parser p)
static
static errr finish_parse_class ( struct parser p)
static
static errr finish_parse_constants ( struct parser p)
static

References parser_destroy(), and parser_priv().

static errr finish_parse_feat ( struct parser p)
static
static errr finish_parse_flavor ( struct parser p)
static
static errr finish_parse_hints ( struct parser p)
static
static errr finish_parse_history ( struct parser p)
static
static errr finish_parse_names ( struct parser p)
static
static errr finish_parse_p_race ( struct parser p)
static
static errr finish_parse_realm ( struct parser p)
static
static errr finish_parse_trap ( struct parser p)
static
errr grab_effect_data ( struct parser p,
struct effect effect 
)
bool init_angband ( void  )

Initialise Angband's data stores and allocate memory for structures, etc, so that the game can get started.

The only input/output in this file should be via event_signal_string(). We cannot rely on any particular UI as this part should be UI-agnostic. We also cannot rely on anything else having being initialised into any particlar state. Which is why you'd be calling this function in the first place.

Old comment, not sure if still accurate: Note that the "graf-xxx.prf" file must be loaded separately, if needed, in the first (?) pass through "TERM_XTRA_REACT".

References EVENT_ENTER_INIT, EVENT_INITSTATUS, event_signal(), event_signal_message(), i, init_module::init, init_game_constants(), monster_list_init(), object_list_init(), and Rand_init().

Referenced by main(), and setup_tests().

void init_arrays ( void  )

Initialize just the internal arrays.

This should be callable by the test suite, without relying on input, or anything to do with a user or savefiles.

Assumption: Paths are set up correctly before calling this function.

References EVENT_INITSTATUS, event_signal_message(), format(), i, msg, N_ELEMENTS, pl, quit_fmt(), run_parser(), string_free(), and string_make().

Referenced by read_edit_files().

void init_file_paths ( const char *  configpath,
const char *  libpath,
const char *  datapath 
)

Find the default paths to all of our important sub-directories.

All of the sub-directories should, by default, be located inside the main directory, whose location is very system dependent and is set by the ANGBAND_PATH environment variable, if it exists. (On multi- user systems such as Linux this is not the default - see config.h for more info.)

This function takes a writable buffers, initially containing the "path" to the "config", "lib" and "data" directories, for example, "/etc/angband/", "/usr/share/angband" and "/var/games/angband" - or a system dependent string, for example, ":lib:". The buffer must be large enough to contain at least 32 more characters.

Various command line options may allow some of the important directories to be changed to user-specified directories, most importantly, the "scores" and "user" and "save" directories, but this is done after this function, see "main.c".

In general, the initial path should end in the appropriate "PATH_SEP" string. All of the "sub-directory" paths (created below or supplied by the user) will NOT end in the "PATH_SEP" string, see the special "path_build()" function in "util.c" for more information.

Hack – first we free all the strings, since this is known to succeed even if the strings have not been allocated yet, as long as the variables start out as "NULL". This allows this function to be called multiple times, for example, to try several base "path" values until a good one is found.

References ANGBAND_DIR_ARCHIVE, ANGBAND_DIR_CUSTOMIZE, ANGBAND_DIR_FONTS, ANGBAND_DIR_GAMEDATA, ANGBAND_DIR_HELP, ANGBAND_DIR_ICONS, ANGBAND_DIR_INFO, ANGBAND_DIR_SAVE, ANGBAND_DIR_SCORES, ANGBAND_DIR_SCREENS, ANGBAND_DIR_SOUNDS, ANGBAND_DIR_TILES, ANGBAND_DIR_USER, ANGBAND_SYS, buf, BUILD_DIRECTORY_PATH, my_strcpy(), NULL, path_build(), PATH_SEP, string_free(), string_make(), suffix(), and VERSION_NAME.

Referenced by init_stuff(), and set_file_paths().

void init_game_constants ( void  )

Initialize game constants.

Assumption: Paths are set up correctly before calling this function.

References EVENT_INITSTATUS, event_signal_message(), quit_fmt(), and run_parser().

Referenced by init_angband(), and read_edit_files().

struct parser* init_parse_body ( void  )
struct parser* init_parse_class ( void  )
struct parser* init_parse_constants ( void  )
struct parser* init_parse_feat ( void  )
struct parser* init_parse_flavor ( void  )
struct parser* init_parse_hints ( void  )
struct parser* init_parse_history ( void  )
struct parser* init_parse_names ( void  )
struct parser* init_parse_p_race ( void  )
struct parser* init_parse_realm ( void  )
struct parser* init_parse_trap ( void  )
static enum parser_error parse_body_body ( struct parser p)
static
static enum parser_error parse_body_slot ( struct parser p)
static
static enum parser_error parse_class_attack ( struct parser p)
static
static enum parser_error parse_class_book ( struct parser p)
static
static enum parser_error parse_class_desc ( struct parser p)
static
static enum parser_error parse_class_dice ( struct parser p)
static
static enum parser_error parse_class_effect ( struct parser p)
static
static enum parser_error parse_class_equip ( struct parser p)
static
static enum parser_error parse_class_expr ( struct parser p)
static
static enum parser_error parse_class_flags ( struct parser p)
static
static enum parser_error parse_class_info ( struct parser p)
static
static enum parser_error parse_class_magic ( struct parser p)
static
static enum parser_error parse_class_name ( struct parser p)
static
static enum parser_error parse_class_param ( struct parser p)
static
static enum parser_error parse_class_realm ( struct parser p)
static
static enum parser_error parse_class_skill_device ( struct parser p)
static
static enum parser_error parse_class_skill_dig ( struct parser p)
static
static enum parser_error parse_class_skill_disarm_magic ( struct parser p)
static
static enum parser_error parse_class_skill_disarm_phys ( struct parser p)
static
static enum parser_error parse_class_skill_melee ( struct parser p)
static
static enum parser_error parse_class_skill_save ( struct parser p)
static
static enum parser_error parse_class_skill_search ( struct parser p)
static
static enum parser_error parse_class_skill_shoot ( struct parser p)
static
static enum parser_error parse_class_skill_stealth ( struct parser p)
static
static enum parser_error parse_class_skill_throw ( struct parser p)
static
static enum parser_error parse_class_spell ( struct parser p)
static
static enum parser_error parse_class_stats ( struct parser p)
static
static enum parser_error parse_class_title ( struct parser p)
static
static enum parser_error parse_constants_carry_cap ( struct parser p)
static
static enum parser_error parse_constants_dun_gen ( struct parser p)
static
static enum parser_error parse_constants_level_max ( struct parser p)
static
static enum parser_error parse_constants_mon_gen ( struct parser p)
static
static enum parser_error parse_constants_mon_play ( struct parser p)
static
static enum parser_error parse_constants_obj_make ( struct parser p)
static
static enum parser_error parse_constants_player ( struct parser p)
static
static enum parser_error parse_constants_store ( struct parser p)
static
static enum parser_error parse_constants_world ( struct parser p)
static
static enum parser_error parse_feat_desc ( struct parser p)
static
static enum parser_error parse_feat_die_msg ( struct parser p)
static
static enum parser_error parse_feat_flags ( struct parser p)
static
static enum parser_error parse_feat_graphics ( struct parser p)
static
static enum parser_error parse_feat_hurt_msg ( struct parser p)
static
static enum parser_error parse_feat_info ( struct parser p)
static
static enum parser_error parse_feat_mimic ( struct parser p)
static
static enum parser_error parse_feat_name ( struct parser p)
static
static enum parser_error parse_feat_priority ( struct parser p)
static
static enum parser_error parse_feat_resist_flag ( struct parser p)
static
static enum parser_error parse_feat_run_msg ( struct parser p)
static
static enum parser_error parse_feat_walk_msg ( struct parser p)
static
static enum parser_error parse_flavor_flavor ( struct parser p)
static
static enum parser_error parse_flavor_kind ( struct parser p)
static
static enum parser_error parse_hint ( struct parser p)
static


Initialize hints

References h, mem_zalloc(), parser_getstr(), parser_priv(), parser_setpriv(), and string_make().

Referenced by init_parse_hints().

static enum parser_error parse_history_chart ( struct parser p)
static
static enum parser_error parse_history_phrase ( struct parser p)
static
static enum parser_error parse_names_section ( struct parser p)
static
static enum parser_error parse_names_word ( struct parser p)
static
static enum parser_error parse_p_race_height ( struct parser p)
static
static enum parser_error parse_p_race_history ( struct parser p)
static
static enum parser_error parse_p_race_info ( struct parser p)
static
static enum parser_error parse_p_race_name ( struct parser p)
static
static enum parser_error parse_p_race_obj_flags ( struct parser p)
static
static enum parser_error parse_p_race_play_flags ( struct parser p)
static
static enum parser_error parse_p_race_skill_device ( struct parser p)
static
static enum parser_error parse_p_race_skill_dig ( struct parser p)
static
static enum parser_error parse_p_race_skill_disarm_magic ( struct parser p)
static
static enum parser_error parse_p_race_skill_disarm_phys ( struct parser p)
static
static enum parser_error parse_p_race_skill_melee ( struct parser p)
static
static enum parser_error parse_p_race_skill_save ( struct parser p)
static
static enum parser_error parse_p_race_skill_search ( struct parser p)
static
static enum parser_error parse_p_race_skill_shoot ( struct parser p)
static
static enum parser_error parse_p_race_skill_stealth ( struct parser p)
static
static enum parser_error parse_p_race_skill_throw ( struct parser p)
static
static enum parser_error parse_p_race_stats ( struct parser p)
static
static enum parser_error parse_p_race_values ( struct parser p)
static
static enum parser_error parse_p_race_weight ( struct parser p)
static
static enum parser_error parse_realm_book_noun ( struct parser p)
static
static enum parser_error parse_realm_name ( struct parser p)
static
static enum parser_error parse_realm_spell_noun ( struct parser p)
static
static enum parser_error parse_realm_stat ( struct parser p)
static
static enum parser_error parse_realm_verb ( struct parser p)
static
static enum parser_error parse_trap_appear ( struct parser p)
static
static enum parser_error parse_trap_desc ( struct parser p)
static
static enum parser_error parse_trap_dice ( struct parser p)
static
static enum parser_error parse_trap_dice_xtra ( struct parser p)
static
static enum parser_error parse_trap_effect ( struct parser p)
static
static enum parser_error parse_trap_effect_xtra ( struct parser p)
static
static enum parser_error parse_trap_expr ( struct parser p)
static
static enum parser_error parse_trap_expr_xtra ( struct parser p)
static
static enum parser_error parse_trap_flags ( struct parser p)
static
static enum parser_error parse_trap_graphics ( struct parser p)
static
static enum parser_error parse_trap_msg ( struct parser p)
static
static enum parser_error parse_trap_msg_bad ( struct parser p)
static
static enum parser_error parse_trap_msg_good ( struct parser p)
static
static enum parser_error parse_trap_msg_xtra ( struct parser p)
static
static enum parser_error parse_trap_name ( struct parser p)
static
static enum parser_error parse_trap_param ( struct parser p)
static
static enum parser_error parse_trap_param_xtra ( struct parser p)
static
static enum parser_error parse_trap_save_flags ( struct parser p)
static
static enum parser_error parse_trap_visibility ( struct parser p)
static
static errr run_parse_body ( struct parser p)
static
static errr run_parse_class ( struct parser p)
static
static errr run_parse_constants ( struct parser p)
static
static errr run_parse_feat ( struct parser p)
static
static errr run_parse_flavor ( struct parser p)
static
static errr run_parse_hints ( struct parser p)
static
static errr run_parse_history ( struct parser p)
static
static errr run_parse_names ( struct parser p)
static
static errr run_parse_p_race ( struct parser p)
static
static errr run_parse_realm ( struct parser p)
static
static errr run_parse_trap ( struct parser p)
static

Variable Documentation

char* ANGBAND_DIR_ARCHIVE
char* ANGBAND_DIR_CUSTOMIZE
char* ANGBAND_DIR_FONTS

Referenced by cleanup_angband(), and init_file_paths().

char* ANGBAND_DIR_GAMEDATA

Various directories.

These are no longer necessarily all subdirs of "lib"

Referenced by cleanup_angband(), init_file_paths(), and parse_file().

char* ANGBAND_DIR_HELP
char* ANGBAND_DIR_ICONS

Referenced by cleanup_angband(), and init_file_paths().

char* ANGBAND_DIR_INFO
char* ANGBAND_DIR_SAVE
char* ANGBAND_DIR_SCORES
char* ANGBAND_DIR_SCREENS
char* ANGBAND_DIR_SOUNDS
char* ANGBAND_DIR_TILES
char* ANGBAND_DIR_USER
const char* ANGBAND_SYS = "xxx"
struct init_module arrays_module
static
Initial value:
= {
.name = "arrays",
.init = init_arrays,
.cleanup = cleanup_arrays
}
static void cleanup_arrays(void)
Free all the internal arrays.
Definition: init.c:2824
void init_arrays(void)
Initialize just the internal arrays.
Definition: init.c:2808
struct file_parser body_parser
static
Initial value:
= {
"body",
}
static void cleanup_body(void)
Definition: init.c:1563
struct parser * init_parse_body(void)
Definition: init.c:1504
static errr finish_parse_body(struct parser *p)
Definition: init.c:1516
static errr run_parse_body(struct parser *p)
Definition: init.c:1512
struct file_parser class_parser
static
Initial value:
= {
"class",
}
static errr run_parse_class(struct parser *p)
Definition: init.c:2542
static errr finish_parse_class(struct parser *p)
Definition: init.c:2546
struct parser * init_parse_class(void)
Definition: init.c:2503
static void cleanup_class(void)
Definition: init.c:2559
struct file_parser constants_parser
static
Initial value:
= {
"constants",
}
static errr finish_parse_constants(struct parser *p)
Definition: init.c:620
static void cleanup_constants(void)
Definition: init.c:626
static errr run_parse_constants(struct parser *p)
Definition: init.c:616
struct parser * init_parse_constants(void)
Definition: init.c:599
const char* effect_list[]
static

Referenced by grab_effect_data().

struct file_parser feat_parser
static
Initial value:
= {
"terrain",
}
static void cleanup_feat(void)
Definition: init.c:1440
static errr run_parse_feat(struct parser *p)
Definition: init.c:1400
struct parser * init_parse_feat(void)
Definition: init.c:1382
static errr finish_parse_feat(struct parser *p)
Definition: init.c:1404
wchar_t flavor_glyph
static


Intialize flavors

Referenced by parse_flavor_flavor(), and parse_flavor_kind().

struct file_parser flavor_parser
Initial value:
= {
"flavor",
}
struct parser * init_parse_flavor(void)
Definition: init.c:2657
static void cleanup_flavor(void)
Definition: init.c:2678
static errr run_parse_flavor(struct parser *p)
Definition: init.c:2668
static errr finish_parse_flavor(struct parser *p)
Definition: init.c:2672

Referenced by flavor_init().

unsigned int flavor_tval
static
struct init_module generate_module

The generate module, which initialises template rooms and vaults Should it clean up?

struct file_parser hints_parser
static
Initial value:
= {
"hints",
}
static errr run_parse_hints(struct parser *p)
Definition: init.c:2724
static errr finish_parse_hints(struct parser *p)
Definition: init.c:2728
struct parser * init_parse_hints(void)
Definition: init.c:2718
static void cleanup_hints(void)
Definition: init.c:2734
struct history_chart* histories
static


Initialize player histories

Referenced by cleanup_history().

struct file_parser history_parser
static
Initial value:
= {
"history",
}
static errr run_parse_history(struct parser *p)
Definition: init.c:1642
struct parser * init_parse_history(void)
Definition: init.c:1634
static errr finish_parse_history(struct parser *p)
Definition: init.c:1646
static void cleanup_history(void)
Definition: init.c:1680
struct init_module ignore_module
const char* list_element_names[]
const char* list_obj_flag_names[]
struct init_module messages_module
struct init_module* modules[]
static
Initial value:
= {
}
struct init_module store_module
Definition: store.c:356
struct init_module z_quark_module
Definition: z-quark.c:72
struct init_module messages_module
Definition: message.c:448
struct init_module player_module
Definition: player.c:449
static struct init_module arrays_module
Definition: init.c:2834
struct init_module obj_make_module
Definition: obj-make.c:1240
struct init_module generate_module
The generate module, which initialises template rooms and vaults Should it clean up?
Definition: generate.c:1003
struct init_module mon_make_module
Definition: mon-make.c:1352
struct init_module options_module
Definition: option.c:143
NULL
Definition: list-summon-types.h:18
struct init_module ignore_module
Definition: obj-ignore.c:714
struct init_module rune_module
Definition: obj-knowledge.c:210
struct init_module mon_make_module
const char* mon_race_flags[]
static

Referenced by parse_feat_resist_flag().

const char* name
struct file_parser names_parser
static
Initial value:
= {
"names",
}
struct parser * init_parse_names(void)
Definition: init.c:696
static errr finish_parse_names(struct parser *p)
Definition: init.c:710
static errr run_parse_names(struct parser *p)
Definition: init.c:706
static void cleanup_names(void)
Definition: init.c:733
struct init_module obj_make_module
struct init_module options_module
struct file_parser p_race_parser
static
Initial value:
= {
"p_race",
}
static errr run_parse_p_race(struct parser *p)
Definition: init.c:1948
struct parser * init_parse_p_race(void)
Definition: init.c:1923
static errr finish_parse_p_race(struct parser *p)
Definition: init.c:1952
static void cleanup_p_race(void)
Definition: init.c:1965
struct { ... } pl[]


Game data initialization

A list of all the above parsers, plus those found in mon-init.c and obj-init.c

Referenced by cleanup_arrays(), display_panel(), init_arrays(), and panel_line().

const char* player_info_flags[]
static
Initial value:
=
{
#define PF(a, b, c)
}
NULL
Definition: list-summon-types.h:18

Referenced by parse_class_flags(), and parse_p_race_play_flags().

struct init_module player_module
struct file_parser realm_parser
static
Initial value:
= {
"realm",
}
static errr finish_parse_realm(struct parser *p)
Definition: init.c:2056
static errr run_parse_realm(struct parser *p)
Definition: init.c:2052
static void cleanup_realm(void)
Definition: init.c:2062
struct parser * init_parse_realm(void)
Definition: init.c:2041
struct init_module rune_module
const char* slots[]
static
Initial value:
= {
#define EQUIP(a, b, c, d, e, f)
}
NULL
Definition: list-summon-types.h:18

Referenced by parse_body_slot().

struct init_module store_module
const char* terrain_flags[]
static

Referenced by parse_feat_flags().

const char* trap_flags[]
static
Initial value:
=
{
#define TRF(a, b)
TRF(INVISIBLE, "Is invisible")
}
#define TRF(a, b)
NULL
Definition: list-summon-types.h:18

Referenced by parse_trap_flags().

struct file_parser trap_parser
static
Initial value:
= {
"trap",
}
struct parser * init_parse_trap(void)
Definition: init.c:1145
static errr run_parse_trap(struct parser *p)
Definition: init.c:1170
static errr finish_parse_trap(struct parser *p)
Definition: init.c:1174
static void cleanup_trap(void)
Definition: init.c:1210
struct angband_constants* z_info

Structure (not array) of game constants.

Referenced by add_activation(), add_curse(), add_monster_lights(), alloc_init_egos(), alloc_init_objects(), append_artifact_curse(), append_object_curse(), append_random_brand(), append_random_slay(), apply_curse(), artifact_prep(), artifact_set_data_new(), blow_color(), blow_index(), brand_count(), brand_object(), build_store(), build_tunnel(), build_vault(), calc_inventory(), cave_generate(), cave_new(), cavern_gen(), choose_profile(), chunk_copy(), classic_gen(), cleanup_act(), cleanup_artifact(), cleanup_brand(), cleanup_curse(), cleanup_ego(), cleanup_lore(), cleanup_monster(), cleanup_object(), cleanup_object_power(), cleanup_object_property(), cleanup_pain(), cleanup_pits(), cleanup_profile(), cleanup_projection(), cleanup_quest(), cleanup_slay(), collect_artifact_data(), collect_known_artifacts(), collect_slay_brand_stats(), copy_artifact(), copy_brands(), copy_curses(), copy_slays(), count_known_monsters(), create_obj_flag_mask(), curse_menu(), curses_are_equal(), decrease_timeouts(), describe_brands(), describe_curses(), describe_damage(), describe_slays(), design_artifact(), display_feeling(), do_cmd_alter_aux(), do_cmd_autopickup(), do_cmd_buy(), do_cmd_cast(), do_cmd_close(), do_cmd_disarm(), do_cmd_drop(), do_cmd_fire(), do_cmd_fire_at_nearest(), do_cmd_go_down(), do_cmd_go_up(), do_cmd_hold(), do_cmd_jump(), do_cmd_knowledge_artifacts(), do_cmd_knowledge_ego_items(), do_cmd_knowledge_features(), do_cmd_knowledge_monsters(), do_cmd_knowledge_traps(), do_cmd_open(), do_cmd_pickup(), do_cmd_query_symbol(), do_cmd_refill(), do_cmd_sleep(), do_cmd_study_book(), do_cmd_study_spell(), do_cmd_takeoff(), do_cmd_tunnel(), do_cmd_walk(), do_cmd_wiz_jump(), do_cmd_wiz_learn(), do_randart(), drop_find_grid(), dump_autoinscriptions(), dump_features(), dump_monsters(), dump_objects(), dungeon_get_next_level(), effect_handler_BREATH(), effect_handler_CURSE_ARMOR(), effect_handler_CURSE_WEAPON(), effect_handler_DEEP_DESCENT(), effect_handler_MASS_BANISH(), effect_handler_TELEPORT_LEVEL(), effect_handler_WAKE(), ego_menu(), find_cave_profile(), find_range(), find_space(), finish_parse_act(), finish_parse_artifact(), finish_parse_brand(), finish_parse_curse(), finish_parse_eff(), finish_parse_ego(), finish_parse_lore(), finish_parse_meth(), finish_parse_monster(), finish_parse_object(), finish_parse_object_power(), finish_parse_object_property(), finish_parse_pain(), finish_parse_pit(), finish_parse_profile(), finish_parse_projection(), finish_parse_quest(), finish_parse_randart(), finish_parse_slay(), flavor_assign_fixed(), flavor_assign_random(), flavor_init(), floor_carry(), gauntlet_gen(), gear_to_label(), get_base_item(), get_debug_command(), get_mon_num(), get_money(), get_moves(), get_obj_num(), get_obj_num_by_kind(), hallucinatory_monster(), hallucinatory_object(), hard_centre_gen(), ignore_birth_init(), ignore_collect_kind(), improve_attack_modifier(), init_ignore(), init_player(), init_race_allocs(), init_rune(), inven_carry(), inven_carry_num(), inven_wield(), is_daytime(), is_quest(), item_menu_browser(), item_tester_uncursable(), labyrinth_gen(), lair_gen(), load_roller_data(), lookup_artifact_name(), lookup_curse(), lookup_ego_item(), lookup_feat(), lookup_kind(), lookup_monster(), lookup_obj_property(), lookup_sval(), lookup_symbol(), lookup_trap(), lore_append_attack(), lore_is_fully_known(), lore_update(), make_artifact(), make_artifact_special(), make_attack_normal(), make_attack_spell(), make_ego_item(), melee_effect_experience(), melee_effect_handler_DRAIN_CHARGES(), melee_effect_handler_EAT_FOOD(), melee_effect_handler_EAT_ITEM(), modified_gen(), mon_create_drop(), mon_pop(), mon_restrict(), mon_summary(), money_kind(), moria_gen(), new_level_display_update(), obj_has_flag(), obj_known_damage(), obj_known_light(), obj_known_misc_combat(), object_copy(), object_curses_find_element(), object_curses_find_flags(), object_curses_find_modifiers(), object_curses_find_to_a(), object_curses_find_to_d(), object_curses_find_to_h(), object_has_rune(), object_info_ego(), object_is_in_quiver(), object_learn_brand(), object_learn_slay(), object_power(), object_power_calculation_ALL_BRANDS(), object_power_calculation_ALL_KILLS(), object_power_calculation_ALL_SLAYS(), object_prep(), object_runes_known(), objkind_byid(), on_new_level(), pack_is_full(), pack_is_overfull(), pack_overflow(), pack_slots_used(), parse_artifact_act(), parse_artifact_brand(), parse_artifact_curse(), parse_artifact_info(), parse_artifact_slay(), parse_artifact_time(), parse_ego_brand(), parse_ego_curse(), parse_ego_slay(), parse_ego_type(), parse_lore_blow(), parse_mon_base_pain(), parse_monster_hearing(), parse_monster_smell(), parse_object_brand(), parse_object_curse(), parse_object_power_type(), parse_object_slay(), parse_prefs_feat(), parse_prefs_monster_base(), parse_prefs_object(), parse_prefs_trap(), parse_vault_max_depth(), path_analyse(), pick_trap(), place_feeling(), place_stairs(), place_trap(), player_book_has_unlearned_spells(), player_init(), player_know_object(), player_knows_ego(), player_knows_rune(), player_learn_rune(), player_pickup_item(), player_quests_free(), player_quests_reset(), player_resting_step_turn(), process_monster_glyph(), process_monster_multiply(), process_monsters(), process_world(), project(), project_player_handler_CHAOS(), project_player_handler_NETHER(), project_player_handler_TIME(), projectable(), prt_level_feeling(), push_object(), py_attack(), quest_check(), quiver_absorb_num(), ranged_helper(), rd_artifacts(), rd_dungeon(), rd_item(), rd_monster_memory(), rd_monsters_aux(), rd_object_memory(), rd_player(), rd_quests(), rd_stores_aux(), react_to_slay(), recalculate_stats(), refill_lamp(), refresh_stock(), remove_object_curse(), reset_visuals(), room_build(), run_game_loop(), run_step(), scan_items(), see_floor_items(), seen_tval(), set_pit_type(), setup_tests(), show_equip(), show_floor(), show_inven(), show_obj_list(), show_quiver(), slay_count(), spell_value_base_max_sight(), spoil_artifact(), spoil_mon_desc(), spoil_mon_info(), spoil_obj_desc(), square_add_stairs(), store_base_power(), store_carry(), store_create_random(), store_menu_init(), store_new(), store_update(), target_set_interactive(), target_set_interactive_aux(), teardown_tests(), test_defaults(), textui_browse_knowledge(), textui_browse_object_knowledge(), textui_get_item(), textui_prefs_init(), town_gen(), town_gen_layout(), try_supercharge(), turn_energy(), tval_sval_count(), tval_sval_list(), update_one(), update_player_object_knowledge(), update_view_one(), use_aux(), use_store(), wiz_create_item(), wiz_create_item_all_items(), wr_artifacts(), wr_ignore(), wr_item(), wr_misc(), wr_monster_memory(), wr_object_memory(), wr_quests(), write_character_dump(), write_curse_kinds(), write_dummy_object_record(), and write_lore_entries().

struct init_module z_quark_module