GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
free.c
Go to the documentation of this file.
1 #include <grass/btree.h>
2 #include <stdlib.h>
3 
4 int btree_free(BTREE * B)
5 {
6  void *data, *key;
7 
8  btree_rewind(B);
9  while (btree_next(B, &key, &data)) {
10  free(key);
11  free(data);
12  }
13  free(B->node);
14 
15  return 0;
16 }
int btree_rewind(BTREE *B)
Definition: btree/rewind.c:3
int btree_free(BTREE *B)
Definition: free.c:4
tuple data
int btree_next(BTREE *B, void **key, void **data)
Definition: btree/next.c:3
void free(void *)