2024-03-09 20:18:19 +01:00
|
|
|
#ifndef FILE_H_
|
|
|
|
#define FILE_H_
|
|
|
|
|
2024-03-20 21:29:04 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2024-03-09 20:18:19 +01:00
|
|
|
typedef struct file {
|
2024-04-01 22:53:19 +02:00
|
|
|
char *name; /* basename */
|
|
|
|
char *path; /* absolute path */
|
2024-03-13 11:18:35 +01:00
|
|
|
char *type;
|
2024-04-01 22:53:19 +02:00
|
|
|
char *stats;
|
2024-03-29 23:34:26 +01:00
|
|
|
wchar_t *icon;
|
2024-03-14 15:58:03 +01:00
|
|
|
int color;
|
2024-03-09 20:18:19 +01:00
|
|
|
} file;
|
|
|
|
|
2024-03-20 21:29:04 +01:00
|
|
|
typedef struct ArrayList {
|
|
|
|
size_t length;
|
|
|
|
size_t capacity;
|
|
|
|
file *items;
|
|
|
|
} ArrayList;
|
|
|
|
|
|
|
|
ArrayList *arraylist_init(size_t capacity);
|
|
|
|
void arraylist_free(ArrayList *list);
|
2024-04-01 22:53:19 +02:00
|
|
|
long arraylist_search(ArrayList *list, char *filepath, bool bname);
|
2024-03-20 21:29:04 +01:00
|
|
|
void arraylist_remove(ArrayList *list, long index);
|
2024-03-31 22:44:05 +02:00
|
|
|
void arraylist_add(ArrayList *list, char *filename, char *path, char *stats, char *type, wchar_t *icon, int color, bool marked, bool force);
|
2024-04-02 02:18:34 +02:00
|
|
|
char *get_line(ArrayList *list, long index, bool detail, bool icons);
|
2024-03-09 20:18:19 +01:00
|
|
|
|
|
|
|
#endif
|