Print this page
2964 need POSIX 2008 locale object support

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/locale/lnumeric.c
          +++ new/usr/src/lib/libc/port/locale/lnumeric.c
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29  #include <limits.h>
  30   30  #include "ldpart.h"
  31   31  #include "lnumeric.h"
  32   32  #include "../i18n/_locale.h"
  33   33  
  34   34  extern int __nlocale_changed;
  35   35  extern const char *__fix_locale_grouping_str(const char *);
  36   36  
  37   37  #define LCNUMERIC_SIZE (sizeof (struct lc_numeric_T) / sizeof (char *))
  38   38  
       39 +struct xlocale_numeric __xlocale_global_numeric;
       40 +
  39   41  static char     numempty[] = { CHAR_MAX, '\0' };
  40   42  
  41   43  static const struct lc_numeric_T _C_numeric_locale = {
  42   44          ".",            /* decimal_point */
  43   45          "",             /* thousands_sep */
  44   46          numempty        /* grouping */
  45   47  };
  46   48  
  47   49  static struct lc_numeric_T _numeric_locale;
  48   50  static int      _numeric_using_locale;
↓ open down ↓ 21 lines elided ↑ open up ↑
  70   72                  _numeric_locale.grouping =
  71   73                      __fix_locale_grouping_str(_numeric_locale.grouping);
  72   74                  leg = (const struct lc_numeric_T *)&_numeric_locale;
  73   75          }
  74   76          /* This is Solaris legacy, required for ABI compatability */
  75   77          _numeric[0] = *leg->decimal_point;
  76   78          _numeric[1] = *leg->grouping;
  77   79          return (ret);
  78   80  }
  79   81  
       82 +void *
       83 +__numeric_load(const char *name, locale_t l)
       84 +{
       85 +        struct xlocale_numeric *new;
       86 +
       87 +        new = calloc(sizeof(struct xlocale_numeric), 1);
       88 +
       89 +        /* XXX */
       90 +
       91 +        return (new);
       92 +}
       93 +
  80   94  struct lc_numeric_T *
  81   95  __get_current_numeric_locale(void)
  82   96  {
  83   97          return (_numeric_using_locale ? &_numeric_locale :
  84   98              (struct lc_numeric_T *)&_C_numeric_locale);
  85   99  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX