aboutsummaryrefslogtreecommitdiff
path: root/lib/cstr/cstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cstr/cstr.h')
-rw-r--r--lib/cstr/cstr.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/cstr/cstr.h b/lib/cstr/cstr.h
index 80dc359..ce27eb0 100644
--- a/lib/cstr/cstr.h
+++ b/lib/cstr/cstr.h
@@ -3,6 +3,11 @@
#include "../sys/sizes.h"
+typedef struct {
+ char *begin;
+ char *end;
+} substr_t;
+
u64 cstr_length(const char *);
i8 cstr_compare(const char *a, const char *b);
u64 cstr_split(char *cstr, char split);
@@ -10,6 +15,10 @@ const char *next_split(const char *previous);
u64 strip_front(char *cstr, char strip);
u64 strip_back(char *cstr, char strip);
u64 strip_cstr(char *cstr, char strip);
+u64 number_of_lines(const char *cstr);
+
+substr_t getline(const char *cstr, u64 n);
+substr_t nextline(substr_t line);
u64 cstr_utf8_length(const char *);
u8 next_utf8(const char **);