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-03-12 21:59:36 +01:00
|
|
|
char *path;
|
2024-03-11 22:54:14 +01:00
|
|
|
char *stats;
|
2024-03-13 11:18:35 +01:00
|
|
|
char *type;
|
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);
|
|
|
|
bool arraylist_includes(ArrayList *list, char *path);
|
|
|
|
void arraylist_remove(ArrayList *list, long index);
|
|
|
|
void arraylist_add(ArrayList *list, char *filepath, char *stats, char *type, int color, bool marked, bool force);
|
|
|
|
char *get_line(ArrayList *list, long index, bool detail);
|
2024-03-09 20:18:19 +01:00
|
|
|
|
|
|
|
#endif
|