1 --- src/hof.c 2009-05-14 21:40:42.000000000 +0200
2 +++ src/hof.c 2011-02-06 17:42:24.003334039 +0100
4 #define chCursor '_' /* Cursor ON */
5 #define chSpace ' ' /* Cursor OFF*/
7 -#define csHOFName "hof.bnx2" /* File name */
8 +#define csHOFName "/.biniax2.halloffame" /* File name */
9 #define cHOFFileSize 504 /* File size */
16 +static char *hofGetFilename() {
17 + char *homeDir, *fullPath;
19 + homeDir = strdup(getenv("HOME"));
20 + fullPath = malloc(strlen(homeDir) + strlen(csHOFName) + 1);
21 + strcpy(fullPath, homeDir);
22 + strcat(fullPath, csHOFName);
34 for ( i = 0; i < cHofEntries; ++i )
36 Hof.tactic[ i ].score = (cHofEntries - i) * cHofInitScore;
39 - if ( sysGetFileLen( sysGetFullFileName( csHOFName ) ) != cHOFFileSize )
40 + fileName = hofGetFilename();
41 + if ( sysGetFileLen( sysGetFullFileName( fileName ) ) != cHOFFileSize ) {
44 - file = fopen( sysGetFullFileName( csHOFName ), "rb" );
46 + file = fopen( sysGetFullFileName( fileName ), "rb" );
48 if ( file == (FILE *) NULL )
57 - file = fopen( sysGetFullFileName( csHOFName ), "wb" );
58 + fileName = hofGetFilename();
59 + file = fopen( sysGetFullFileName( fileName ), "wb" );
62 if ( file == (FILE *) NULL )
67 return (BNX_HALL *) &Hof;
69 \ No newline at end of file