feat: added a simple filesystem tree walk and the status cli command to get a list of untracked files

This commit is contained in:
lisk77 2025-08-20 21:44:04 +02:00
parent 8b862f8b87
commit c372a5f8bc
5 changed files with 174 additions and 7 deletions

24
include/tree.h Normal file
View file

@ -0,0 +1,24 @@
#ifndef TREE_H
#define TREE_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
typedef struct {
char** paths;
size_t len;
size_t capacity;
} PathBuffer;
PathBuffer* new_path_buffer();
void add_path(PathBuffer*, char*);
void free_path_buffer(PathBuffer*);
char* find_root(const char*);
void walk(const char*, const char*, PathBuffer*);
#endif // TREE_H