31 lines
458 B
C
31 lines
458 B
C
|
#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
|