diff options
| author | Tucker Evans <tucker@tuckerevans.com> | 2020-12-31 03:18:52 -0500 |
|---|---|---|
| committer | Tucker Evans <tucker@tuckerevans.com> | 2020-12-31 03:18:52 -0500 |
| commit | be0b9926ddcee4f6af1eef1091d48c919e611340 (patch) | |
| tree | 148e289d0e01f5b71a0fa13e0feece0955af69ba /structures/rope/rope.c | |
| parent | 4e1c2be8b650a9ea13f56565deb407a8e9164d62 (diff) | |
Add base for rope structure
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; +} |
