Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
 
 /*
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 #ifndef _WCHAR_H
 #define _WCHAR_H

@@ -165,22 +166,34 @@
 using std::wcwidth;
 using std::wctype;
 #endif
 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
 
-#if defined(__EXTENSIONS__) || \
-        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
-        /* || defined(_XPG7) */
-extern wchar_t *wcsdup(const wchar_t *);
+#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
+
+#ifndef _LOCALE_T
+#define _LOCALE_T
+typedef struct locale *locale_t;
+#endif
+
 extern size_t wcsnlen(const wchar_t *, size_t);
 extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
 extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
     size_t);
+extern size_t wcsxfrm_l(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
+    size_t, locale_t);
+extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
+extern wchar_t *wcsdup(const wchar_t *);
 extern int wcscasecmp(const wchar_t *, const wchar_t *);
+extern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
-#endif
+extern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
+extern size_t mbsnrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
+    size_t, size_t, mbstate_t *_RESTRICT_KYWD);
 
+#endif  /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
+
 #else /* __STDC__ */
 
 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
 extern  int iswalpha();
 extern  int iswupper();

@@ -200,19 +213,22 @@
 extern int wcswidth();
 extern int wcwidth();
 extern wctype_t wctype();
 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
 
-#if defined(__EXTENSIONS__) || \
-        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
-        /* || defined(_XPG7) */
-extern wchar_t *wcsdup();
+#if defined(_XGP7) || !defined(_STRICT_SYMBOLS)
 extern size_t wcsnlen();
 extern wchar_t *wcpcpy();
 extern wchar_t *wcpncpy();
+extern size_t wcsxfrm_l();
+extern int wcscoll_l();
+extern wchar_t *wcsdup();
 extern int wcscasecmp();
+extern int wcscasecmp_l();
 extern int wcsncasecmp();
+extern int wcsncasecmp_l();
+extern size_t mbsnrtowcs();
 #endif
 
 #endif /* __STDC__ */
 
 #ifdef  __cplusplus