-
Notifications
You must be signed in to change notification settings - Fork 0
/
scanner.h
57 lines (37 loc) · 1 KB
/
scanner.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef _SCANNER_H__
#define _SCANNER_H__
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <err.h>
#include <time.h>
#include "arg.h"
#define RED "\x1B[31m"
#define GRN "\x1B[32m"
#define YEL "\x1B[33m"
#define BLU "\x1B[34m"
#define MAG "\x1B[35m"
#define CYN "\x1B[36m"
#define WHT "\x1B[37m"
#define RESET "\x1B[0m"
struct entity {
unsigned char type;
char *name;
struct stat *stat_file;
size_t capacity;
size_t nbchildreen;
struct entity **child;
} entity;
struct entity *dirent_to_node(struct dirent *entry, char *entrypath);
void double_capacity(struct entity *tree);
void addnode(struct entity *tree, struct entity *node);
struct entity *build_tree(char *);
void free_tree(struct entity *tree);
void print_debug_tree(struct entity *tree, size_t indent);
void print_tree(struct entity *tree, struct options *op);
#endif /* _SCANNER_H_ */