-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
42 lines (39 loc) · 1.29 KB
/
main.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tbeauman <tbeauman@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/04/23 11:17:30 by tfolly #+# #+# */
/* Updated: 2016/04/24 16:56:01 by tfolly ### ########.fr */
/* */
/* ************************************************************************** */
#include "hotrace.h"
int main(void)
{
char *key;
char *value;
char *tmp;
int read;
t_node *root;
read = 1;
root = 0;
while (read)
{
get_next_line(0, &key);
read = get_next_line(0, &value);
if (!ft_strcmp(key, ""))
read = 0;
else
add_node(&root, key, value);
}
if (*value)
{
search_key(root, value);
while (get_next_line(0, &tmp) > 0)
search_key(root, tmp);
}
destroy_tree(&root);
return (0);
}