aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/other/string.h
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2025-01-14 16:06:02 -0600
committerWilliam Harrington <kb0iic@berzerkula.org>2025-01-14 16:06:02 -0600
commit0cc9b20c15460213e488bf5e70963b941482f628 (patch)
treebb0143245583ec846630f39bfa2258dba640ccd7 /sdk/other/string.h
parent0e084ade5069756d487b5c948c48b777e37c00c9 (diff)
Add source.
Diffstat (limited to 'sdk/other/string.h')
-rw-r--r--sdk/other/string.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/sdk/other/string.h b/sdk/other/string.h
new file mode 100644
index 0000000..5db8cd4
--- /dev/null
+++ b/sdk/other/string.h
@@ -0,0 +1,65 @@
+/*
+ * Portable string handling routines.
+ * $Id$
+ * Copyright (c) 1997 by Tycho Softworks.
+ * For conditions of distribution and reuse see product license.
+ */
+
+#ifndef __OTHER_STRINGS_H__
+#define __OTHER_STRINGS_H__
+
+#ifndef __STD_STRING_H__
+#include <std/string.h>
+#endif
+
+#ifndef __STD_TYPES_H__
+#include <std/types.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __NAMESPACE
+#define __SPACES __NAMESPACE(__SPACES)
+#endif
+
+extern char __SPACES[];
+
+#ifdef __NAMESPACE
+#define strblank __NAMESPACE(strblank)
+#define strtrim __NAMESPACE(strtrim)
+#define strrtrim __NAMESPACE(strrtrim)
+#define strltrim __NAMESPACE(strltrim)
+#define right __NAMESPACE(right)
+#define left __NAMESPACE(left)
+#define ccount __NAMESPACE(ccount)
+#define tail __NAMESPACE(tail)
+#define field __NAMESPACE(field)
+#define token __NAMESPACE(token)
+#define strcopy __NAMESPACE(strcopy)
+#define strncopy __NAMESPACE(strncopy)
+#define strdiff __NAMESPACE(strdiff)
+#define getargv __NAMESPACE(getargv)
+#endif
+
+bool strblank(const char *str);
+char *strtrim(char *s, const char *trim);
+char *strrtrim(char *s, const char *trim);
+char *strltrim(char *s, const char *trim);
+char *right(char *str, size_t len);
+char *left(char *str, size_t len);
+int ccount(const char *str, const char *list);
+char *tail(const char *str);
+char *field(char **ptr, const char *tok);
+char *token(char **ptr, const char *tok);
+char *strcopy(char *to, const char *from);
+char *strncopy(char *to, const char *from, int len);
+int strdiff(const char *s1, const char *s2);
+int getargv(char *base[], char *str);
+void fatal(int exitcode, const char *format, ...);
+#ifdef __cplusplus
+}
+#endif
+
+#endif