os/ossrv/stdcpp/src/c_locale_stub.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2  * Copyright (c) 1999
     3  * Silicon Graphics Computer Systems, Inc.
     4  *
     5  * Copyright (c) 1999 
     6  * Boris Fomitchev
     7  *
     8  * This material is provided "as is", with absolutely no warranty expressed
     9  * or implied. Any use is at your own risk.
    10  *
    11  * Permission to use or copy this software for any purpose is hereby granted 
    12  * without fee, provided the above notices are retained on all copies.
    13  * Permission to modify the code and to distribute modified code is granted,
    14  * provided the above notices are retained, and a notice that the code was
    15  * modified is included with the above copyright notice.
    16  *
    17  */ 
    18 # include "stlport_prefix.h"
    19 #include "c_locale.h"
    20 #include <limits.h>
    21 
    22 # ifdef _STLP_REAL_LOCALE_IMPLEMENTED
    23 
    24 // here, we'll put C locale implementation for those compilers where
    25 // it has to be done in C++
    26 
    27 # else
    28 
    29 /* This is a "stub" implementation of the "c_locale.h" interface,
    30    intended for operating systems where we have not yet written
    31    a real implementation.  A C++ library using this stub implementation
    32    is still standard-conforming, since the C++ standard does not require
    33    that any locales other than "C" be supported.
    34 */
    35 
    36 /* Framework functions */
    37 
    38 struct _Locale_ctype    /* { } */ ;
    39 struct _Locale_numeric  /* { } */;
    40 struct _Locale_time      /* { } */;
    41 struct _Locale_collate   /*{ } */;
    42 struct _Locale_monetary  /* { } */;
    43 struct _Locale_messages  /* { } */;
    44 
    45 # ifdef __cplusplus
    46 _STLP_BEGIN_NAMESPACE
    47 extern "C" {
    48 # define __DUMMY_PAR
    49 # define __DUMMY_PAR1
    50 # define __DUMMY_PAR2
    51 # define __DUMMY_PAR3
    52 # define __DUMMY_PAR4
    53 # define __DUMMY_PAR5
    54 # define __DUMMY_PAR6
    55 # define __DUMMY_PAR7
    56 # define __DUMMY_PAR8
    57 # endif
    58     
    59  void* _Locale_ctype_create(const char * __DUMMY_PAR)
    60   { return 0; }
    61  void* _Locale_numeric_create(const char * __DUMMY_PAR)
    62   { return 0; }
    63  void*_Locale_time_create(const char * __DUMMY_PAR)
    64   { return 0; }
    65  void* _Locale_collate_create(const char *__DUMMY_PAR)
    66   { return 0; }
    67  void* _Locale_monetary_create(const char * __DUMMY_PAR)
    68   { return 0; }
    69  void* _Locale_messages_create(const char *__DUMMY_PAR)
    70   { return 0; }
    71 
    72  const char* _Locale_ctype_default(char*)    { return 0; }
    73  const char* _Locale_numeric_default(char *) { return 0; }
    74  const char* _Locale_time_default(char*)     { return 0; }
    75  const char* _Locale_collate_default(char*)  { return 0; }
    76  const char* _Locale_monetary_default(char*) { return 0; }
    77  const char* _Locale_messages_default(char*) { return 0; }
    78 
    79  char* _Locale_ctype_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    80   { return 0; }
    81  char* _Locale_numeric_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    82   { return 0; }
    83  char* _Locale_time_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    84   { return 0; }
    85  char* _Locale_collate_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    86   { return 0; }
    87  char* _Locale_monetary_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    88   { return 0; }
    89  char* _Locale_messages_name(const void* __DUMMY_PAR1, char* __DUMMY_PAR)
    90   { return 0; }
    91 
    92  void _Locale_ctype_destroy(void* __DUMMY_PAR)    {}
    93  void _Locale_numeric_destroy(void* __DUMMY_PAR)  {}
    94  void _Locale_time_destroy(void* __DUMMY_PAR)     {}
    95  void _Locale_collate_destroy(void* __DUMMY_PAR)  {}
    96  void _Locale_monetary_destroy(void* __DUMMY_PAR) {}
    97  void _Locale_messages_destroy(void* __DUMMY_PAR) {}
    98 
    99  char* _Locale_extract_ctype_name(const char* __DUMMY_PAR1, char* __DUMMY_PAR) 
   100   { return 0; }
   101  char* _Locale_extract_numeric_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR) 
   102   { return 0; }
   103  char* _Locale_extract_time_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR) 
   104   { return 0; }
   105  char* _Locale_extract_collate_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR) 
   106   { return 0; }
   107  char* _Locale_extract_monetary_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR) 
   108   { return 0; }
   109  char* _Locale_extract_messages_name(const char*__DUMMY_PAR1, char* __DUMMY_PAR) 
   110   { return 0; }
   111 
   112  char* _Locale_compose_name(char*__DUMMY_PAR1, const char*__DUMMY_PAR2, const char*__DUMMY_PAR3,
   113                             const char*__DUMMY_PAR4,
   114                             const char*__DUMMY_PAR5, const char*__DUMMY_PAR6, const char*__DUMMY_PAR7, const char*__DUMMY_PAR8)
   115   { return 0; }
   116 
   117 
   118 /* ctype */
   119 
   120 const  _Locale_mask_t* _Locale_ctype_table(struct _Locale_ctype* __DUMMY_PAR)
   121   { return 0; }
   122  int _Locale_toupper(struct _Locale_ctype*__DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
   123  int _Locale_tolower(struct _Locale_ctype*__DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
   124 
   125 # ifndef _STLP_NO_WCHAR_T
   126  _Locale_mask_t _Locale_wchar_ctype(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR2, _Locale_mask_t __DUMMY_PAR3)
   127   { return 0; }
   128  wint_t _Locale_wchar_tolower(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR)
   129   { return 0; }
   130  wint_t _Locale_wchar_toupper(struct _Locale_ctype*__DUMMY_PAR1, wint_t __DUMMY_PAR)
   131   { return 0; }
   132 # endif
   133 
   134 # ifndef _STLP_NO_MBSTATE_T
   135 
   136  int _Locale_mb_cur_max (struct _Locale_ctype * __DUMMY_PAR) { return 0; }
   137  int _Locale_mb_cur_min (struct _Locale_ctype * __DUMMY_PAR) { return 0; }
   138  int _Locale_is_stateless (struct _Locale_ctype * __DUMMY_PAR) { return 1; }
   139 #ifndef _STLP_NO_WCHAR_T
   140  wint_t _Locale_btowc(struct _Locale_ctype * __DUMMY_PAR1, int __DUMMY_PAR) { return 0; }
   141  int _Locale_wctob(struct _Locale_ctype * __DUMMY_PAR2, wint_t __DUMMY_PAR) { return 0; }
   142 
   143  size_t _Locale_mbtowc(struct _Locale_ctype *__DUMMY_PAR1,
   144                                  wchar_t *__DUMMY_PAR2,
   145                                  const char *__DUMMY_PAR3, size_t __DUMMY_PAR4,
   146                                  mbstate_t *__DUMMY_PAR5) {
   147   return (size_t) -1; 
   148 }
   149  size_t _Locale_wctomb(struct _Locale_ctype *__DUMMY_PAR1,
   150                                  char *__DUMMY_PAR2, size_t __DUMMY_PAR3,
   151                                  const wchar_t __DUMMY_PAR4,
   152                                  mbstate_t *__DUMMY_PAR5) {
   153   return (size_t) -1;
   154 }
   155 # endif
   156 
   157  size_t _Locale_unshift(struct _Locale_ctype *__DUMMY_PAR1,
   158                                   mbstate_t *__DUMMY_PAR2,
   159                                   char *__DUMMY_PAR3, size_t __DUMMY_PAR4, char ** __DUMMY_PAR5) {
   160   return (size_t) -1;
   161 }
   162 
   163 # endif /*  _STLP_NO_MBSTATE_T */
   164 
   165 
   166 /* Collate */
   167  int _Locale_strcmp(struct _Locale_collate* __DUMMY_PAR1,
   168                     const char* __DUMMY_PAR2, size_t __DUMMY_PAR3, const char* __DUMMY_PAR4,
   169                     size_t __DUMMY_PAR5) {
   170   return 0;
   171 }
   172 
   173 # ifndef _STLP_NO_WCHAR_T
   174 
   175  int _Locale_strwcmp(struct _Locale_collate* __DUMMY_PAR1,
   176                      const wchar_t* __DUMMY_PAR2, size_t __DUMMY_PAR3,
   177                      const wchar_t* __DUMMY_PAR4, size_t __DUMMY_PAR5) {
   178   return 0;
   179 }
   180 
   181 # endif
   182 
   183  size_t _Locale_strxfrm(struct _Locale_collate* __DUMMY_PAR1,
   184                         char* __DUMMY_PAR2, size_t __DUMMY_PAR3,
   185                         const char* __DUMMY_PAR4, size_t __DUMMY_PAR5) {
   186   return 0;
   187 }
   188 
   189 # ifndef _STLP_NO_WCHAR_T
   190 
   191   size_t _Locale_strwxfrm(struct _Locale_collate* __DUMMY_PAR1,
   192                           wchar_t* __DUMMY_PAR2, size_t __DUMMY_PAR3,
   193                           const wchar_t* __DUMMY_PAR4, size_t __DUMMY_PAR5)
   194 {
   195   return 0;
   196 }
   197 
   198 # endif
   199 
   200 /* Numeric */
   201 
   202  char _Locale_decimal_point(struct _Locale_numeric* __DUMMY_PAR) { return '.'; }
   203  char _Locale_thousands_sep(struct _Locale_numeric* __DUMMY_PAR) { return ','; }
   204  const char* _Locale_grouping(struct _Locale_numeric * __DUMMY_PAR) 
   205   { return ""; }
   206 
   207  const char * _Locale_true(struct _Locale_numeric * __DUMMY_PAR)  { return 0; }
   208  const char * _Locale_false(struct _Locale_numeric * __DUMMY_PAR) { return 0; }
   209 
   210 
   211 /* Monetary */
   212 
   213  const char* _Locale_int_curr_symbol(struct _Locale_monetary * __DUMMY_PAR)
   214   { return 0; }
   215  const char* _Locale_currency_symbol(struct _Locale_monetary * __DUMMY_PAR)
   216   { return 0; }
   217  char        _Locale_mon_decimal_point(struct _Locale_monetary * __DUMMY_PAR)
   218   { return '.'; }
   219  char        _Locale_mon_thousands_sep(struct _Locale_monetary * __DUMMY_PAR)
   220   { return ','; }
   221  const char* _Locale_mon_grouping(struct _Locale_monetary * __DUMMY_PAR)
   222   { return ""; }
   223  const char* _Locale_positive_sign(struct _Locale_monetary * __DUMMY_PAR)
   224   { return ""; }
   225  const char* _Locale_negative_sign(struct _Locale_monetary * __DUMMY_PAR)
   226   { return ""; }
   227  char        _Locale_int_frac_digits(struct _Locale_monetary * __DUMMY_PAR)
   228   { return CHAR_MAX; }
   229  char        _Locale_frac_digits(struct _Locale_monetary * __DUMMY_PAR)
   230   { return CHAR_MAX; }
   231  int         _Locale_p_cs_precedes(struct _Locale_monetary * __DUMMY_PAR)
   232   { return CHAR_MAX; }
   233  int         _Locale_p_sep_by_space(struct _Locale_monetary * __DUMMY_PAR)
   234   { return CHAR_MAX; }
   235  int         _Locale_p_sign_posn(struct _Locale_monetary * __DUMMY_PAR)
   236   { return CHAR_MAX; }
   237  int         _Locale_n_cs_precedes(struct _Locale_monetary * __DUMMY_PAR)
   238   { return CHAR_MAX; }
   239  int          _Locale_n_sep_by_space(struct _Locale_monetary * __DUMMY_PAR)
   240   { return CHAR_MAX; }
   241  int          _Locale_n_sign_posn(struct _Locale_monetary * __DUMMY_PAR)
   242   { return CHAR_MAX; }
   243 
   244 
   245 /* Time */
   246  const char * _Locale_full_monthname(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
   247   { return 0; }
   248  const char * _Locale_abbrev_monthname(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
   249   { return 0; }
   250  const char * _Locale_full_dayofweek(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
   251   { return 0; }
   252  const char * _Locale_abbrev_dayofweek(struct _Locale_time * __DUMMY_PAR1, int __DUMMY_PAR2)
   253   { return 0; }
   254 
   255  const char* _Locale_d_t_fmt(struct _Locale_time* __DUMMY_PAR)    { return 0; }
   256  const char* _Locale_d_fmt(struct _Locale_time* __DUMMY_PAR)      { return 0; }
   257  const char* _Locale_t_fmt(struct _Locale_time* __DUMMY_PAR)      { return 0; }
   258  const char* _Locale_long_d_t_fmt(struct _Locale_time* __DUMMY_PAR){ return 0; }
   259  const char* _Locale_long_d_fmt(struct _Locale_time* __DUMMY_PAR)   { return 0; }
   260  const char* _Locale_am_str(struct _Locale_time* __DUMMY_PAR)     { return 0; }
   261  const char* _Locale_pm_str(struct _Locale_time* __DUMMY_PAR)     { return 0; }
   262  const char* _Locale_t_fmt_ampm(struct _Locale_time* __DUMMY_PAR) { return 0; }
   263 
   264 /* Messages */
   265 
   266  int _Locale_catopen(struct _Locale_messages* __DUMMY_PAR1, const char* __DUMMY_PAR)
   267   { return -1; }
   268  void _Locale_catclose(struct _Locale_messages* __DUMMY_PAR1, int __DUMMY_PAR) {}
   269  const char* _Locale_catgets(struct _Locale_messages* __DUMMY_PAR1, int __DUMMY_PAR2,
   270                                        int __DUMMY_PAR3, int __DUMMY_PAR4,
   271                                        const char *dfault)
   272   { return dfault; }
   273 
   274 #ifdef __cplusplus    
   275 } /* extern C */
   276 _STLP_END_NAMESPACE
   277 #endif
   278 
   279 #endif /* real locale */