feat(utilities): added the List struct for a general purpose dynamic array
This commit is contained in:
parent
5b134edac6
commit
7113b53caa
2 changed files with 43 additions and 0 deletions
|
|
@ -18,6 +18,8 @@
|
|||
#define GREEN_BG "\033[42m"
|
||||
#define BLACK_FG "\033[30m"
|
||||
|
||||
#define LIST_INIT_CAPACITY 4
|
||||
|
||||
typedef enum {
|
||||
PT_NOEXIST,
|
||||
PT_FILE,
|
||||
|
|
@ -26,6 +28,15 @@ typedef enum {
|
|||
PT_ERROR
|
||||
} PathType;
|
||||
|
||||
typedef struct {
|
||||
void** items;
|
||||
size_t len;
|
||||
size_t capacity;
|
||||
size_t item_size;
|
||||
} List;
|
||||
|
||||
List* list_new(size_t);
|
||||
int list_push(List*, void*);
|
||||
PathType get_path_type(const char*);
|
||||
void visualize_diff(File*, File*, ActionList*);
|
||||
void cut_path(char* base, char* path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue