fs.h File Reference


Detailed Description

Definitions for filesystem.

Definition in file fs.h.

#include "race.h"
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  ffblk
 used for saved games More...

Enumerations

enum  {
  FT_DATA = 0,
  FT_SAVE = 1,
  FT_AUDIO,
  FT_VIDEO,
  FT_IMAGE,
  FT_MIDI
}
 types of files - they have different locations in filesystem More...

Functions

int create_save_dir (void)
 Create the savegame directory.
int first_saved_game (struct ffblk *ffblk)
void fix_pathsep (char *path)
 gamedata & savedata access functions
char * locate_file (const char *name, int type)
 Find and open file, if found return full path.
int next_saved_game (struct ffblk *ffblk)
FILE * open_gamedat (const char *name)
FILE * open_savedat (const char *name, const char *mode)
int remove_savedat (const char *name)
char * slurp_gamedat (const char *name)
FILE * sOpen (const char *name, const char *mode, int type)


Enumeration Type Documentation

anonymous enum

types of files - they have different locations in filesystem

Enumerator:
FT_DATA 
FT_SAVE 
FT_AUDIO 
FT_VIDEO 
FT_IMAGE 
FT_MIDI 

Definition at line 12 of file fs.h.


Function Documentation

int create_save_dir ( void   ) 

Create the savegame directory.

The directory will be created as defined in options.dir_savegame.

Note:
The access will be set to 0777 (worldwritable)
Returns:
-1 on error

0 on success

Definition at line 367 of file fs.c.

References game_options::dir_savegame, options, and WARNING3.

int first_saved_game ( struct ffblk ffblk  ) 

Definition at line 378 of file fs.c.

References game_options::dir_savegame, next_saved_game(), options, and save_dir.

void fix_pathsep ( char *  path  ) 

gamedata & savedata access functions

Definition at line 94 of file fs.c.

References PATHSEP.

char* locate_file ( const char *  name,
int  type 
)

Find and open file, if found return full path.

Caller is responsible for freeing the memory.

Definition at line 290 of file fs.c.

References file::handle, INFO2, file::path, and try_find_file().

int next_saved_game ( struct ffblk ffblk  ) 

Definition at line 393 of file fs.c.

References NAMLEN, save_dir, and xstrncasecmp().

FILE* open_gamedat ( const char *  name  ) 

Definition at line 321 of file fs.c.

References FT_DATA, and sOpen().

FILE* open_savedat ( const char *  name,
const char *  mode 
)

Definition at line 327 of file fs.c.

References FT_SAVE, and sOpen().

int remove_savedat ( const char *  name  ) 

Definition at line 302 of file fs.c.

References game_options::dir_savegame, fix_pathsep(), INFO2, options, WARNING3, and xmalloc().

char* slurp_gamedat ( const char *  name  ) 

Definition at line 333 of file fs.c.

References CRITICAL2, fread_dyn(), and open_gamedat().

FILE* sOpen ( const char *  name,
const char *  mode,
int  type 
)

Definition at line 275 of file fs.c.

References file::handle, INFO3, file::path, and try_find_file().


Generated on Fri Sep 28 00:35:46 2007 for raceintospace by  doxygen 1.5.3