summaryrefslogtreecommitdiff
path: root/c/tree/tree.h
blob: 82eb201e5bbe3b8b278c6f7504bf067be963f0a0 (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
35
36
/**
 * @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;
    size_t      len;
    bool        fod;       // file or dir
} nodes;

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

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

#endif /* end of include guard TREE_H */