2 * Libavl is a library to manage AVL structure to store and organize
3 * everykind of data. You just need to implement function to compare,
4 * to desallocate and to print your structure.
6 * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
7 * Version 2, December 2004
9 * Copyright (C) 2013 Adrien Oliva <adrien.oliva@yapbreak.fr>
11 * Everyone is permitted to copy and distribute verbatim or modified
12 * copies of this license document, and changing it is allowed as long
13 * as the name is changed.
15 * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
16 * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
18 * 0. You just DO WHAT THE FUCK YOU WANT TO.
24 #include "../syslog.h"
27 int data_cmp(void *a, void *b)
29 return (int) ((char *) a - (char *) b);
32 void data_print(void *d)
37 void data_delete(void *d)
46 // Try to allocate a new tree.
47 first = init_dictionnary(data_cmp, data_print, data_delete, NULL);
49 ELOG("Init dictionnary error");
50 return "Init dictionnary error";
52 if (sizeof(*first) != sizeof(tree)) {
53 ELOG("Wrong returned size");
54 return "Wrong returned size";
60 // Try to delete a null tree