Beispiel #1
0
static void __delete_all(t_avl const *const avl, t_node *const root) {
  if (root == nil)
    return;
  __delete_all(avl, root->node[0]);
  __delete_all(avl, root->node[1]);
  if (avl->hook_remove)
    avl->hook_remove(root->val);
  free(root);
}
Beispiel #2
0
int svc_clear(void)
{
	int rc = 0;

	if (_init() < 0)
		return -1;
	rc = __delete_all(SVC_TBL_NAME);
	__fini();

	return rc;
}
Beispiel #3
0
int mida_clear(void)
{
	int rc = 0;

	if (_init() < 0)
		return -1;
	rc = __delete_all(MIDA_TBL_NAME);
	__fini();

	return rc;
}
Beispiel #4
0
void avl_delete(t_avl *const avl) {
  __delete_all(avl, (t_node *)avl->root);
  free(avl);
}