36#ifndef __JO_BACKUP_H__
37# define __JO_BACKUP_H__
39# ifdef JO_COMPILE_WITH_BACKUP_SUPPORT
42# define JO_BACKUP_MAX_FILENAME_LENGTH (12)
45# define JO_BACKUP_MAX_FILE (255)
48# define JO_BACKUP_MAX_COMMENT_LENGTH (10)
146 void *contents,
unsigned int content_size)
193bool 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);
jo_backup_status
Backup status.
Definition backup.h:62
@ JoBackupStatusOk
Definition backup.h:63
@ JoBackupStatusNoMatch
Definition backup.h:67
@ JoBackupStatusOutOfMemory
Definition backup.h:65
@ JoBackupStatusBroken
Definition backup.h:68
@ JoBackupStatusWriteProtect
Definition backup.h:64
@ JoBackupStatusNotFound
Definition backup.h:66
@ JoBackupStatusUnknown
Definition backup.h:69
bool jo_backup_mount(const jo_backup_device backup_device)
Mount the backup device (must be the first call).
bool jo_backup_format_device(const jo_backup_device backup_device)
Format the device (all data is lost).
bool jo_backup_file_exists(const jo_backup_device backup_device, const char *const fname)
Check if file exists.
jo_datetime save_datetime
Definition backup.h:91
unsigned char language_num
Definition backup.h:87
unsigned int save_timestamp
Definition backup.h:89
jo_backup_status jo_backup_get_last_status(const jo_backup_device backup_device)
Get last backup status (error details).
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).
Definition backup.h:145
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.
jo_backup_device
Backup device type.
Definition backup.h:54
@ JoInternalMemoryBackup
Definition backup.h:55
@ JoCartridgeMemoryBackup
Definition backup.h:56
@ JoExternalDeviceBackup
Definition backup.h:57
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.
int jo_backup_get_total_block_count(const jo_backup_device backup_device)
Get total block count on the backup device.
unsigned int content_size
Definition backup.h:79
bool jo_backup_save(jo_backup *file)
Save file contents to the backup device (if the file exists it will be overwritten).
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.
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.
char * comment
Definition backup.h:77
void jo_backup_init_file(jo_backup *file)
Initialize a backup file in order to save it.
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.
unsigned short partition_number
Definition backup.h:83
bool jo_backup_read_device(const jo_backup_device backup_device, jo_list *const filenames)
Read backup device.
jo_language language
Definition backup.h:85
int jo_backup_get_free_block_count(const jo_backup_device backup_device)
Get free block count on the backup device.
unsigned char * jo_backup_load_file_comment(const jo_backup_device backup_device, const char *const fname)
Load file comment from the backup device.
bool jo_backup_delete_file(const jo_backup_device backup_device, const char *const fname)
Delete file on the backup device.
void * contents
Definition backup.h:78
jo_backup_device backup_device
Definition backup.h:75
char * fname
Definition backup.h:76
bool jo_backup_unmount(const jo_backup_device backup_device)
Unmount the backup device (optional).
Backup File struct.
Definition backup.h:74
List struct.
Definition list.h:74
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39