summaryrefslogtreecommitdiff
path: root/src/dged/s8.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dged/s8.h')
-rw-r--r--src/dged/s8.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/dged/s8.h b/src/dged/s8.h
index 5a2504e..fe0f5b7 100644
--- a/src/dged/s8.h
+++ b/src/dged/s8.h
@@ -3,18 +3,26 @@
#include <stdbool.h>
#include <stdint.h>
-
-#define s8(s) ((struct s8){(uint8_t *)s, strlen(s)})
+#include <string.h>
struct s8 {
uint8_t *s;
uint32_t l;
};
+#define s8(s) ((struct s8){(uint8_t *)s, strlen(s)})
+
+struct s8 s8new(const char *s, uint32_t len);
+void s8delete(struct s8 s);
+struct s8 s8from_fmt(const char *fmt, ...);
+char *s8tocstr(struct s8 s);
+
bool s8eq(struct s8 s1, struct s8 s2);
int s8cmp(struct s8 s1, struct s8 s2);
-char *s8tocstr(struct s8 s);
bool s8startswith(struct s8 s, struct s8 prefix);
+bool s8endswith(struct s8 s, struct s8 suffix);
struct s8 s8dup(struct s8 s);
+bool s8empty(struct s8 s);
+bool s8onlyws(struct s8 s);
#endif