Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

generic.c File Reference

#include "config.h"
#include "misc.h"
#include "lisp.h"
#include "game.h"
#include "gvar.def"

Include dependency graph for generic.c:

Include dependency graph

Defines

#define DEF_VAR_I(NAME, FNAME, SETFNAME, DOC, var, LO, DFLT, HI)   { NAME, FNAME, NULL, NULL, SETFNAME, NULL, NULL, DOC, DFLT, NULL, NULL, LO, HI },
#define DEF_VAR_S(NAME, FNAME, SETFNAME, DOC, var, DFLT)   { NAME, NULL, FNAME, NULL, NULL, SETFNAME, NULL, DOC, 0, DFLT, NULL, 0, 0 },
#define DEF_VAR_L(NAME, FNAME, SETFNAME, DOC, var, DFLT)   { NAME, NULL, NULL, FNAME, NULL, NULL, SETFNAME, DOC, 0, NULL, DFLT, 0, 0 },
#define DEF_VAR_I(str, FNAME, SETFNAME, doc, VAR, lo, dflt, hi)
#define DEF_VAR_S(str, FNAME, SETFNAME, doc, VAR, dflt)
#define DEF_VAR_L(str, FNAME, SETFNAME, doc, VAR, DFLT)
#define DEF_VAR_I(str, fname, SETFNAME, doc, var, lo, DFLT, hi)   SETFNAME(DFLT);
#define DEF_VAR_S(str, fname, SETFNAME, doc, var, DFLT)   SETFNAME(DFLT);
#define DEF_VAR_L(str, fname, SETFNAME, doc, var, DFLT)
#define TYPEPROP(TYPES, N, DEFNS, I, TYPE)   ((TYPE *) &(((char *) (&(TYPES[N])))[DEFNS[I].offset]))[0]

Functions

void utype_error (int u)
void mtype_error (int m)
void ttype_error (int t)
void atype_error (int a)
void init_types (void)
void init_globals (void)
int create_unit_type (void)
int create_material_type (void)
int create_terrain_type (void)
int create_advance_type (void)
void default_unit_type (int u)
void default_material_type (int m)
void default_terrain_type (int t)
void default_advance_type (int a)
char * index_type_name (int x)
void allocate_table (int tbl, int reset)
int numtypes_from_index_type (int x)
void disallow_more_unit_types (void)
void disallow_more_terrain_types (void)
void disallow_more_material_types (void)
void disallow_more_advance_types (void)
void count_terrain_subtypes (void)
int table_default (int(*getter)(int, int))
 Default value for table.

short uprop_i_default (int(*intgetter)(int))
 Default value for integer uprop.

char * uprop_s_default (char *(*strgetter)(int))
 Default value for string uprop.

Obj * uprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp uprop.

short tprop_i_default (int(*intgetter)(int))
 Default value for integer tprop.

char * tprop_s_default (char *(*strgetter)(int))
 Default value for string tprop.

Obj * tprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp tprop.

short mprop_i_default (int(*intgetter)(int))
 Default value for integer mprop.

char * mprop_s_default (char *(*strgetter)(int))
 Default value for string mprop.

Obj * mprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp mprop.

short aprop_i_default (int(*intgetter)(int))
 Default value for integer aprop.

char * aprop_s_default (char *(*strgetter)(int))
 Default value for string aprop.

Obj * aprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp aprop.

int gvar_i_default (int(*intgetter)(void))
 Default value for integer gvar.

char * gvar_s_default (char *(*strgetter)(void))
 Default value for string gvar.

Obj * gvar_l_default (Obj *(*objgetter)(void))
 Default value for Lisp gvar.


Variables

short numutypes
 Number of Unit types.

short nummtypes
 Number of Material types.

short numttypes
 Number of Terrain types.

short numatypes
 Number of Advance types.

short canaddutype = TRUE
 Can add Unit type flag.

short canaddmtype = TRUE
 Can add Material type flag.

short canaddttype = TRUE
 Can add Terrain type flag.

short canaddatype = TRUE
 Can add Advance type flag.

int numcelltypes = 0
 Number of cell types.

int numauxttypes = 0
int numbordtypes = 0
 Number of border types.

int numconntypes = 0
 Number of connection types.

int numcoattypes = 0
 Number of coating types.

short * aux_terrain_type_index
int any_thickness
short first_auxt_type
 Head of aux terrain type list.

short * next_auxt_type = NULL
 Next aux terrain type in list.

short first_bord_type
 Head of border type list.

short * next_bord_type = NULL
 Next border type in list.

short first_conn_type
 Head of connection type list.

short * next_conn_type = NULL
 Next connection type in list.

int * tmp_u_array
 Tempoary Unit type array.

int * tmp_u2_array
 More utype scratch space.

int * tmp_t_array
 Tempoary Terrain type array.

int * tmp_m_array
 Tempoary Material type array.

int * tmp_a_array
 Tempoary Advance type array.

int ** tmp_uu_array
 Scratch space in the likeness of a TableUU.

Utype * utypes
 Unit type properties.

Mtype * mtypes
 Material type properties.

Ttype * ttypes
 Terrain type properties.

Atype * atypes
 Advance type properties.

Globals globals
 Global data variable.

int curmaxutypes = 100
int curmaxmtypes = 20
int curmaxttypes = 40
int curmaxatypes = 200
VarDefn vardefns []
 Array of variable definitions.


Define Documentation

#define DEF_VAR_I (  str,
fname,
SETFNAME,
doc,
var,
lo,
DFLT,
hi   )     SETFNAME(DFLT);
 

#define DEF_VAR_I (  str,
FNAME,
SETFNAME,
doc,
VAR,
lo,
dflt,
hi   ) 
 

Value:

int FNAME(void) { return globals.VAR; }  \
  void SETFNAME(int v) { globals.VAR = v; }

#define DEF_VAR_I (  NAME,
FNAME,
SETFNAME,
DOC,
var,
LO,
DFLT,
HI   )     { NAME, FNAME, NULL, NULL, SETFNAME, NULL, NULL, DOC, DFLT, NULL, NULL, LO, HI },
 

#define DEF_VAR_L (  str,
fname,
SETFNAME,
doc,
var,
DFLT   ) 
 

Value:

if ((DFLT) != 0) {  \
        Obj *(*fn)(void) = (DFLT);  \
        if (fn != NULL) SETFNAME((*fn)());  \
    } else { \
        SETFNAME(lispnil);  \
    }

#define DEF_VAR_L (  str,
FNAME,
SETFNAME,
doc,
VAR,
DFLT   ) 
 

Value:

Obj *FNAME(void) { return globals.VAR; }  \
  void SETFNAME(Obj *v) { globals.VAR = v; }

#define DEF_VAR_L (  NAME,
FNAME,
SETFNAME,
DOC,
var,
DFLT   )     { NAME, NULL, NULL, FNAME, NULL, NULL, SETFNAME, DOC, 0, NULL, DFLT, 0, 0 },
 

#define DEF_VAR_S (  str,
fname,
SETFNAME,
doc,
var,
DFLT   )     SETFNAME(DFLT);
 

#define DEF_VAR_S (  str,
FNAME,
SETFNAME,
doc,
VAR,
dflt   ) 
 

Value:

char *FNAME(void) { return globals.VAR; }  \
  void SETFNAME(char *v) { globals.VAR = v; }

#define DEF_VAR_S (  NAME,
FNAME,
SETFNAME,
DOC,
var,
DFLT   )     { NAME, NULL, FNAME, NULL, NULL, SETFNAME, NULL, DOC, 0, DFLT, NULL, 0, 0 },
 

#define TYPEPROP (  TYPES,
N,
DEFNS,
I,
TYPE   )     ((TYPE *) &(((char *) (&(TYPES[N])))[DEFNS[I].offset]))[0]
 


Function Documentation

void allocate_table (  int  tbl,
int  reset
) 
 

short aprop_i_default (  int(*  intgetter)(int)  ) 
 

Default value for integer aprop.

Obj* aprop_l_default (  Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp aprop.

char* aprop_s_default (  char *(*  strgetter)(int)  ) 
 

Default value for string aprop.

void atype_error (  int  a  ) 
 

void count_terrain_subtypes (  void   ) 
 

int create_advance_type (  void   ) 
 

int create_material_type (  void   ) 
 

int create_terrain_type (  void   ) 
 

int create_unit_type (  void   ) 
 

void default_advance_type (  int  a  ) 
 

void default_material_type (  int  m  ) 
 

void default_terrain_type (  int  t  ) 
 

void default_unit_type (  int  u  ) 
 

void disallow_more_advance_types (  void   ) 
 

void disallow_more_material_types (  void   ) 
 

void disallow_more_terrain_types (  void   ) 
 

void disallow_more_unit_types (  void   ) 
 

int gvar_i_default (  int(*  intgetter)(void)  ) 
 

Default value for integer gvar.

Obj* gvar_l_default (  Obj *(*  objgetter)(void)  ) 
 

Default value for Lisp gvar.

char* gvar_s_default (  char *(*  strgetter)(void)  ) 
 

Default value for string gvar.

char* index_type_name (  int  x  ) 
 

void init_globals (  void   ) 
 

void init_types (  void   ) 
 

short mprop_i_default (  int(*  intgetter)(int)  ) 
 

Default value for integer mprop.

Obj* mprop_l_default (  Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp mprop.

char* mprop_s_default (  char *(*  strgetter)(int)  ) 
 

Default value for string mprop.

void mtype_error (  int  m  ) 
 

int numtypes_from_index_type (  int  x  ) 
 

int table_default (  int(*  getter)(int, int)  ) 
 

Default value for table.

short tprop_i_default (  int(*  intgetter)(int)  ) 
 

Default value for integer tprop.

Obj* tprop_l_default (  Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp tprop.

char* tprop_s_default (  char *(*  strgetter)(int)  ) 
 

Default value for string tprop.

void ttype_error (  int  t  ) 
 

short uprop_i_default (  int(*  intgetter)(int)  ) 
 

Default value for integer uprop.

Obj* uprop_l_default (  Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp uprop.

char* uprop_s_default (  char *(*  strgetter)(int)  ) 
 

Default value for string uprop.

void utype_error (  int  u  ) 
 


Variable Documentation

int any_thickness
 

Atype* atypes
 

Advance type properties.

short* aux_terrain_type_index
 

short canaddatype = TRUE
 

Can add Advance type flag.

short canaddmtype = TRUE
 

Can add Material type flag.

short canaddttype = TRUE
 

Can add Terrain type flag.

short canaddutype = TRUE
 

Can add Unit type flag.

int curmaxatypes = 200
 

int curmaxmtypes = 20
 

int curmaxttypes = 40
 

int curmaxutypes = 100
 

short first_auxt_type
 

Head of aux terrain type list.

short first_bord_type
 

Head of border type list.

short first_conn_type
 

Head of connection type list.

Globals globals
 

Global data variable.

Mtype* mtypes
 

Material type properties.

short* next_auxt_type = NULL
 

Next aux terrain type in list.

short* next_bord_type = NULL
 

Next border type in list.

short* next_conn_type = NULL
 

Next connection type in list.

short numatypes
 

Number of Advance types.

int numauxttypes = 0
 

int numbordtypes = 0
 

Number of border types.

int numcelltypes = 0
 

Number of cell types.

int numcoattypes = 0
 

Number of coating types.

int numconntypes = 0
 

Number of connection types.

short nummtypes
 

Number of Material types.

short numttypes
 

Number of Terrain types.

short numutypes
 

Number of Unit types.

int* tmp_a_array
 

Tempoary Advance type array.

int* tmp_m_array
 

Tempoary Material type array.

int* tmp_t_array
 

Tempoary Terrain type array.

int* tmp_u2_array
 

More utype scratch space.

int* tmp_u_array
 

Tempoary Unit type array.

int** tmp_uu_array
 

Scratch space in the likeness of a TableUU.

Ttype* ttypes
 

Terrain type properties.

Utype* utypes
 

Unit type properties.

VarDefn vardefns[]
 

Array of variable definitions.


Generated on Sat Sep 17 10:29:10 2005 for XconqKernel by doxygen 1.3.6