RetroArch
Functions
file_list.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <retro_common.h>
#include <lists/file_list.h>
#include <string/stdstring.h>
#include <compat/strcasestr.h>
Include dependency graph for file_list.c:

Functions

bool file_list_reserve (file_list_t *list, size_t nitems)
 makes the list big enough to contain at least nitems More...
 
static void file_list_add (file_list_t *list, unsigned idx, const char *path, const char *label, unsigned type, size_t directory_ptr, size_t entry_idx)
 
static bool file_list_expand_if_needed (file_list_t *list)
 
bool file_list_prepend (file_list_t *list, const char *path, const char *label, unsigned type, size_t directory_ptr, size_t entry_idx)
 
bool file_list_append (file_list_t *list, const char *path, const char *label, unsigned type, size_t directory_ptr, size_t entry_idx)
 
size_t file_list_get_size (const file_list_t *list)
 
size_t file_list_get_directory_ptr (const file_list_t *list)
 
void file_list_pop (file_list_t *list, size_t *directory_ptr)
 
void file_list_free (file_list_t *list)
 frees the list More...
 
void file_list_clear (file_list_t *list)
 
void file_list_copy (const file_list_t *src, file_list_t *dst)
 
void file_list_set_label_at_offset (file_list_t *list, size_t idx, const char *label)
 
void file_list_get_label_at_offset (const file_list_t *list, size_t idx, const char **label)
 
void file_list_set_alt_at_offset (file_list_t *list, size_t idx, const char *alt)
 
void file_list_get_alt_at_offset (const file_list_t *list, size_t idx, const char **alt)
 
static int file_list_alt_cmp (const void *a_, const void *b_)
 
static int file_list_type_cmp (const void *a_, const void *b_)
 
void file_list_sort_on_alt (file_list_t *list)
 
void file_list_sort_on_type (file_list_t *list)
 
void * file_list_get_userdata_at_offset (const file_list_t *list, size_t idx)
 
void file_list_set_userdata (const file_list_t *list, size_t idx, void *ptr)
 
void file_list_set_actiondata (const file_list_t *list, size_t idx, void *ptr)
 
void * file_list_get_actiondata_at_offset (const file_list_t *list, size_t idx)
 
void file_list_free_actiondata (const file_list_t *list, size_t idx)
 
void file_list_free_userdata (const file_list_t *list, size_t idx)
 
void * file_list_get_last_actiondata (const file_list_t *list)
 
void file_list_get_at_offset (const file_list_t *list, size_t idx, const char **path, const char **label, unsigned *file_type, size_t *entry_idx)
 
void file_list_get_last (const file_list_t *list, const char **path, const char **label, unsigned *file_type, size_t *entry_idx)
 
bool file_list_search (const file_list_t *list, const char *needle, size_t *idx)
 

Function Documentation

◆ file_list_add()

static void file_list_add ( file_list_t *  list,
unsigned  idx,
const char *  path,
const char *  label,
unsigned  type,
size_t  directory_ptr,
size_t  entry_idx 
)
static
Here is the caller graph for this function:

◆ file_list_alt_cmp()

static int file_list_alt_cmp ( const void *  a_,
const void *  b_ 
)
static
Here is the caller graph for this function:

◆ file_list_append()

bool file_list_append ( file_list_t *  list,
const char *  path,
const char *  label,
unsigned  type,
size_t  directory_ptr,
size_t  entry_idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_clear()

void file_list_clear ( file_list_t *  list)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_copy()

void file_list_copy ( const file_list_t *  src,
file_list_t *  dst 
)
Here is the call graph for this function:

◆ file_list_expand_if_needed()

static bool file_list_expand_if_needed ( file_list_t *  list)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_free()

void file_list_free ( file_list_t *  list)

frees the list

NOTE: This function will also free() the entries actiondata and userdata fields if they are non-null. If you store complex or non-contiguous data there, make sure you free it's fields before calling this function or you might get a memory leak.

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

◆ file_list_free_actiondata()

void file_list_free_actiondata ( const file_list_t *  list,
size_t  idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_free_userdata()

void file_list_free_userdata ( const file_list_t *  list,
size_t  idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_get_actiondata_at_offset()

void* file_list_get_actiondata_at_offset ( const file_list_t *  list,
size_t  idx 
)
Here is the caller graph for this function:

◆ file_list_get_alt_at_offset()

void file_list_get_alt_at_offset ( const file_list_t *  list,
size_t  idx,
const char **  alt 
)
Here is the caller graph for this function:

◆ file_list_get_at_offset()

void file_list_get_at_offset ( const file_list_t *  list,
size_t  idx,
const char **  path,
const char **  label,
unsigned *  file_type,
size_t *  entry_idx 
)
Here is the caller graph for this function:

◆ file_list_get_directory_ptr()

size_t file_list_get_directory_ptr ( const file_list_t *  list)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_get_label_at_offset()

void file_list_get_label_at_offset ( const file_list_t *  list,
size_t  idx,
const char **  label 
)
Here is the caller graph for this function:

◆ file_list_get_last()

void file_list_get_last ( const file_list_t *  list,
const char **  path,
const char **  label,
unsigned *  file_type,
size_t *  entry_idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_get_last_actiondata()

void* file_list_get_last_actiondata ( const file_list_t *  list)
Here is the caller graph for this function:

◆ file_list_get_size()

size_t file_list_get_size ( const file_list_t *  list)
Here is the caller graph for this function:

◆ file_list_get_userdata_at_offset()

void* file_list_get_userdata_at_offset ( const file_list_t *  list,
size_t  idx 
)
Here is the caller graph for this function:

◆ file_list_pop()

void file_list_pop ( file_list_t *  list,
size_t *  directory_ptr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_prepend()

bool file_list_prepend ( file_list_t *  list,
const char *  path,
const char *  label,
unsigned  type,
size_t  directory_ptr,
size_t  entry_idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_reserve()

bool file_list_reserve ( file_list_t *  list,
size_t  nitems 
)

makes the list big enough to contain at least nitems

This function will not change the capacity if nitems is smaller than the current capacity.

Parameters
list
nitems
Returns
whether or not the operation succeeded
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_search()

bool file_list_search ( const file_list_t *  list,
const char *  needle,
size_t *  idx 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_set_actiondata()

void file_list_set_actiondata ( const file_list_t *  list,
size_t  idx,
void *  ptr 
)
Here is the caller graph for this function:

◆ file_list_set_alt_at_offset()

void file_list_set_alt_at_offset ( file_list_t *  list,
size_t  idx,
const char *  alt 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_set_label_at_offset()

void file_list_set_label_at_offset ( file_list_t *  list,
size_t  idx,
const char *  label 
)
Here is the call graph for this function:

◆ file_list_set_userdata()

void file_list_set_userdata ( const file_list_t *  list,
size_t  idx,
void *  ptr 
)
Here is the caller graph for this function:

◆ file_list_sort_on_alt()

void file_list_sort_on_alt ( file_list_t *  list)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_list_sort_on_type()

void file_list_sort_on_type ( file_list_t *  list)
Here is the call graph for this function:

◆ file_list_type_cmp()

static int file_list_type_cmp ( const void *  a_,
const void *  b_ 
)
static
Here is the caller graph for this function: