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