loadsave.c: add Open_file_write/Open_file_read() functions
This commit is contained in:
parent
bbdee15990
commit
3ed5dc5786
@ -1749,3 +1749,23 @@ void Delete_safety_backups(void)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/// For use by Save_XXX() functions
|
||||
FILE * Open_file_write(T_IO_Context *context)
|
||||
{
|
||||
char filename[MAX_PATH_CHARACTERS]; // filename with full path
|
||||
|
||||
Get_full_filename(filename, context->File_name, context->File_directory);
|
||||
|
||||
return fopen(filename, "wb");
|
||||
}
|
||||
|
||||
/// For use by Load_XXX() and Test_XXX() functions
|
||||
FILE * Open_file_read(T_IO_Context *context)
|
||||
{
|
||||
char filename[MAX_PATH_CHARACTERS]; // filename with full path
|
||||
|
||||
Get_full_filename(filename, context->File_name, context->File_directory);
|
||||
|
||||
return fopen(filename, "rb");
|
||||
}
|
||||
|
||||
@ -261,4 +261,10 @@ void Init_preview(short width,short height,long size,int format,enum PIXEL_RATIO
|
||||
*/
|
||||
void Write_one_byte(FILE *file, byte b);
|
||||
|
||||
/// For use by Save_XXX() functions
|
||||
FILE * Open_file_write(T_IO_Context *context);
|
||||
|
||||
/// For use by Load_XXX() and Test_XXX() functions
|
||||
FILE * Open_file_read(T_IO_Context *context);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user