aboutsummaryrefslogtreecommitdiff
path: root/structures/rope/rope.c
diff options
context:
space:
mode:
Diffstat (limited to 'structures/rope/rope.c')
-rw-r--r--structures/rope/rope.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/structures/rope/rope.c b/structures/rope/rope.c
index 6e79b24..4719b18 100644
--- a/structures/rope/rope.c
+++ b/structures/rope/rope.c
@@ -28,6 +28,21 @@ rope* rope_new()
return tmp;
}
+void rope_free(root)
+rope *root;
+{
+ if (root->str)
+ free(root->str);
+ if (root->left)
+ free(root->left);
+ if (root->right)
+ free(root->right);
+
+ free(root);
+
+ return;
+}
+
void rope_debug_print_aux(root, s)
rope *root;
int s;