ccc/file.h

39 lines
756 B
C
Raw Normal View History

#ifndef FILE_H_
#define FILE_H_
2024-03-20 21:29:04 +01:00
#include <stdio.h>
enum ftypes {
REG,
DRY, /* DIR is taken */
LNK,
CHR,
SOC,
BLK,
FIF
};
2024-03-20 21:29:04 +01:00
2024-11-17 20:49:16 +01:00
typedef struct {
char *name; /* basename */
char *path; /* absolute path */
int type;
char *stats;
int color;
char icon[5];
} file;
2024-11-17 20:49:16 +01:00
typedef struct {
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, int 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, int marked, int force);
char *get_line(ArrayList *list, long index, int detail, int icons);
#endif