diff options
| author | spl3g <spleefer6@yandex.ru> | 2025-03-22 21:41:16 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-03-22 21:41:16 +0300 |
| commit | 62454373db4cd2add82ded0cf7b21f7d69ade597 (patch) | |
| tree | 1627133fe4567e9a3abb707af5e7289353410d5f /lib/const_strings.h | |
| parent | ef5f52fb739c9f0d71c579f08363ef0dfd5c227d (diff) | |
Reorganize the lib
Diffstat (limited to 'lib/const_strings.h')
| -rw-r--r-- | lib/const_strings.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/const_strings.h b/lib/const_strings.h deleted file mode 100644 index cb92442..0000000 --- a/lib/const_strings.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef CONST_STRINGS_H_ -#define CONST_STRINGS_H_ - -#include <string.h> -#include <stdio.h> -#include <stdbool.h> - -typedef struct { - const char* data; - int len; -} const_string; - -const_string cs_from_parts(const char* data, int len); -const_string cs_from_cstr(const char* cstr); -const_string cs_slice(const_string src, int from, int to); -const_string cs_chop_delim(const_string *src, char delim); -bool cs_try_chop_delim(const_string *str, char delim, const_string *dst); -int cs_find_delim(const_string str, char delim); -bool cs_eq(const_string str1, const_string str2); -void cs_print(char *format, const_string str); - -#define CS(cstr) cs_from_parts(cstr, sizeof(cstr) - 1) -#define CS_STATIC(cstr) {.data = cstr, .len = sizeof(cstr) - 1} - -#define CS_FMT "%.*s" -#define CS_ARG(cs) (int) (cs).len, (cs).data - -#endif // STRINGS_H_ |
