summaryrefslogtreecommitdiff
path: root/c/tree/tree.h
blob: 4ccc68708b565800f429288d487c9d680f655c3a (plain)
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
/**
 * @author      : garhve (dev@garhve.com)
 * @file        : tree
 * @created     : Wednesday Dec 14, 2022 18:34:27 CST
 * @description : include and define main functions and structs
 */

#ifndef TREE_H
#define TREE_H

#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/stat.h>

typedef struct inodes {
    char * text;
    int level;
    bool fod;       // file or dir
} nodes;

typedef struct regular {
    nodes * node;
    struct regular * next;
} regfile;

void error(const char * str);
void init(regfile * st);
void getfile(regfile * head, const char * str);

#endif /* end of include guard TREE_H */