aboutsummaryrefslogtreecommitdiff
path: root/src/string_utils.h
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-09-19 17:46:20 +1000
committerallusive-dev <[email protected]>2023-09-19 17:46:20 +1000
commit5650d887357bf2a3fac8c5fd4f467bf8795b5fc4 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/string_utils.h
parentUpdate picom.sample.conf (diff)
downloadcompfy-5650d887357bf2a3fac8c5fd4f467bf8795b5fc4.tar.xz
compfy-5650d887357bf2a3fac8c5fd4f467bf8795b5fc4.zip
reset
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
deleted file mode 100644
index 38febde..0000000
--- a/src/string_utils.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: MPL-2.0
-// Copyright (c) Yuxuan Shui <[email protected]>
-#pragma once
-#include <ctype.h>
-#include <stddef.h>
-
-#include "compiler.h"
-
-#define mstrncmp(s1, s2) strncmp((s1), (s2), strlen(s1))
-
-char *mstrjoin(const char *src1, const char *src2);
-char *mstrjoin3(const char *src1, const char *src2, const char *src3);
-void mstrextend(char **psrc1, const char *src2);
-
-/// Parse a floating point number of form (+|-)?[0-9]*(\.[0-9]*)
-double strtod_simple(const char *, const char **);
-
-static inline int uitostr(unsigned int n, char *buf) {
- int ret = 0;
- unsigned int tmp = n;
- while (tmp > 0) {
- tmp /= 10;
- ret++;
- }
-
- if (ret == 0)
- ret = 1;
-
- int pos = ret;
- while (pos--) {
- buf[pos] = (char)(n % 10 + '0');
- n /= 10;
- }
- return ret;
-}
-
-static inline const char *skip_space_const(const char *src) {
- if (!src)
- return NULL;
- while (*src && isspace((unsigned char)*src))
- src++;
- return src;
-}
-
-static inline char *skip_space_mut(char *src) {
- if (!src)
- return NULL;
- while (*src && isspace((unsigned char)*src))
- src++;
- return src;
-}
-
-#define skip_space(x) \
- _Generic((x), char * : skip_space_mut, const char * : skip_space_const)(x)