RetroArch
Classes | Functions
archive_file.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <compat/strl.h>
#include <file/archive_file.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <retro_miscellaneous.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
Include dependency graph for archive_file.c:
This graph shows which files directly or indirectly include this file:

Classes

struct  file_archive_file_data
 

Functions

static size_t file_archive_size (file_archive_file_data_t *data)
 
static const uint8_tfile_archive_data (file_archive_file_data_t *data)
 
static void file_archive_free (file_archive_file_data_t *data)
 
static file_archive_file_data_tfile_archive_open (const char *path)
 
static int file_archive_get_file_list_cb (const char *path, const char *valid_exts, const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size, uint32_t checksum, struct archive_extract_userdata *userdata)
 
static int file_archive_extract_cb (const char *name, const char *valid_exts, const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size, uint32_t checksum, struct archive_extract_userdata *userdata)
 
static int file_archive_parse_file_init (file_archive_transfer_t *state, const char *file)
 
static int file_archive_decompress_data_to_file (file_archive_file_handle_t *handle, int ret, const char *path, const char *valid_exts, const uint8_t *cdata, uint32_t csize, uint32_t size, uint32_t checksum)
 
void file_archive_parse_file_iterate_stop (file_archive_transfer_t *state)
 
int file_archive_parse_file_iterate (file_archive_transfer_t *state, bool *returnerr, const char *file, const char *valid_exts, file_archive_file_cb file_cb, struct archive_extract_userdata *userdata)
 
static bool file_archive_walk (const char *file, const char *valid_exts, file_archive_file_cb file_cb, struct archive_extract_userdata *userdata)
 
int file_archive_parse_file_progress (file_archive_transfer_t *state)
 
bool file_archive_extract_file (char *archive_path, size_t archive_path_size, const char *valid_exts, const char *extraction_directory, char *out_path, size_t len)
 
struct string_listfile_archive_get_file_list (const char *path, const char *valid_exts)
 
bool file_archive_perform_mode (const char *path, const char *valid_exts, const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size, uint32_t crc32, struct archive_extract_userdata *userdata)
 
static struct string_listfile_archive_filename_split (const char *path)
 
int file_archive_compressed_read (const char *path, void **buf, const char *optional_filename, int64_t *length)
 
const struct file_archive_file_backendfile_archive_get_zlib_file_backend (void)
 
const struct file_archive_file_backendfile_archive_get_7z_file_backend (void)
 
const struct file_archive_file_backendfile_archive_get_file_backend (const char *path)
 
uint32_t file_archive_get_file_crc32 (const char *path)
 

Function Documentation

◆ file_archive_compressed_read()

int file_archive_compressed_read ( const char *  path,
void **  buf,
const char *  optional_filename,
int64_t length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_data()

static const uint8_t* file_archive_data ( file_archive_file_data_t data)
static
Here is the caller graph for this function:

◆ file_archive_decompress_data_to_file()

static int file_archive_decompress_data_to_file ( file_archive_file_handle_t handle,
int  ret,
const char *  path,
const char *  valid_exts,
const uint8_t cdata,
uint32_t  csize,
uint32_t  size,
uint32_t  checksum 
)
static

file_archive_decompress_data_to_file: : filename path of archive. : Valid extensions of archive to be parsed. If NULL, allow all. : input data. : size of input data. : output file size : CRC32 checksum from input data.

Decompress data to file.

Returns: true (1) on success, otherwise false (0).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_extract_cb()

static int file_archive_extract_cb ( const char *  name,
const char *  valid_exts,
const uint8_t cdata,
unsigned  cmode,
uint32_t  csize,
uint32_t  size,
uint32_t  checksum,
struct archive_extract_userdata userdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_extract_file()

bool file_archive_extract_file ( char *  archive_path,
size_t  archive_path_size,
const char *  valid_exts,
const char *  extraction_directory,
char *  out_path,
size_t  len 
)

file_archive_extract_file: : filename path to archive. : size of archive. : valid extensions for the file. : the directory to extract temporary file to.

Extract file from archive. If no file inside the archive is specified, the first file found will be used.

Returns : true (1) on success, otherwise false (0).

Here is the call graph for this function:

◆ file_archive_filename_split()

static struct string_list* file_archive_filename_split ( const char *  path)
static

file_archive_filename_split: : filename to turn into a string list

Creates a new string list based on filename , delimited by a hash (#).

Returns: new string list if successful, otherwise NULL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_free()

static void file_archive_free ( file_archive_file_data_t data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_get_7z_file_backend()

const struct file_archive_file_backend* file_archive_get_7z_file_backend ( void  )

◆ file_archive_get_file_backend()

const struct file_archive_file_backend* file_archive_get_file_backend ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_get_file_crc32()

uint32_t file_archive_get_file_crc32 ( const char *  path)

file_archive_get_file_crc32: : filename path of archive

Returns: CRC32 of the specified file in the archive, otherwise 0. If no path within the archive is specified, the first file found inside is used.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_get_file_list()

struct string_list* file_archive_get_file_list ( const char *  path,
const char *  valid_exts 
)

file_archive_get_file_list: : filename path of archive

Returns: string listing of files from archive on success, otherwise NULL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_get_file_list_cb()

static int file_archive_get_file_list_cb ( const char *  path,
const char *  valid_exts,
const uint8_t cdata,
unsigned  cmode,
uint32_t  csize,
uint32_t  size,
uint32_t  checksum,
struct archive_extract_userdata userdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_get_zlib_file_backend()

const struct file_archive_file_backend* file_archive_get_zlib_file_backend ( void  )

◆ file_archive_open()

static file_archive_file_data_t* file_archive_open ( const char *  path)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_parse_file_init()

static int file_archive_parse_file_init ( file_archive_transfer_t state,
const char *  file 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_parse_file_iterate()

int file_archive_parse_file_iterate ( file_archive_transfer_t state,
bool returnerr,
const char *  file,
const char *  valid_exts,
file_archive_file_cb  file_cb,
struct archive_extract_userdata userdata 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_parse_file_iterate_stop()

void file_archive_parse_file_iterate_stop ( file_archive_transfer_t state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_parse_file_progress()

int file_archive_parse_file_progress ( file_archive_transfer_t state)
Here is the caller graph for this function:

◆ file_archive_perform_mode()

bool file_archive_perform_mode ( const char *  path,
const char *  valid_exts,
const uint8_t cdata,
unsigned  cmode,
uint32_t  csize,
uint32_t  size,
uint32_t  crc32,
struct archive_extract_userdata userdata 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_archive_size()

static size_t file_archive_size ( file_archive_file_data_t data)
static
Here is the caller graph for this function:

◆ file_archive_walk()

static bool file_archive_walk ( const char *  file,
const char *  valid_exts,
file_archive_file_cb  file_cb,
struct archive_extract_userdata userdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: