From 4459b8b3aa9d73895391785a99dcc87134e80601 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Tue, 17 Sep 2024 08:47:03 +0200 Subject: More lsp support This makes the LSP support complete for now: - Completion - Diagnostics - Goto implementation/declaration - Rename - Documentation - Find references --- src/dged/s8.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/dged/s8.h') 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 #include - -#define s8(s) ((struct s8){(uint8_t *)s, strlen(s)}) +#include 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 -- cgit v1.2.3