Jo Engine  9
Jo Sega Saturn Engine
backup.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2017, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
36 #ifndef __JO_BACKUP_H__
37 # define __JO_BACKUP_H__
38 
39 # ifdef JO_COMPILE_WITH_BACKUP_SUPPORT
40 
44 typedef enum
45 {
50 
52 typedef enum
53 {
62 
67 bool jo_backup_mount(const jo_backup_device backup_device);
68 
73 bool jo_backup_unmount(const jo_backup_device backup_device);
74 
80 bool jo_backup_file_exists(const jo_backup_device backup_device, const char * const fname);
81 
86 bool jo_backup_format_device(const jo_backup_device backup_device);
87 
96 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);
97 
103 bool jo_backup_delete_file(const jo_backup_device backup_device, const char * const fname);
104 
111 bool jo_backup_get_file_last_modified_date(const jo_backup_device backup_device, const char * const fname, jo_datetime *datetime);
112 
119 void *jo_backup_load_file_contents(const jo_backup_device backup_device, const char * const fname, unsigned int *length);
120 
125 int jo_backup_get_free_block_count(const jo_backup_device backup_device);
126 
132 
133 #endif /* !JO_COMPILE_WITH_BACKUP_SUPPORT */
134 
135 #endif /* !__JO_BACKUP_H__ */
136 
137 /*
138 ** END OF FILE
139 */
Definition: backup.h:58
Definition: backup.h:60
Definition: backup.h:56
bool jo_backup_delete_file(const jo_backup_device backup_device, const char *const fname)
Delete file on the backup device.
Definition: backup.h:46
int jo_backup_get_free_block_count(const jo_backup_device backup_device)
Get free block count on the backup device.
bool jo_backup_mount(const jo_backup_device backup_device)
Mount the backup device (must be the first call)
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.
Definition: backup.h:59
Definition: backup.h:48
Definition: backup.h:55
DateTime struct.
Definition: tools.h:176
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) ...
jo_backup_device
Backup device type.
Definition: backup.h:44
bool jo_backup_file_exists(const jo_backup_device backup_device, const char *const fname)
Check if file exists.
Definition: backup.h:47
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.
Definition: backup.h:54
bool jo_backup_format_device(const jo_backup_device backup_device)
Format the device (all data is lost)
Definition: backup.h:57
jo_backup_status jo_backup_get_last_status(const jo_backup_device backup_device)
Get last backup status (error details)
jo_backup_status
Backup status.
Definition: backup.h:52
bool jo_backup_unmount(const jo_backup_device backup_device)
Unmount the backup device (optional)