Subversion Repositories PlanixRsrch.SVN

Rev

Rev 449 | Rev 464 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 449 Rev 452
Line 71... Line 71...
71
};
71
};
72
 
72
 
73
 
73
 
74
void mavlnode_destroy(struct mavl *t, struct mavlnode *n);
74
void mavlnode_destroy(struct mavl *t, struct mavlnode *n);
75
struct mavlnode * mavlnode_create(struct mavl *t, const void *data);
75
struct mavlnode * mavlnode_create(struct mavl *t, const void *data);
-
 
76
struct mavlnode * mavlnode_get(struct mavl *t ,const void *data);
76
 
77
 
77
#define mavlnode_dataptr(node) \
78
#define mavlnode_dataptr(node) \
78
	((void*)(((char*)((void*)(node))) + sizeof(struct mavlnode)))
79
	((void*)(((char*)((void*)(node))) + sizeof(struct mavlnode)))
79
 
80
 
80
struct mavl *mavl_create(int (*cmp) (const void *, const void *),
81
struct mavl *mavl_create(int (*cmp) (const void *, const void *),
Line 86... Line 87...
86
int mavl_get_depth(struct mavl *t);
87
int mavl_get_depth(struct mavl *t);
87
int mavl_verify(struct mavl *t);
88
int mavl_verify(struct mavl *t);
88
void mavl_print(struct mavl *t, 
89
void mavl_print(struct mavl *t, 
89
		void (*pcb)(char*,struct mavlnode *), int width);
90
		void (*pcb)(char*,struct mavlnode *), int width);
90
void * mavl_get(struct mavl *t ,const void *data);
91
void * mavl_get(struct mavl *t ,const void *data);
-
 
92
 
-
 
93
 
91
 
94
 
92
void mavl_destroy(struct mavl *t);
95
void mavl_destroy(struct mavl *t);
93
 
96
 
94
 
97
 
95
 
98
 
Line 112... Line 115...
112
 
115
 
113
#define mavliter_foreach(iterator)\
116
#define mavliter_foreach(iterator)\
114
        for ((void)mavliter_seek_set(iterator); \
117
        for ((void)mavliter_seek_set(iterator); \
115
			NULL != mavliter_get(iterator); \
118
			NULL != mavliter_get(iterator); \
116
		(void)mavliter_next(iterator))
119
		(void)mavliter_next(iterator))
117
 
120
 
118
 
121
 
119
void mavl_rot(struct mavlnode *n, struct mavlnode **parent, int dir);
122
void mavl_rot(struct mavlnode *n, struct mavlnode **parent, int dir);
120
void mavl_drot(struct mavlnode *n, struct mavlnode **parent, int dir);
123
void mavl_drot(struct mavlnode *n, struct mavlnode **parent, int dir);
121
 
124
 
122
 
125
 
123
 
126
 
124
#define MAVL_FIND_FIRST 1
127
#define MAVL_FIND_FIRST 1
125
#define MAVL_FIND_LAST  2
128
#define MAVL_FIND_LAST  2
126
void * mavl_get_ext(struct mavl *t ,const void *search, int mode);
129
void * mavl_get_ext(struct mavl *t ,const void *search, int mode);
127
 
-
 
-
 
130
#define mavl_get_first(tree,search) mavl_get_ext(tree,search,MAVL_FIND_FIRST)
-
 
131
#define mavl_get_last(tree,search) mavl_get_ext(tree,search,MAVL_FIND_LAST)
128
 
132
 
129
 
133
 
130
 
134
 
131
#endif
135
#endif