ccc/file.h

40 lines
795 B
C
Raw Normal View History

#ifndef FILE_H_
#define FILE_H_
2024-03-20 21:29:04 +01:00
#include <stdio.h>
#include <stdbool.h>
enum ftypes {
REG,
DRY, /* DIR is taken */
LNK,
CHR,
SOC,
BLK,
FIF
};
2024-03-20 21:29:04 +01:00
typedef struct file {
char *name; /* basename */
char *path; /* absolute path */
int type;
char *stats;
char *icon;
int color;
} file;
2024-03-20 21:29:04 +01:00
typedef struct ArrayList {
size_t length;
size_t capacity;
file *items;
2024-03-20 21:29:04 +01:00
} ArrayList;
ArrayList *arraylist_init(size_t capacity);
void arraylist_free(ArrayList *list);
long arraylist_search(ArrayList *list, char *filepath, bool bname);
2024-03-20 21:29:04 +01:00
void arraylist_remove(ArrayList *list, long index);
void arraylist_add(ArrayList *list, char *name, char *path, char *stats, int type, char *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);
#endif