diff options
Diffstat (limited to 'structures/rope/rope.c')
-rw-r--r-- | structures/rope/rope.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/structures/rope/rope.c b/structures/rope/rope.c index 9e0d551..e1ae4a9 100644 --- a/structures/rope/rope.c +++ b/structures/rope/rope.c @@ -27,3 +27,19 @@ rope* rope_new() return tmp; } + +rope* str_to_rope(str) +char *str; +{ + rope *tmp; + + if (!str) + return NULL; + + tmp = rope_new(); + tmp->len = strlen(str); + tmp->str = strdup(str); + + return tmp; +} + |