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

Split Close
Expand all
Collapse all
          --- old/usr/src/head/wchar.h
          +++ new/usr/src/head/wchar.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  23   24   * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _WCHAR_H
  27   28  #define _WCHAR_H
  28   29  
  29   30  #include <sys/feature_tests.h>
  30   31  #include <iso/wchar_iso.h>
  31   32  #include <iso/wchar_c99.h>
  32   33  
↓ open down ↓ 127 lines elided ↑ open up ↑
 160  161  using std::iswctype;
 161  162  using std::towlower;
 162  163  using std::towupper;
 163  164  using std::wcswcs;
 164  165  using std::wcswidth;
 165  166  using std::wcwidth;
 166  167  using std::wctype;
 167  168  #endif
 168  169  #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
 169  170  
 170      -#if defined(__EXTENSIONS__) || \
 171      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 172      -        /* || defined(_XPG7) */
 173      -extern wchar_t *wcsdup(const wchar_t *);
      171 +#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
      172 +
      173 +#ifndef _LOCALE_T
      174 +#define _LOCALE_T
      175 +typedef struct locale *locale_t;
      176 +#endif
      177 +
 174  178  extern size_t wcsnlen(const wchar_t *, size_t);
 175  179  extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
 176  180  extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
 177  181      size_t);
      182 +extern size_t wcsxfrm_l(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
      183 +    size_t, locale_t);
      184 +extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
      185 +extern wchar_t *wcsdup(const wchar_t *);
 178  186  extern int wcscasecmp(const wchar_t *, const wchar_t *);
      187 +extern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
 179  188  extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
 180      -#endif
      189 +extern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
      190 +extern size_t mbsnrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
      191 +    size_t, size_t, mbstate_t *_RESTRICT_KYWD);
 181  192  
      193 +#endif  /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
      194 +
 182  195  #else /* __STDC__ */
 183  196  
 184  197  #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
 185  198  extern  int iswalpha();
 186  199  extern  int iswupper();
 187  200  extern  int iswlower();
 188  201  extern  int iswdigit();
 189  202  extern  int iswxdigit();
 190  203  extern  int iswalnum();
 191  204  extern  int iswspace();
↓ open down ↓ 3 lines elided ↑ open up ↑
 195  208  extern  int iswcntrl();
 196  209  extern  int iswctype();
 197  210  extern  wint_t towlower();
 198  211  extern  wint_t towupper();
 199  212  extern wchar_t *wcswcs();
 200  213  extern int wcswidth();
 201  214  extern int wcwidth();
 202  215  extern wctype_t wctype();
 203  216  #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
 204  217  
 205      -#if defined(__EXTENSIONS__) || \
 206      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 207      -        /* || defined(_XPG7) */
 208      -extern wchar_t *wcsdup();
      218 +#if defined(_XGP7) || !defined(_STRICT_SYMBOLS)
 209  219  extern size_t wcsnlen();
 210  220  extern wchar_t *wcpcpy();
 211  221  extern wchar_t *wcpncpy();
      222 +extern size_t wcsxfrm_l();
      223 +extern int wcscoll_l();
      224 +extern wchar_t *wcsdup();
 212  225  extern int wcscasecmp();
      226 +extern int wcscasecmp_l();
 213  227  extern int wcsncasecmp();
      228 +extern int wcsncasecmp_l();
      229 +extern size_t mbsnrtowcs();
 214  230  #endif
 215  231  
 216  232  #endif /* __STDC__ */
 217  233  
 218  234  #ifdef  __cplusplus
 219  235  }
 220  236  #endif
 221  237  
 222  238  #endif  /* _WCHAR_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX