aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-02 20:00:18 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-02 20:00:18 +0200
commitcec10062d823eb05697eb956235d4ec66ee65e92 (patch)
treec734f21528637a27c20e2ed3a6576c6a0ca5a149 /include
parentfix some warnings and errors (diff)
downloadslibc-cec10062d823eb05697eb956235d4ec66ee65e92.tar.gz
slibc-cec10062d823eb05697eb956235d4ec66ee65e92.tar.bz2
slibc-cec10062d823eb05697eb956235d4ec66ee65e92.tar.xz
add memcasecmp and wmemcasecmp
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'include')
-rw-r--r--include/string.h17
-rw-r--r--include/wchar.h17
2 files changed, 34 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h
index 53aaca6..d1eedd0 100644
--- a/include/string.h
+++ b/include/string.h
@@ -727,6 +727,23 @@ void* memdup(const void*, size_t)
int memcmp(const void*, const void*, size_t)
__GCC_ONLY(__attribute__((warn_unused_result, pure)));
+#if defined(_SLIBC_SOURCE) && !defined(__PORTABLE)
+/**
+ * Compare two memory segments alphabetically in a case insensitive manner.
+ *
+ * This is a slibc extension added because it was useful
+ * in implementing slibc itself.
+ *
+ * @param a A negative value is returned if this is the lesser.
+ * @param b A positive value is returned if this is the lesser.
+ * @param size The size of the segments.
+ * @return Zero is returned if `a` and `b` are equal, otherwise,
+ * see the specifications for `a` and `b`.
+ */
+int memcasecmp(const void*, const void*, size_t)
+ __GCC_ONLY(__attribute__((warn_unused_result, pure)));
+#endif
+
/**
* Compare two strings alphabetically in a case sensitive manner.
*
diff --git a/include/wchar.h b/include/wchar.h
index 755b583..2b757ca 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -658,6 +658,23 @@ wchar_t* wmemdup(const wchar_t*, size_t)
int wmemcmp(const wchar_t*, const wchar_t*, size_t)
__GCC_ONLY(__attribute__((warn_unused_result, pure)));
+#if defined(_SLIBC_SOURCE) && !defined(__PORTABLE)
+/**
+ * Compare two memory segments alphabetically in a case insensitive manner.
+ *
+ * This is a slibc extension added because it was useful
+ * in implementing slibc itself.
+ *
+ * @param a A negative value is returned if this is the lesser.
+ * @param b A positive value is returned if this is the lesser.
+ * @param size The size of the segments.
+ * @return Zero is returned if `a` and `b` are equal, otherwise,
+ * see the specifications for `a` and `b`.
+ */
+int wmemcasecmp(const wchar_t*, const wchar_t*, size_t)
+ __GCC_ONLY(__attribute__((warn_unused_result, pure)));
+#endif
+
/**
* Compare two strings alphabetically in a case sensitive manner.
*