aboutsummaryrefslogtreecommitdiffstats
path: root/strrcasechr_inv.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--strrcasechr_inv.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/strrcasechr_inv.c b/strrcasechr_inv.c
new file mode 100644
index 0000000..fea9f21
--- /dev/null
+++ b/strrcasechr_inv.c
@@ -0,0 +1,32 @@
+/* See LICENSE file for copyright and license details. */
+#include "libsimple.h"
+#ifndef TEST
+
+
+char *
+libsimple_strrcasechr_inv(const char *s_, int c) /* TODO test, man */
+{
+ char *s = *(char **)(void *)&s_, lc = (char)tolower(c), uc = (char)toupper(c), *r = NULL;
+ if (lc != uc) {
+ for (; *s; s++)
+ if (*s != lc && *s != uc)
+ r = s;
+ } else {
+ for (; *s; s++)
+ if (*s != lc)
+ r = s;
+ }
+ return r;
+}
+
+
+#else
+#include "test.h"
+
+int
+main(void)
+{
+ return 0;
+}
+
+#endif