1 #ifndef __FT_H_
2 #define __FT_H_
3 
4 #ifdef HAVE_CONFIG_H
5 # include "config.h"
6 #endif
7 
8 #include <sys/types.h>
9 #if HAVE_INTTYPES_H
10 # include <inttypes.h>
11 #else
12 # if HAVE_STDINT_H
13 #  include <stdint.h>
14 # endif
15 #endif
16 
17 typedef struct _ftent {
18 	struct _ftent *ft_parent;
19 	struct _ftent *ft_childs;
20 	uint16_t ft_chsize;
21 	uint16_t ft_index;
22 	char *ft_path;
23 	uint16_t ft_pathlen;
24 	char *ft_name;
25 	uint16_t ft_namelen;
26 	uint16_t ft_level;
27 	void *ft_data;
28 	size_t ft_size;
29 
30 	/* for programmers using */
31 	uint16_t ft_opt;
32 } FTENT;
33 
34 typedef struct {
35 	struct _ftent *ft_root;
36 	void (*ft_datadel)(FTENT *);
37 	FTENT * (*ft_datacpy)(FTENT *, void *, size_t);
38 } FT;
39 
40 FT * ft_init();
41 void ft_close();
42 FTENT * ft_find();
43 FTENT * ft_add();
44 void ft_delete();
45 int ft_traverse();
46 
47 #endif /* __FT_H_ */
48