(archive_file) Cleanups

This commit is contained in:
twinaphex 2017-04-21 20:46:41 +02:00
parent 5b1ecbff87
commit 0c66441d08

View File

@ -56,6 +56,20 @@ struct file_archive_file_data
size_t size;
};
static size_t file_archive_size(file_archive_file_data_t *data)
{
if (!data)
return 0;
return data->size;
}
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
{
if (!data)
return NULL;
return (const uint8_t*)data->data;
}
#ifdef HAVE_MMAP
/* Closes, unmaps and frees. */
static void file_archive_free(file_archive_file_data_t *data)
@ -70,20 +84,6 @@ static void file_archive_free(file_archive_file_data_t *data)
free(data);
}
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
{
if (!data)
return NULL;
return (const uint8_t*)data->data;
}
static size_t file_archive_size(file_archive_file_data_t *data)
{
if (!data)
return 0;
return data->size;
}
static file_archive_file_data_t* file_archive_open(const char *path)
{
file_archive_file_data_t *data = (file_archive_file_data_t*)calloc(1, sizeof(*data));
@ -128,20 +128,6 @@ static void file_archive_free(file_archive_file_data_t *data)
free(data);
}
static const uint8_t *file_archive_data(file_archive_file_data_t *data)
{
if (!data)
return NULL;
return (const uint8_t*)data->data;
}
static size_t file_archive_size(file_archive_file_data_t *data)
{
if (!data)
return 0;
return data->size;
}
static file_archive_file_data_t* file_archive_open(const char *path)
{
ssize_t ret = -1;