aboutsummaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/types')
-rw-r--r--src/types/str.c5
-rw-r--r--src/types/str.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/types/str.c b/src/types/str.c
index 2783fb0..12a6bb1 100644
--- a/src/types/str.c
+++ b/src/types/str.c
@@ -48,4 +48,9 @@ void str_clear(str* s){
s->len = 0;
}
+void str_popf(str* s, int len){
+ memmove(s->c, s->c + len, s->len -= len);
+ s->c[s->len] = 0;
+}
+
diff --git a/src/types/str.h b/src/types/str.h
index ccf379f..54f27e6 100644
--- a/src/types/str.h
+++ b/src/types/str.h
@@ -16,5 +16,5 @@ void str_free(str*);
void str_push(str*, char*);
void str_pushl(str*, char*, size_t);
void str_clear(str*);
-
+void str_popf(str*, int);
#endif //__STR_H \ No newline at end of file