aoc-2022/day_7/filetree.h

31 lines
458 B
C
Raw Normal View History

2023-01-07 02:17:15 +00:00
#ifndef FILETREE_H
#define FILETREE_H
#include <stdlib.h>
#include <stdio.h>
struct filenode {
char *name;
unsigned long size;
};
struct dirnode {
char *name;
struct filenode **files;
size_t num_files;
struct dirnode **directories;
size_t num_dirs;
unsigned long size;
};
void add_directory(struct dirnode *cur, struct dirnode *item);
void add_file(struct dirnode *cur, struct filenode *item);
#endif // FILETREE_H