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

read.c File Reference

#include "conq.h"
#include "kernel.h"
#include "imf.h"
#include "keyword.def"

Include dependency graph for read.c:

Include dependency graph

Classes

struct  a_key

Defines

#define DEF_KWD(NAME, CODE)   { NAME, CODE },
#define TYPEPROP(TYPES, N, DEFNS, I, TYPE)   ((TYPE *) &(((char *) (&(TYPES[N])))[DEFNS[I].offset]))[0]
#define SYNTAX(X, TEST, MSG)
#define SYNTAX_RETURN(X, TEST, MSG, RET)
#define TYPECHECK(PRED, X, MSG)
#define TYPECHECK_RETURN(PRED, X, MSG, RET)
#define PARSE_PROPERTY(BDG, NAME, VAL)
#define PARSE_PROPERTY_RETURN(BDG, NAME, VAL, RET)
#define INDEXP(typ, x)   ((typ == UTYP) ? utypep(x) : ((typ == MTYP) ? mtypep(x) : ((typ == TTYP) ? ttypep(x) : atypep(x))))
#define nonlist(x)   (!consp(x) && x != lispnil)
#define CHECK_INDEX_1(tbl, x)
#define CHECK_INDEX_2(tbl, x)
#define CHECK_VALUE(tbl, x)
#define CHECK_LISTS(tablename, lis1, lis2)
#define CHECK_PERMISSION

Functions

int keyword_code (char *str)
char * keyword_name (enum keywords k)
void syntax_error (Obj *x, char *msg)
void type_error (Obj *x, char *msg)
void init_predefined_symbols (void)
void interp_form (Module *module, Obj *form)
void interp_game_module (Obj *form, Module *module)
void fill_in_side (Side *side, Obj *props, int userdata)
int utype_from_name (char *str)
int mtype_from_name (char *str)
int atype_from_name (char *str)
int ttype_from_name (char *str)
int utype_from_symbol (Obj *sym)
void read_warning (char *str,...)
int lookup_task_type (char *name)

Variables

int actually_read_lisp
int nextsideid
int force_all_variants = FALSE
Modulecurmodule
Objcond_read_stack
int midturnrestore = FALSE
int numbadterrain = 0
int warnbadterrain = TRUE
char * readerrbuf
Objside_defaults
int uxoffset = 0 uyoffset = 0
Objunit_specs
Objlast_unit_spec
Objdefault_unit_spec
short layer_use_default
int layer_default
int layer_multiplier
int layer_adder
short layer_area_x
short layer_area_y
short layer_area_w
short layer_area_h
int ignore_specials
a_key keywordtable []

Define Documentation

#define CHECK_INDEX_1 tbl,
 ) 
 

Value:

if (!INDEXP(tabledefns[tbl].index1, (x))) {  \
      char errbuf[BUFSIZE]; \
      sprintlisp(errbuf, (x), BUFSIZE); \
      read_warning("table %s index 1 value `%s' has wrong type, skipping clause",  \
                   tabledefns[tbl].name, errbuf);  \
      return;  \
  }

#define CHECK_INDEX_2 tbl,
 ) 
 

Value:

if (!INDEXP(tabledefns[tbl].index2, (x))) {  \
      char errbuf[BUFSIZE]; \
      sprintlisp(errbuf, (x), BUFSIZE); \
      read_warning("table %s index 2 value `%s' has wrong type, skipping clause",  \
                   tabledefns[tbl].name, errbuf);  \
      return;  \
  }

#define CHECK_LISTS tablename,
lis1,
lis2   ) 
 

Value:

if (consp(lis2)  \
      && !list_lengths_match(lis1, lis2, "table", tablename))  {  \
      return;  \
  }

#define CHECK_PERMISSION
 

Value:

if (userdata) {  \
                permission = FALSE;  \
                break;  \
            }

#define CHECK_VALUE tbl,
 ) 
 

Value:

if (!numberishp(x)) {  \
      read_warning("table %s value is not a number, skipping clause",  \
                   tabledefns[tbl].name);  \
      return;  \
  } \
  { int checknum = c_number(x);  \
    if (!between(tabledefns[tbl].lo, checknum, tabledefns[tbl].hi)) {  \
        read_warning("table %s value %d not within bounds %d to %d, skipping clause",  \
                     tabledefns[tbl].name, checknum, tabledefns[tbl].lo, tabledefns[tbl].hi);  \
        return;  \
    }  \
  }

#define DEF_KWD NAME,
CODE   )     { NAME, CODE },
 

#define INDEXP typ,
 )     ((typ == UTYP) ? utypep(x) : ((typ == MTYP) ? mtypep(x) : ((typ == TTYP) ? ttypep(x) : atypep(x))))
 

#define nonlist  )     (!consp(x) && x != lispnil)
 

#define PARSE_PROPERTY BDG,
NAME,
VAL   ) 
 

Value:

SYNTAX(BDG, (consp(BDG) && symbolp(car(BDG))), "property binding");  \
  (NAME) = c_string(car(BDG));  \
  (VAL) = cadr(BDG);

#define PARSE_PROPERTY_RETURN BDG,
NAME,
VAL,
RET   ) 
 

Value:

SYNTAX_RETURN(BDG, (consp(BDG) && symbolp(car(BDG))), "property binding", (RET));  \
  (NAME) = c_string(car(BDG));  \
  (VAL) = cadr(BDG);

#define SYNTAX X,
TEST,
MSG   ) 
 

Value:

if (!(TEST)) {  \
      syntax_error((X), (MSG));  \
      return;  \
  }

#define SYNTAX_RETURN X,
TEST,
MSG,
RET   ) 
 

Value:

if (!(TEST)) {  \
      syntax_error((X), (MSG));  \
      return (RET);  \
  }

#define TYPECHECK PRED,
X,
MSG   ) 
 

Value:

if (!PRED(X)) {  \
      type_error((X), (MSG));  \
      return;  \
  }

#define TYPECHECK_RETURN PRED,
X,
MSG,
RET   ) 
 

Value:

if (!PRED(X)) {  \
      type_error((X), (MSG));  \
      return (RET);  \
  }

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


Function Documentation

int atype_from_name char *  str  ) 
 

void fill_in_side Side side,
Obj props,
int  userdata
 

void init_predefined_symbols void   ) 
 

void interp_form Module module,
Obj form
 

void interp_game_module Obj form,
Module module
 

int keyword_code char *  str  ) 
 

char* keyword_name enum keywords  k  ) 
 

int lookup_task_type char *  name  ) 
 

int mtype_from_name char *  str  ) 
 

void read_warning char *  str,
... 
 

void syntax_error Obj x,
char *  msg
 

int ttype_from_name char *  str  ) 
 

void type_error Obj x,
char *  msg
 

int utype_from_name char *  str  ) 
 

int utype_from_symbol Obj sym  ) 
 


Variable Documentation

int actually_read_lisp
 

Obj* cond_read_stack
 

Module* curmodule
 

Obj* default_unit_spec
 

int force_all_variants = FALSE
 

int ignore_specials
 

struct a_key keywordtable[]
 

Obj* last_unit_spec
 

int layer_adder
 

short layer_area_h
 

short layer_area_w
 

short layer_area_x
 

short layer_area_y
 

int layer_default
 

int layer_multiplier
 

short layer_use_default
 

int midturnrestore = FALSE
 

Mid turn restore flag. ???

int nextsideid
 

int numbadterrain = 0
 

char* readerrbuf
 

Obj* side_defaults
 

Obj* unit_specs
 

int uxoffset = 0 uyoffset = 0
 

int warnbadterrain = TRUE
 


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