summaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-02-26 16:53:30 +0000
committerUlrich Drepper <drepper@redhat.com>2009-02-26 16:53:30 +0000
commit6cbe890a9d379d85fe849a8317010f05ace00809 (patch)
tree20155743e44ca4f276794e99ecbf49e8e7b05ea9 /string
parentf503060bbbba36d1bb1f1548682b8b08e8a2cc0f (diff)
* wctype/wctype.h: The *_l functions are in POSIX 2008.
* wcsmbs/wchar.h: mbsnrtowcs, open_wmemstream, wcpcpy, wcpncpy, wcscasecmp, wcsdup, wcsncasecmp, wcsnlen, wcsnrtombs, wcscasecmp_l, wcsncasecmp_l, wcscoll_l, and wcsxfrm_l. * sysdeps/mach/hurd/bits/posix_opt.h: Reset value of macros from 200112L to 200809L. * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise. * posix/getconf.c (vars): Add _SC_THREAD_ROBUST_PRIO_INHERIT and _SC_THREAD_ROBUST_PRIO_PROTECT entries. * bits/confname.h: Add _SC_THREAD_ROBUST_PRIO_INHERIT and _SC_THREAD_ROBUST_PRIO_PROTECT. * posix/unistd.h: fexecve is in POSIX 2008. * time/time.h: strftime_l is in POSIX 2008. * io/sys/stat.h: futimens is in POSIX 2008. * string/strings.h: strcasecmp_l and strncasecmp_l are in POSIX 2008. * string/string.h: stpcpy, stpncpy, strndup, strnlen, strsignal, strcoll_l, strerror_l, and strxfrm_l are in POSIX 2008. * stdlib/stdlib.h: mkdtemp is in POSIX 2008.
Diffstat (limited to 'string')
-rw-r--r--string/string.h20
-rw-r--r--string/strings.h17
2 files changed, 28 insertions, 9 deletions
diff --git a/string/string.h b/string/string.h
index 849255f75c..3c760092f0 100644
--- a/string/string.h
+++ b/string/string.h
@@ -154,7 +154,7 @@ extern size_t strxfrm (char *__restrict __dest,
__THROW __nonnull ((2));
__END_NAMESPACE_STD
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
/* The following functions are equivalent to the both above but they
take the locale they use for the collation as an extra argument.
This is not standardsized but something like will come. */
@@ -177,7 +177,7 @@ extern char *strdup (__const char *__s)
/* Return a malloc'd copy of at most N bytes of STRING. The
resultant string is terminated even if no null terminator
appears before STRING[N]. */
-#if defined __USE_GNU
+#if defined __USE_XOPEN2K8
extern char *strndup (__const char *__string, size_t __n)
__THROW __attribute_malloc__ __nonnull ((1));
#endif
@@ -398,7 +398,7 @@ extern size_t strlen (__const char *__s)
__THROW __attribute_pure__ __nonnull ((1));
__END_NAMESPACE_STD
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
/* Find the length of STRING, but scan at most MAXLEN characters.
If no '\0' terminator is found in that many characters, return MAXLEN. */
extern size_t strnlen (__const char *__string, size_t __maxlen)
@@ -438,7 +438,7 @@ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
# endif
#endif
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
/* Translate error number to string according to the locale L. */
extern char *strerror_l (int __errnum, __locale_t __l) __THROW;
#endif
@@ -559,11 +559,7 @@ extern char *strsep (char **__restrict __stringp,
__THROW __nonnull ((1, 2));
#endif
-#ifdef __USE_GNU
-/* Compare S1 and S2 as strings holding name & indices/version numbers. */
-extern int strverscmp (__const char *__s1, __const char *__s2)
- __THROW __attribute_pure__ __nonnull ((1, 2));
-
+#ifdef __USE_XOPEN2K8
/* Return a string describing the meaning of the signal number in SIG. */
extern char *strsignal (int __sig) __THROW;
@@ -581,6 +577,12 @@ extern char *__stpncpy (char *__restrict __dest,
extern char *stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n)
__THROW __nonnull ((1, 2));
+#endif
+
+#ifdef __USE_GNU
+/* Compare S1 and S2 as strings holding name & indices/version numbers. */
+extern int strverscmp (__const char *__s1, __const char *__s2)
+ __THROW __attribute_pure__ __nonnull ((1, 2));
/* Sautee STRING briskly. */
extern char *strfry (char *__string) __THROW __nonnull ((1));
diff --git a/string/strings.h b/string/strings.h
index 0db756ae56..16ab6b1c4d 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -113,6 +113,23 @@ extern int strcasecmp (__const char *__s1, __const char *__s2)
extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
__THROW __attribute_pure__;
+#ifdef __USE_XOPEN2K8
+/* The following functions are equivalent to the both above but they
+ take the locale they use for the collation as an extra argument.
+ This is not standardsized but something like will come. */
+# include <xlocale.h>
+
+/* Again versions of a few functions which use the given locale instead
+ of the global one. */
+extern int strcasecmp_l (__const char *__s1, __const char *__s2,
+ __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 3));
+
+extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+ size_t __n, __locale_t __loc)
+ __THROW __attribute_pure__ __nonnull ((1, 2, 4));
+#endif
+
__END_DECLS
#endif /* string.h */