Print this page
Fix compile errors, code review feedback, and add basic libc test suite.

Split Close
Expand all
Collapse all
          --- old/usr/src/head/xlocale.h
          +++ new/usr/src/head/xlocale.h
↓ open down ↓ 40 lines elided ↑ open up ↑
  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   48  typedef struct locale *locale_t;
  49   49  #endif
  50   50  
  51      -int mbsinit_l(const mbstate_t *, locale_t);
       51 +extern int mbsinit_l(const mbstate_t *, locale_t);
  52   52  
  53      -size_t mbsrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
       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      -size_t mbsnrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
       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      -char *strptime_l(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
       59 +extern char *strptime_l(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
  60   60      struct tm *_RESTRICT_KYWD, locale_t);
  61   61  
  62      -int wcwidth_l(wchar_t, locale_t);
       62 +extern int wcwidth_l(wchar_t, locale_t);
  63   63  
  64      -int wcswidth_l(const wchar_t *, size_t, locale_t);
       64 +extern int wcswidth_l(const wchar_t *, size_t, locale_t);
  65   65  
  66      -int iswspecial_l(wint_t, locale_t);
  67      -int iswnumber_l(wint_t, locale_t);
  68      -int iswhexnumber_l(wint_t, locale_t);
  69      -int iswideogram_l(wint_t, locale_t);
  70      -int iswphonogram_l(wint_t, locale_t);
       66 +extern int iswspecial_l(wint_t, locale_t);
       67 +extern int iswnumber_l(wint_t, locale_t);
       68 +extern int iswhexnumber_l(wint_t, locale_t);
       69 +extern int iswideogram_l(wint_t, locale_t);
       70 +extern int iswphonogram_l(wint_t, locale_t);
  71   71  
  72      -wint_t btowc_l(int, locale_t);
  73      -int wctob_l(wint_t, locale_t);
  74      -size_t mbrtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
       72 +extern wint_t btowc_l(int, locale_t);
       73 +extern int wctob_l(wint_t, locale_t);
       74 +extern size_t mbrtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
       75 +    size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
       76 +extern size_t mbstowcs_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
       77 +    size_t, locale_t);
       78 +extern int mblen_l(const char *, size_t, locale_t);
       79 +extern size_t mbrlen_l(const char *_RESTRICT_KYWD, size_t,
  75   80      mbstate_t *_RESTRICT_KYWD, locale_t);
  76      -size_t mbstowcs_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
       81 +extern int mbtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
  77   82      locale_t);
  78      -int mblen_l(const char *, size_t, locale_t);
  79      -size_t mbrlen_l(const char *_RESTRICT_KYWD, size_t, mbstate_t *_RESTRICT_KYWD,
  80      -    locale_t);
  81      -int mbtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
  82      -    locale_t);
  83      -size_t wcsrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
       83 +extern size_t wcsrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
  84   84      size_t len, mbstate_t *_RESTRICT_KYWD, locale_t);
  85      -size_t wcrtomb_l(char *_RESTRICT_KYWD, wchar_t, mbstate_t *_RESTRICT_KYWD,
  86      -    locale_t);
  87      -size_t wcstombs_l(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD, size_t,
  88      -    locale_t);
  89      -int wctomb_l(char *, wchar_t, locale_t);
       85 +extern size_t wcrtomb_l(char *_RESTRICT_KYWD, wchar_t,
       86 +    mbstate_t *_RESTRICT_KYWD, locale_t);
       87 +extern size_t wcstombs_l(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
       88 +    size_t, locale_t);
       89 +extern int wctomb_l(char *, wchar_t, locale_t);
  90   90  
  91      -unsigned char __mb_cur_max_l(locale_t);
       91 +extern unsigned char __mb_cur_max_l(locale_t);
  92   92  #ifndef MB_CUR_MAX_L
  93   93  #define MB_CUR_MAX_L(l) (__mb_cur_max_l(l))
  94   94  #endif
  95   95  
  96   96  
  97   97  #if defined(_XPG4) && !defined(_FILEDEFED) || __cplusplus >= 199711L
  98   98  #define _FILEDEFED
  99   99  typedef __FILE FILE;
 100  100  #endif
 101  101  
 102      -wint_t fgetwc_l(FILE *, locale_t);
 103      -wint_t getwc_l(FILE *, locale_t);
      102 +extern wint_t fgetwc_l(FILE *, locale_t);
      103 +extern wint_t getwc_l(FILE *, locale_t);
 104  104  
 105  105  #ifndef getwchar_l
 106  106  #define getwchar_l(l)   fgetwc_l(stdin, (l))
 107  107  #endif
 108  108  
 109  109  #ifdef __cplusplus
 110  110  }
 111  111  #endif
 112  112  
 113  113  #endif /* _XLOCALE_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX