summaryrefslogtreecommitdiff
path: root/libpsx/include/strings.h
diff options
context:
space:
mode:
authorXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
committerXavi Del Campo <xavi.dcr@tutanota.com>2020-01-31 10:32:23 +0100
commit7c24e9a9b02b04dcaf9507acb94091ea70a2c02d (patch)
treec28d0748652ad4b4222309e46e6cfc82c0906220 /libpsx/include/strings.h
parenta2b7b6bb1cc2f4a3258b7b2dbc92399d151f864d (diff)
downloadpsxsdk-7c24e9a9b02b04dcaf9507acb94091ea70a2c02d.tar.gz
Imported pristine psxsdk-20190410 from official repo
Diffstat (limited to 'libpsx/include/strings.h')
-rw-r--r--libpsx/include/strings.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/libpsx/include/strings.h b/libpsx/include/strings.h
new file mode 100644
index 0000000..7e9082f
--- /dev/null
+++ b/libpsx/include/strings.h
@@ -0,0 +1,37 @@
+/*
+ * strings.h
+ *
+ * PSXSDK
+ */
+
+#ifndef _STRINGS_H
+#define _STRINGS_H
+
+#include <string.h>
+#include <types.h>
+
+#define bcopy(src,dst,len) memmove(dst,src,len)
+#define bzero(ptr, len) memset(ptr, 0, len)
+#define bcmp(b1,b2,len) memcmp(b1,b2,len)
+#define index(s, c) strchr(s, c)
+#define rindex(s, c) strrchr(s, c)
+
+int ffs(int value);
+char *index(const char *s, int c);
+char *rindex(const char *s, int c);
+
+/**
+ * Returns the number of bits set in the value
+ * @param value Value
+ * @return Number of bits set in value
+ */
+
+unsigned int popcount(unsigned int value);
+unsigned int popcountl(unsigned long value);
+unsigned int popcountll(unsigned long long value);
+unsigned int popcount32(uint32_t value);
+unsigned int popcount64(uint64_t value);
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t len);
+
+#endif