Jo Engine  9
Jo Sega Saturn Engine
Enumerations | Functions
backup.h File Reference

Jo Engine saving features function prototypes. More...

Go to the source code of this file.

Enumerations

enum  jo_backup_device { JoInternalMemoryBackup, JoCartridgeMemoryBackup, JoExternalDeviceBackup }
 Backup device type. More...
 
enum  jo_backup_status {
  JoBackupStatusOk, JoBackupStatusWriteProtect, JoBackupStatusOutOfMemory, JoBackupStatusNotFound,
  JoBackupStatusNoMatch, JoBackupStatusBroken, JoBackupStatusUnknown
}
 Backup status. More...
 

Functions

bool jo_backup_mount (const jo_backup_device backup_device)
 Mount the backup device (must be the first call) More...
 
bool jo_backup_unmount (const jo_backup_device backup_device)
 Unmount the backup device (optional) More...
 
bool jo_backup_file_exists (const jo_backup_device backup_device, const char *const fname)
 Check if file exists. More...
 
bool jo_backup_format_device (const jo_backup_device backup_device)
 Format the device (all data is lost) More...
 
bool jo_backup_save_file_contents (const jo_backup_device backup_device, const char *const fname, const char *const comment, void *contents, unsigned short content_size)
 Save file contents to the backup device (if the file exists it will be overwritten) More...
 
bool jo_backup_delete_file (const jo_backup_device backup_device, const char *const fname)
 Delete file on the backup device. More...
 
bool jo_backup_get_file_last_modified_date (const jo_backup_device backup_device, const char *const fname, jo_datetime *datetime)
 Get file last modified date on the backup device. More...
 
void * jo_backup_load_file_contents (const jo_backup_device backup_device, const char *const fname, unsigned int *length)
 Load file contents from the backup device. More...
 
int jo_backup_get_free_block_count (const jo_backup_device backup_device)
 Get free block count on the backup device. More...
 
jo_backup_status jo_backup_get_last_status (const jo_backup_device backup_device)
 Get last backup status (error details) More...
 

Detailed Description

Jo Engine saving features function prototypes.

Author
Johannes Fetz
Todo:
List directory
Bug:
No known bugs.

Enumeration Type Documentation

Backup device type.

Warning
If you change these values, the program will crash
Enumerator
JoInternalMemoryBackup 
JoCartridgeMemoryBackup 
JoExternalDeviceBackup 

Backup status.

Enumerator
JoBackupStatusOk 
JoBackupStatusWriteProtect 
JoBackupStatusOutOfMemory 
JoBackupStatusNotFound 
JoBackupStatusNoMatch 
JoBackupStatusBroken 
JoBackupStatusUnknown 

Function Documentation

bool jo_backup_delete_file ( const jo_backup_device  backup_device,
const char *const  fname 
)

Delete file on the backup device.

Parameters
backup_deviceBackup device
fnameFile name (max 11 characters not NULL)
Returns
true if succeed
bool jo_backup_file_exists ( const jo_backup_device  backup_device,
const char *const  fname 
)

Check if file exists.

Parameters
backup_deviceBackup device
fnameFile name (max 11 characters not NULL)
Returns
true if the file exists
bool jo_backup_format_device ( const jo_backup_device  backup_device)

Format the device (all data is lost)

Parameters
backup_deviceBackup device
Returns
true if succeed
bool jo_backup_get_file_last_modified_date ( const jo_backup_device  backup_device,
const char *const  fname,
jo_datetime datetime 
)

Get file last modified date on the backup device.

Parameters
backup_deviceBackup device
fnameFile name (max 11 characters not NULL)
datetimeOutput date and time (not NULL)
Returns
true if succeed
int jo_backup_get_free_block_count ( const jo_backup_device  backup_device)

Get free block count on the backup device.

Parameters
backup_deviceBackup device
Returns
Free block count
jo_backup_status jo_backup_get_last_status ( const jo_backup_device  backup_device)

Get last backup status (error details)

Parameters
backup_deviceBackup device
Returns
Backup status
void* jo_backup_load_file_contents ( const jo_backup_device  backup_device,
const char *const  fname,
unsigned int *  length 
)

Load file contents from the backup device.

Parameters
backup_deviceBackup device
fnameFile name (max 11 characters not NULL)
lengthFile length (optional, pass JO_NULL to ignore)
Returns
File contents
bool jo_backup_mount ( const jo_backup_device  backup_device)

Mount the backup device (must be the first call)

Parameters
backup_deviceBackup device
Returns
true if succeed
bool jo_backup_save_file_contents ( const jo_backup_device  backup_device,
const char *const  fname,
const char *const  comment,
void *  contents,
unsigned short  content_size 
)

Save file contents to the backup device (if the file exists it will be overwritten)

Parameters
backup_deviceBackup device
fnameFile name (max 11 characters not NULL)
commentComment (max 10 characters not NULL)
contentsData (not NULL or empty)
content_sizeData size
Returns
true if succeed
bool jo_backup_unmount ( const jo_backup_device  backup_device)

Unmount the backup device (optional)

Parameters
backup_deviceBackup device
Returns
true if succeed