summaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-09 14:31:31 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-09 14:31:31 -0500
commitae9f7ec577e7a8cfd474d7772eb31afd487ff099 (patch)
treedf9780238fc2e8227cc8d65e7b30e8dd28b66a16 /src/strings
parentdd20f8f7ca634d375c54c1f9d27a19bc8ca4f5e1 (diff)
merge XOPEN identifiers
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/bcmp.c10
-rw-r--r--src/strings/bcopy.c10
-rw-r--r--src/strings/bzero.c10
-rw-r--r--src/strings/ffs.c20
-rw-r--r--src/strings/index.c10
-rw-r--r--src/strings/rindex.c10
-rw-r--r--src/strings/strcasecmp.c11
-rw-r--r--src/strings/strncasecmp.c11
8 files changed, 92 insertions, 0 deletions
diff --git a/src/strings/bcmp.c b/src/strings/bcmp.c
new file mode 100644
index 00000000..0686ebdf
--- /dev/null
+++ b/src/strings/bcmp.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+int bcmp(const void *s1, const void *s2, size_t n)
+{
+ return 0;
+}
+
+/*
+XOPEN(400,700)
+*/
diff --git a/src/strings/bcopy.c b/src/strings/bcopy.c
new file mode 100644
index 00000000..0de75234
--- /dev/null
+++ b/src/strings/bcopy.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+int bcopy(const void *s1, void *s2, size_t n)
+{
+ return 0;
+}
+
+/*
+XOPEN(400,700)
+*/
diff --git a/src/strings/bzero.c b/src/strings/bzero.c
new file mode 100644
index 00000000..3d15579c
--- /dev/null
+++ b/src/strings/bzero.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+void bzero(void*s, size_t n)
+{
+ return 0;
+}
+
+/*
+XOPEN(400,700)
+*/
diff --git a/src/strings/ffs.c b/src/strings/ffs.c
new file mode 100644
index 00000000..7e29487d
--- /dev/null
+++ b/src/strings/ffs.c
@@ -0,0 +1,20 @@
+#include <strings.h>
+
+int ffs(int i)
+{
+ int bit = 0;
+
+ if (i == 0) {
+ return 0;
+ }
+
+ while (!(i & (1 << bit))) {
+ bit++;
+ }
+
+ return bit;
+}
+
+/*
+XOPEN(400)
+*/
diff --git a/src/strings/index.c b/src/strings/index.c
new file mode 100644
index 00000000..86e92b4a
--- /dev/null
+++ b/src/strings/index.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+char *index(const char *s, int c)
+{
+ return strchr(s, c);
+}
+
+/*
+XOPEN(400,700)
+*/
diff --git a/src/strings/rindex.c b/src/strings/rindex.c
new file mode 100644
index 00000000..17bae7e3
--- /dev/null
+++ b/src/strings/rindex.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+char *rindex(const char *s, int c)
+{
+ return strrchr(s, c);
+}
+
+/*
+XOPEN(400,700)
+*/
diff --git a/src/strings/strcasecmp.c b/src/strings/strcasecmp.c
new file mode 100644
index 00000000..e9006fe2
--- /dev/null
+++ b/src/strings/strcasecmp.c
@@ -0,0 +1,11 @@
+#include <strings.h>
+
+int strcasecmp(const char *s1, const char *s2)
+{
+ return strcasecmp_l (s1, s2, (locale_t)0);
+}
+
+/*
+XOPEN(400)
+POSIX(200809)
+*/
diff --git a/src/strings/strncasecmp.c b/src/strings/strncasecmp.c
new file mode 100644
index 00000000..8094ccd2
--- /dev/null
+++ b/src/strings/strncasecmp.c
@@ -0,0 +1,11 @@
+#include <strings.h>
+
+int strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ return strncasecmp_l (s1, s2, n, (locale_t)0);
+}
+
+/*
+XOPEN(400)
+POSIX(200809)
+*/