0.3.1
|
Data Structures | |
struct | bup |
Space required when using BUP functions. More... | |
struct | bup_config |
Storage device connection information. More... | |
union | bup_devices |
BUP device configurations connected when BUP is initialized. More... | |
struct | bup_stat |
Status information. More... | |
struct | bup_date |
Date and time. More... | |
struct | bup_directory |
Directory information. More... | |
struct | bup_devices.__unnamed1__ |
Typedefs | |
typedef struct bup | bup_t |
Space required when using BUP functions. | |
typedef enum bup_device | bup_device_t |
Type of device. | |
typedef struct bup_config | bup_config_t |
Storage device connection information. | |
typedef union bup_devices | bup_devices_t |
BUP device configurations connected when BUP is initialized. | |
typedef enum bup_language | bup_language_t |
Language. | |
typedef enum bup_status | bup_status_t |
Status of BUP functions. | |
typedef enum bup_write_mode | bup_write_mode_t |
Write mode. | |
typedef struct bup_stat | bup_stat_t |
Status information. | |
typedef struct bup_date | bup_date_t |
Date and time. | |
typedef uint32_t | bup_dir_date_t |
BUP date data type. | |
typedef struct bup_directory | bup_directory_t |
Directory information. | |
Enumerations | |
enum | bup_device |
Type of device. More... | |
enum | bup_language |
Language. | |
enum | bup_status |
Status of BUP functions. More... | |
enum | bup_write_mode |
Write mode. More... | |
Functions | |
static bup_status_t | bup_partition_select (bup_device_t device, uint16_t partition) |
Select partition. | |
static bup_status_t | bup_format (bup_device_t device) |
Format. | |
static bup_status_t | bup_status (bup_device_t device, size_t data_size, bup_stat_t *tb) |
Get status. | |
static bup_status_t | bup_write (bup_device_t device, bup_directory_t *tb, const void *data, bup_write_mode_t write_mode) |
Write to the backup device. | |
static bup_status_t | bup_read (bup_device_t device, const char *filename, void *data) |
Read data from the backup device storage. | |
static bup_status_t | bup_delete (bup_device_t device, const char *filename) |
Delete data from the backup device storage. | |
static int32_t | bup_dir (bup_device_t device, const char *filename, uint16_t tb_size, bup_directory_t *tb) |
Get directory information. | |
static bup_status_t | bup_verify (bup_device_t device, const char *filename, const void *data) |
Verify data written to the backup device storage. | |
static void | bup_date_get (bup_dir_date_t date, bup_date_t *tb) |
Expands data and time data in the directory. | |
static bup_dir_date_t | bup_date_set (const bup_date_t *tb) |
Compress date and time data. | |
void | bup_init (bup_t *bup, bup_devices_t *devices) |
Initialize the BUP. | |
Description goes here.
struct bup_config |
Storage device connection information.
Data Fields | ||
---|---|---|
bup_device_t | device | Connected device. If no device is connected, -1 is used. |
uint16_t | partition_count | Number of partitions. |
union bup_devices |
BUP device configurations connected when BUP is initialized.
Data Fields | ||
---|---|---|
struct bup_devices.__unnamed1__ | __unnamed__ | |
bup_config_t | configs[3] | Configurations. |
struct bup_stat |
Status information.
Data Fields | ||
---|---|---|
uint32_t | total_size | Total size in bytes. |
uint32_t | total_blocks | Number of used blocks. |
uint32_t | block_size | Size of one block in bytes. |
uint32_t | free_size | Remaining bytes. |
uint32_t | free_blocks | Number of free blocks. |
uint32_t | data_num | Number of items that can be written. |
struct bup_date |
Date and time.
Data Fields | ||
---|---|---|
uint8_t | year | Year with 1980 subtracted from the year. |
uint8_t | month |
Month in the 1 to 12 range. |
uint8_t | day |
Day in the 1 to 31 range. |
uint8_t | hour |
Hour in the 0 to 23 range. |
uint8_t | minute |
Minute in the 0 to 59 range. |
uint8_t | week |
Day of week, where Sunday is 0 , and Saturday is 6 . |
struct bup_directory |
Directory information.
Data Fields | ||
---|---|---|
char | filename[12] |
File name. 12th byte is \0 . |
char | comment[11] |
comment. 10th byte is \0 . |
bup_language_t | language | Language comment. |
bup_dir_date_t | date | Date and time. |
size_t | data_size | Size in bytes. |
uint16_t | block_size | Size in blocks. |
struct bup_devices.__unnamed1__ |
Data Fields | ||
---|---|---|
bup_config_t | internal | Configuration for the built-in memory. |
bup_config_t | external | Configuration for the cartridge. |
bup_config_t | serial | Configuration for the serial interface. |
typedef struct bup_config bup_config_t |
Storage device connection information.
typedef union bup_devices bup_devices_t |
BUP device configurations connected when BUP is initialized.
typedef enum bup_write_mode bup_write_mode_t |
Write mode.
typedef struct bup_stat bup_stat_t |
Status information.
typedef struct bup_date bup_date_t |
Date and time.
enum bup_device |
enum bup_status |
Status of BUP functions.
enum bup_write_mode |
Write mode.
Enumerator | |
---|---|
BUP_WRITE_MODE_OVERWRITE | Overwrite save even if the filename of the same name exists. |
BUP_WRITE_MODE_PROTECT | Protect save if the filename of the same name exists. |
|
inlinestatic |
Select partition.
device | The device. |
partition | The partition index. |
|
inlinestatic |
Format.
device | The device. |
|
inlinestatic |
Get status.
device | The device. | |
data_size | The size of data to be written in bytes. | |
[out] | tb | The status structure to write to. |
|
inlinestatic |
Write to the backup device.
device | The device. |
tb | The directory structure where bup_directory_t.block_size is written. |
data | The data to write. |
write_mode | The write mode. |
|
inlinestatic |
Read data from the backup device storage.
device | The device. | |
filename | The filename. | |
[out] | data | The data to write to. |
|
inlinestatic |
Delete data from the backup device storage.
device | The device. |
filename | The filename |
|
inlinestatic |
Get directory information.
device | The device. | |
filename | The filename. | |
tb_size | The number of directories. | |
[out] | tb | The directory. |
filename
. Otherwise, a negative value is returned if tb_size
is smaller than the number of matches found. Negating the return value yields the number of directories matched. For example, if -5
is returned, then there are 5
directories.
|
inlinestatic |
Verify data written to the backup device storage.
device | The device. | |
filename | The filename. | |
[in] | data | The data to verify. |
|
inlinestatic |
Expands data and time data in the directory.
date | The data and time data from the directory. | |
[out] | tb | The date. |
|
inlinestatic |
Compress date and time data.
[in] | tb | The date and time table. |
void bup_init | ( | bup_t * | bup, |
bup_devices_t * | devices | ||
) |
Initialize the BUP.
bup_t
is 24,576 bytes. It's advisable to allocate temporary memory.bup | The BUP state. | |
[out] | devices | The device configurations. |