summaryrefslogtreecommitdiff
path: root/util_liveinfo/include/node.h
blob: 61a5922cdf73dd4a2436ee48426ebf66347be58e (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

enum node_type {
	NODE_DIR,
	NODE_FILE,
	NODE_LINK,
};

struct node;

#define NODE_READ	0x01
#define NODE_WRITE	0x02
#define NODE_EXEC	0x04

extern struct node *node_find(const struct node *node, char *path);
extern struct node *node_create(struct node *parent, const char *name, enum node_type type);
extern void node_destroy(struct node *node);

extern struct node * const node_next_sibling(const struct node *node);
extern struct node * const node_prev_sibling(const struct node *node);

extern struct node * const node_child(const struct node *node);
extern struct node * const node_parent(const struct node *node);

extern void node_set_mode(struct node *node, int mode);
extern void node_set_data(struct node *node, void *data);

extern const int const node_mode(const struct node *node);
extern void * const node_data(const struct node *node);

extern void node_set_type(struct node *node, enum node_type type);
extern const enum node_type const node_type(const struct node *node);

extern const char * const node_name(const struct node *node);

extern char *node_to_abspath(struct node *node);
/* End of a file */