summaryrefslogtreecommitdiff
path: root/src/str.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/str.h')
-rw-r--r--src/str.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/str.h b/src/str.h
new file mode 100644
index 0000000..39bddf6
--- /dev/null
+++ b/src/str.h
@@ -0,0 +1,35 @@
+#ifndef STR_H
+#define STR_H
+
+#include <util.h>
+
+typedef struct str_s str;
+
+str *new_str(char *s, NUM size);
+
+/* flag non-zero => free the stored character array as well */
+void destroy_str(str *s, int flag);
+
+/* deliberately expose this struct */
+struct str_info_s {
+ NUM value;
+ size_t step;
+};
+
+typedef struct str_info_s str_info;
+
+#define EMPTY_STR_INFO ((str_info) { 0, 1 })
+
+str_info get_info(str *, UNUM);
+
+char *get_data(str *s);
+
+NUM str_length(str *);
+
+void str_set_length(str *s, UNUM size);
+
+void change_str_content(str *, char *, NUM);
+
+unsigned char copy_str(str *dest, str *source);
+
+#endif