00001
00002 #ifndef __READINIT_H__
00003 #define __READINIT_H__
00004
00005 #include "ReVolt.h"
00006 #include "model.h"
00007 #include "particle.h"
00008 #include "newcoll.h"
00009 #include "body.h"
00010 #include "wheel.h"
00011 #include "aerial.h"
00012 #include "car.h"
00013
00015
00016
00017
00019
00020 #define READ_MAX_WORDLEN 256
00021 #define READ_COMMENT_CHAR ';'
00022
00023 static bool ReadWord(char *buf, FILE *fp);
00024 static bool ReadFileName(char *name, FILE *fp);
00025 static bool ReadInt(int *n, FILE *fp);
00026 static bool ReadBool(bool *b, FILE *fp);
00027 static bool ReadReal(REAL *real, FILE *fp);
00028 static bool ReadVec(VEC *vec, FILE *fp);
00029 static bool ReadMat(MAT *mat, FILE *fp);
00030 static int ReadNumberList(int *numList, int maxNum, FILE *fp);
00031
00032 static bool Compare(char *word, char *token);
00033
00034 static void SetCarDefaults(CAR *car);
00035 static bool ReadCarInfo(FILE *fp);
00036 static bool ReadWheelInfo(FILE *fp);
00037 static bool ReadBodyInfo(FILE *fp);
00038 static bool ReadAerialInfo(FILE *fp);
00039 static bool ReadSpringInfo(FILE *fp);
00040 static bool ReadAxleInfo(FILE *fp);
00041 static bool ReadSpinnerInfo(FILE *fp);
00042 static bool ReadPinInfo(FILE *fp);
00043 static int UnknownWordMessage(char *word);
00044 static void InvalidVariable(char *object);
00045 static void ShowErrorMessage(char *word);
00046 static void InvalidNumberList(char *object);
00047
00048 extern bool ReadAllCarInfo(char *fileName);
00049
00050
00051 #endif