aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-03 15:11:33 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-03 15:11:33 +0200
commitbf263810b0a47a68fae0681e6e6d2229a488c069 (patch)
tree0aa97f9afa6b94f6477fa5345fadb00a5ec9b31c /include
parentd2feec1f97e9f8f201e56ad33662bb663c328a0a (diff)
downloadlibft-bf263810b0a47a68fae0681e6e6d2229a488c069.tar.gz
libft-bf263810b0a47a68fae0681e6e6d2229a488c069.tar.bz2
libft-bf263810b0a47a68fae0681e6e6d2229a488c069.zip
Added Dynamic string struct (no test, no doc)
Diffstat (limited to 'include')
-rw-r--r--include/libft_dstr.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/libft_dstr.h b/include/libft_dstr.h
new file mode 100644
index 0000000..13cb4e3
--- /dev/null
+++ b/include/libft_dstr.h
@@ -0,0 +1,35 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libft_dstr.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/03 10:39:51 by charles #+# #+# */
+/* Updated: 2020/04/03 15:10:54 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFT_DSTR_H
+# define LIBFT_DSTR_H
+
+# include <stdlib.h>
+# include "libft_def.h"
+# include "libft_str.h"
+# include "libft_mem.h"
+
+typedef struct s_ftdstr
+{
+ char *str;
+ size_t length;
+ size_t capacity;
+} t_ftdstr;
+
+t_ftdstr *ft_dstrnew(char *from);
+void ft_dstrdestroy(t_ftdstr *dstr);
+t_ftdstr *ft_dstrgrow(t_ftdstr *dstr, size_t at_least);
+char *ft_dstrunwrap(t_ftdstr *dstr);
+t_ftdstr *ft_dstrinsert(t_ftdstr *dstr, char *inserted, size_t i);
+// t_ftdstr *ft_dstrreplace(t_ftdstr *dstr, char *from, char *to);
+
+#endif