List the contents of a backup file.
void mco_backup_list(
/*IN*/ mco_db_h con,
/*IN*/ const char *file_name,
/*OUT*/ mco_size_t *backup_list_size,
/*OUT*/ mco_backup_info_t **backup_list,
/*IN*/ char *err_buf,
/*IN-OUT*/ unsigned int *err_buf_sz
);
con
file_name
backup_list_size
backup_list
mco_backup_info_t descriptors. The memory is allocated internally
and must be freed by the caller using mco_sys_free().err_buf
NULL if error details are not needed).err_buf_sz
err_buf. On output: number of characters written. If NULL, the function returns
MCO_E_ILLEGAL_PARAM.This function reads the specified backup file and returns a list of all backup records it contains. Each record includes metadata s uch as
name,type,label, timestamp, and size.The returned array must be explicitly deallocated using
mco_sys_free()to avoid memory leaks.See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_DISK_OPEN
{
const char *db_name = "myDb";
mco_db_h con;
MCO_RET rc;
char *filename = "backup.bak";
char *label = "a label";
/* connect to a database */
rc = mco_db_connect(db_name, &con);
/* list backup records */
mco_size_t size = 0;
mco_backup_info_t *list = NULL;
rc = mco_backup_list(con, filename, &size, &list, NULL, NULL);
}