00001 #ifndef HEADER_GAMEIOMANAGER
00002 #define HEADER_GAMEIOMANAGER
00003
00009 #include <malloc.h>
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <string.h>
00013 #include <limits.h>
00014 #include <assert.h>
00015 #include <math.h>
00016 #include <time.h>
00017 #include <stdbool.h>
00018 #include "define.h"
00019 #include "schemaGameUtility.h"
00020
00021
00022
00024 struct gameRecordValues
00025 {
00027 char name[MAX_RECORDNAME_LEN + 1];
00028
00030 unsigned int points;
00031
00033 unsigned int level;
00034 }
00035 gameRecord[MAX_RECORD_SHOW];
00036
00037
00038
00039
00040
00041
00057 char **readfile( char namefile[],
00058 bool *schema_ok,
00059 unsigned int *mapCurrentRow,
00060 unsigned int *mapCurrentCol,
00061 unsigned int mapMaxRow,
00062 unsigned int mapMaxCol,
00063 bool differentColLen
00065 );
00066
00067
00072 char **allocResetVariable( unsigned int mapMaxRow,
00073 unsigned int mapMaxCol
00074 );
00075
00076
00080 void skipCharacters(char *fileChar,
00081 int *checkchar,
00083 FILE *file2read
00084 );
00085
00090 bool readCharacters(unsigned int *mapCurrentCol,
00091 unsigned int mapMaxCol,
00092 const unsigned int *mapCurrentRow,
00093 unsigned int mapMaxRow,
00094 char ** contentFile,
00095 FILE *file2read
00097 );
00098
00099
00103 bool checkDifferentColLen( const unsigned int *mapCurrentRow,
00105 const unsigned int *mapCurrentCol,
00107 unsigned int *checkCol
00109 );
00110
00111
00118 bool setGameRecordStructValue( char **filecontent,
00120 unsigned int numrow,
00121 unsigned int numcol
00122 );
00123
00130 bool readSetGameRecord( unsigned int *readrows
00131 );
00132
00138 void save_record( const char *name,
00139 unsigned int totalpoints,
00140 unsigned int currentlevel
00141 );
00142
00150 void printschema();
00151
00152
00153
00154 #endif