aboutsummaryrefslogtreecommitdiff
path: root/src/str.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-05-20 10:07:16 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-05-20 10:11:29 -0400
commit67975a5944706e382fe1e7b00d226715c6242358 (patch)
treee93dd37df57f49d4327567479521014f380206e5 /src/str.c
parent30c9945e0da19305ebad88a2835653ff4f409313 (diff)
downloadstasis-67975a5944706e382fe1e7b00d226715c6242358.tar.gz
Mass attempt at windows portability
Diffstat (limited to 'src/str.c')
-rw-r--r--src/str.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/str.c b/src/str.c
index a5d42a6..45b32df 100644
--- a/src/str.c
+++ b/src/str.c
@@ -2,7 +2,18 @@
* @file strings.c
*/
#include <unistd.h>
-#include "str.h"
+#include "omc.h"
+
+#if defined(OMC_OS_WINDOWS)
+char *strsep(char **str, const char *delim) {
+ static char *last;
+ return strtok_r(*str, delim, &last);
+}
+
+char *strndup(const char *str, size_t nelem) {
+ return calloc(nelem, sizeof(*str));
+}
+#endif
int num_chars(const char *sptr, int ch) {
int result = 0;