-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTree.h
More file actions
54 lines (44 loc) · 974 Bytes
/
Copy pathTree.h
File metadata and controls
54 lines (44 loc) · 974 Bytes
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
/*
Tree.h includes all the header files necessary, structures created,
and the declarations for the functions used in Tree.c.
*/
#ifndef __TREE_H__
#define __TREE_H__
// Include all necesssary header files
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
// Give aliases to the structs and pointers
typedef struct Node Node;
typedef struct Node *PtrNode;
typedef struct Tree Tree;
typedef struct Tree *PtrTree;
typedef struct ListNode ListNode;
typedef struct ListNode *PtrListNode;
// Structs used
struct ListNode
{
char *name;
ListNode *next;
char *alias;
};
struct Node
{
Node *Parent;
char *name;
char *Alias;
Node *FirstChild;
Node *Sibling;
bool type;
};
struct Tree
{
Node *root;
};
// Declarations of the functions in Tree.c
PtrListNode MakeList();
Node *MakeNode(Node *parentAddress, PtrTree root, char *inputString, bool inputType);
PtrTree MakeTree();
#endif