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) |
anonymous enum |
int create_save_dir | ( | void | ) |
Create the savegame directory.
The directory will be created as defined in options.dir_savegame.
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 | ) |
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 | ) |
FILE* open_gamedat | ( | const char * | name | ) |
FILE* open_savedat | ( | const char * | name, | |
const char * | mode | |||
) |
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 | ) |
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().