-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfile.h
More file actions
38 lines (32 loc) · 756 Bytes
/
file.h
File metadata and controls
38 lines (32 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef FILE_H_
#define FILE_H_
#include <stdio.h>
enum ftypes {
REG,
DRY, /* DIR is taken */
LNK,
CHR,
SOC,
BLK,
FIF
};
typedef struct {
char *name; /* basename */
char *path; /* absolute path */
int type;
char *stats;
int color;
char icon[8];
} file;
typedef struct {
size_t length;
size_t capacity;
file *items;
} ArrayList;
ArrayList *arraylist_init(size_t capacity);
void arraylist_free(ArrayList *list);
long arraylist_search(ArrayList *list, char *filepath, int bname);
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