diff options
Diffstat (limited to 'structures/rope/rope.c')
-rw-r--r-- | structures/rope/rope.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/structures/rope/rope.c b/structures/rope/rope.c new file mode 100644 index 0000000..9e0d551 --- /dev/null +++ b/structures/rope/rope.c @@ -0,0 +1,29 @@ +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <assert.h> +#include "rope.h" + +struct rope_s { + size_t len; + char *str; + + struct rope_s *left, *right, *parent; +}; + + +rope* rope_new() +{ + rope *tmp; + + tmp = malloc(sizeof(rope)); + assert(tmp); + + tmp->len = 0; + tmp->str = NULL; + tmp->left = NULL; + tmp->right = NULL; + tmp->parent = NULL; + + return tmp; +} |