(file_list.c) Rename rgui_file to item_file

This commit is contained in:
twinaphex 2013-11-08 04:50:33 +01:00
parent a71314bded
commit 77622e390c
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@
#include <string.h> #include <string.h>
#include "file_list.h" #include "file_list.h"
struct rgui_file struct item_file
{ {
char *path; char *path;
char *alt; char *alt;
@ -38,7 +38,7 @@ void file_list_push(void *userdata,
{ {
list->capacity++; list->capacity++;
list->capacity *= 2; list->capacity *= 2;
list->list = (struct rgui_file*)realloc(list->list, list->capacity * sizeof(struct rgui_file)); list->list = (struct item_file*)realloc(list->list, list->capacity * sizeof(struct item_file));
} }
list->list[list->size].path = strdup(path); list->list[list->size].path = strdup(path);
@ -93,8 +93,8 @@ void file_list_get_alt_at_offset(const file_list_t *list, size_t index,
static int file_list_alt_cmp(const void *a_, const void *b_) static int file_list_alt_cmp(const void *a_, const void *b_)
{ {
const struct rgui_file *a = (const struct rgui_file*)a_; const struct item_file *a = (const struct item_file*)a_;
const struct rgui_file *b = (const struct rgui_file*)b_; const struct item_file *b = (const struct item_file*)b_;
const char *cmp_a = a->alt ? a->alt : a->path; const char *cmp_a = a->alt ? a->alt : a->path;
const char *cmp_b = b->alt ? b->alt : b->path; const char *cmp_b = b->alt ? b->alt : b->path;
return strcasecmp(cmp_a, cmp_b); return strcasecmp(cmp_a, cmp_b);

View File

@ -21,10 +21,10 @@
extern "C" { extern "C" {
#endif #endif
struct rgui_file; struct item_file;
typedef struct file_list typedef struct file_list
{ {
struct rgui_file *list; struct item_file *list;
size_t capacity; size_t capacity;
size_t size; size_t size;