![]() |
Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Jo Engine saving features function prototypes. More...
Go to the source code of this file.
Data Structures | |
| struct | jo_backup |
| Backup File struct. More... | |
Macros | |
| #define | JO_BACKUP_MAX_FILENAME_LENGTH |
| Max backup filename length. More... | |
| #define | JO_BACKUP_MAX_FILE |
| Max backup file in device. More... | |
| #define | JO_BACKUP_MAX_COMMENT_LENGTH |
| Max backup file comment length. More... | |
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_read_device (const jo_backup_device backup_device, jo_list *const filenames) |
| Read backup device. 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... | |
| void | jo_backup_init_file (jo_backup *file) |
| Initialize a backup file in order to save it. More... | |
| bool | jo_backup_save (jo_backup *file) |
| Save file contents to the backup device (if the file exists it will be overwritten) More... | |
| static __jo_force_inline bool | jo_backup_save_file_contents (const jo_backup_device backup_device, char *const fname, char *const comment, void *contents, unsigned int 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... | |
| bool | jo_backup_get_file_size (const jo_backup_device backup_device, const char *const fname, unsigned int *const num_bytes, unsigned int *const num_blocks) |
| Get file size in bytes and blocks. More... | |
| bool | jo_backup_get_file_info (const jo_backup_device backup_device, const char *const fname, char *const comment, unsigned char *const language_num, unsigned int *const date, unsigned int *const num_bytes, unsigned int *const num_blocks) |
| Get file comment, language, date, and size in bytes and blocks. More... | |
| unsigned char * | jo_backup_load_file_comment (const jo_backup_device backup_device, const char *const fname) |
| Load file comment from 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... | |
| unsigned short | jo_backup_get_file_partition (const jo_backup_device backup_device, const char *const fname) |
| Get the partition number where the file is located. More... | |
| int | jo_backup_get_free_block_count (const jo_backup_device backup_device) |
| Get free block count on the backup device. More... | |
| int | jo_backup_get_total_block_count (const jo_backup_device backup_device) |
| Get total 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... | |
| struct jo_backup |
Backup File struct.
| Data Fields | ||
|---|---|---|
| jo_backup_device | backup_device | |
| char * | comment | |
| unsigned int | content_size | |
| void * | contents | |
| char * | fname | |
| jo_language | language | |
| unsigned char | language_num | |
| unsigned short | partition_number | |
| jo_datetime | save_datetime | |
| unsigned int | save_timestamp | |
| #define JO_BACKUP_MAX_COMMENT_LENGTH |
Max backup file comment length.
| #define JO_BACKUP_MAX_FILE |
Max backup file in device.
| #define JO_BACKUP_MAX_FILENAME_LENGTH |
Max backup filename length.
| enum jo_backup_device |
| enum jo_backup_status |
| bool jo_backup_delete_file | ( | const jo_backup_device | backup_device, |
| const char *const | fname | ||
| ) |
Delete file on the backup device.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| bool jo_backup_file_exists | ( | const jo_backup_device | backup_device, |
| const char *const | fname | ||
| ) |
Check if file exists.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| bool jo_backup_format_device | ( | const jo_backup_device | backup_device | ) |
Format the device (all data is lost)
| backup_device | Backup device |
| bool jo_backup_get_file_info | ( | const jo_backup_device | backup_device, |
| const char *const | fname, | ||
| char *const | comment, | ||
| unsigned char *const | language_num, | ||
| unsigned int *const | date, | ||
| unsigned int *const | num_bytes, | ||
| unsigned int *const | num_blocks | ||
| ) |
Get file comment, language, date, and size in bytes and blocks.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| comment | Output comment (min 11 characters space) |
| language_num | Output language in native format |
| date | Output date in native format |
| num_bytes | Output file size in bytes |
| num_blocks | Output file size in blocks |
| 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.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| datetime | Output date and time (not NULL) |
| unsigned short jo_backup_get_file_partition | ( | const jo_backup_device | backup_device, |
| const char *const | fname | ||
| ) |
Get the partition number where the file is located.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| bool jo_backup_get_file_size | ( | const jo_backup_device | backup_device, |
| const char *const | fname, | ||
| unsigned int *const | num_bytes, | ||
| unsigned int *const | num_blocks | ||
| ) |
Get file size in bytes and blocks.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| num_bytes | Output file size in bytes |
| num_blocks | Output file size in blocks |
| int jo_backup_get_free_block_count | ( | const jo_backup_device | backup_device | ) |
Get free block count on the backup device.
| backup_device | Backup device |
| jo_backup_status jo_backup_get_last_status | ( | const jo_backup_device | backup_device | ) |
Get last backup status (error details)
| backup_device | Backup device |
| int jo_backup_get_total_block_count | ( | const jo_backup_device | backup_device | ) |
Get total block count on the backup device.
| backup_device | Backup device |
| void jo_backup_init_file | ( | jo_backup * | file | ) |
Initialize a backup file in order to save it.
| file | Backup file to initialize |
| unsigned char* jo_backup_load_file_comment | ( | const jo_backup_device | backup_device, |
| const char *const | fname | ||
| ) |
Load file comment from the backup device.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| 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.
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| length | File length (optional, pass JO_NULL to ignore) |
| bool jo_backup_mount | ( | const jo_backup_device | backup_device | ) |
Mount the backup device (must be the first call)
| backup_device | Backup device |
| bool jo_backup_read_device | ( | const jo_backup_device | backup_device, |
| jo_list *const | filenames | ||
| ) |
Read backup device.
| backup_device | Backup device |
| filenames | Output filenames. the list must be initialized (jo_list_init) |
| bool jo_backup_save | ( | jo_backup * | file | ) |
Save file contents to the backup device (if the file exists it will be overwritten)
| file | Backup file to save |
|
static |
Save file contents to the backup device (if the file exists it will be overwritten)
| backup_device | Backup device |
| fname | File name (max 11 characters not NULL) |
| comment | Comment (max 10 characters not NULL) |
| contents | Data (not NULL or empty) |
| content_size | Data size |
| bool jo_backup_unmount | ( | const jo_backup_device | backup_device | ) |
Unmount the backup device (optional)
| backup_device | Backup device |
1.8.18