Print this page
    
2964 need POSIX 2008 locale object support (more C++ fixes)
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/head/xlocale.h
          +++ new/usr/src/head/xlocale.h
   1    1  /*
   2    2   * This file and its contents are supplied under the terms of the
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  14   14   */
  15   15  
  16   16  #ifndef _XLOCALE_H
  17   17  #define _XLOCALE_H
  18   18  
  19   19  /*
  20   20   * This file supplies declarations for extended locale routines, as
  21   21   * originally delivered by MacOS X.  Many of these things are now
  22   22   * officially part of XPG7.  (Note that while the interfaces are the
  23   23   * same as MacOS X, there is no shared implementation.)
  24   24   *
  25   25   * Those declarations that are part of XPG7 are provided for the in the
  26   26   * XPG7-specified location.  This file lists just the declarations that
  27   27   * were not part of the standard.  These will be useful in their own right,
  28   28   * and will aid porting programs that don't strictly follow the standard.
  29   29   *
  30   30   * Note that it is an error to include this file in a program with strict
  31   31   * symbol visibilty rules (under strict ANSI or POSIX_C_SOURCE rules.)
  32   32   * If this is done, the symbols defined here will indeed be exposed to your
  33   33   * program, but those symbols that are part of the related standards might
  34   34   * not be.
  35   35   */
  36   36  
  37   37  #include <sys/feature_tests.h>
  
    | 
      ↓ open down ↓ | 
    37 lines elided | 
    
      ↑ open up ↑ | 
  
  38   38  #include <wchar.h>
  39   39  #include <locale.h>
  40   40  #include <stdio.h>
  41   41  
  42   42  #ifdef __cplusplus
  43   43  extern "C" {
  44   44  #endif
  45   45  
  46   46  #ifndef _LOCALE_T
  47   47  #define _LOCALE_T
  48      -typedef struct locale *locale_t;
       48 +typedef struct _locale *locale_t;
  49   49  #endif
  50   50  
  51   51  extern int mbsinit_l(const mbstate_t *, locale_t);
  52   52  
  53   53  extern size_t mbsrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
  54   54      size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
  55   55  
  56   56  extern size_t mbsnrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
  57   57      size_t, size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
  58   58  
  59   59  extern char *strptime_l(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
  60   60      struct tm *_RESTRICT_KYWD, locale_t);
  61   61  
  62   62  extern int wcwidth_l(wchar_t, locale_t);
  63   63  
  64   64  extern int wcswidth_l(const wchar_t *, size_t, locale_t);
  65   65  
  66   66  extern int iswspecial_l(wint_t, locale_t);
  67   67  extern int iswnumber_l(wint_t, locale_t);
  68   68  extern int iswhexnumber_l(wint_t, locale_t);
  69   69  extern int iswideogram_l(wint_t, locale_t);
  70   70  extern int iswphonogram_l(wint_t, locale_t);
  71   71  
  72   72  extern wint_t btowc_l(int, locale_t);
  73   73  extern int wctob_l(wint_t, locale_t);
  74   74  extern size_t mbrtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
  75   75      size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
  76   76  extern size_t mbstowcs_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
  77   77      size_t, locale_t);
  78   78  extern int mblen_l(const char *, size_t, locale_t);
  79   79  extern size_t mbrlen_l(const char *_RESTRICT_KYWD, size_t,
  80   80      mbstate_t *_RESTRICT_KYWD, locale_t);
  81   81  extern int mbtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
  82   82      locale_t);
  83   83  extern size_t wcsrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
  84   84      size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
  85   85  extern size_t wcsnrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
  86   86      size_t, size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
  87   87  extern size_t wcrtomb_l(char *_RESTRICT_KYWD, wchar_t,
  88   88      mbstate_t *_RESTRICT_KYWD, locale_t);
  89   89  extern size_t wcstombs_l(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
  90   90      size_t, locale_t);
  91   91  extern int wctomb_l(char *, wchar_t, locale_t);
  92   92  
  93   93  extern unsigned char __mb_cur_max_l(locale_t);
  94   94  #ifndef MB_CUR_MAX_L
  95   95  #define MB_CUR_MAX_L(l) (__mb_cur_max_l(l))
  96   96  #endif
  97   97  
  98   98  
  99   99  #if defined(_XPG4) && !defined(_FILEDEFED) || __cplusplus >= 199711L
 100  100  #define _FILEDEFED
 101  101  typedef __FILE FILE;
 102  102  #endif
 103  103  
 104  104  extern wint_t fgetwc_l(FILE *, locale_t);
 105  105  extern wint_t getwc_l(FILE *, locale_t);
 106  106  
 107  107  #ifndef getwchar_l
 108  108  #define getwchar_l(l)   fgetwc_l(stdin, (l))
 109  109  #endif
 110  110  
 111  111  #ifdef __cplusplus
 112  112  }
 113  113  #endif
 114  114  
 115  115  #endif /* _XLOCALE_H */
  
    | 
      ↓ open down ↓ | 
    57 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX