summaryrefslogtreecommitdiff
path: root/src/dged/s8.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-09-17 08:47:03 +0200
committerAlbert Cervin <albert@acervin.com>2025-11-01 22:11:14 +0100
commit4459b8b3aa9d73895391785a99dcc87134e80601 (patch)
treea5204f447a0b2b05f63504c7fe958ef9bbf1918a /src/dged/s8.h
parent4689f3f38277bb64981fc960e8e384e2d065d659 (diff)
downloaddged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.gz
dged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.xz
dged-4459b8b3aa9d73895391785a99dcc87134e80601.zip
More lsp support
This makes the LSP support complete for now: - Completion - Diagnostics - Goto implementation/declaration - Rename - Documentation - Find references
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