Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>
   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*

  13  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 /*
  17  * LC_MONETARY database generation routines for localedef.
  18  */
  19 
  20 #include <stdio.h>
  21 #include <stdlib.h>
  22 #include <errno.h>
  23 #include <sys/types.h>
  24 #include <string.h>
  25 #include <unistd.h>
  26 #include "localedef.h"
  27 #include "parser.tab.h"
  28 #include "lmonetary.h"
  29 
  30 static struct lc_monetary_T mon;
  31 
  32 void
  33 init_monetary(void)
  34 {
  35         (void) memset(&mon, 0, sizeof (mon));
  36 }
  37 
  38 void
  39 add_monetary_str(wchar_t *wcs)
  40 {
  41         char *str;
  42 
  43         if ((str = to_mb_string(wcs)) == NULL) {
  44                 INTERR;
  45                 return;
  46         }
  47         free(wcs);
  48         switch (last_kw) {
  49         case T_INT_CURR_SYMBOL:
  50                 mon.int_curr_symbol = str;


   1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2013 Garrett D'Amore <garrett@damore.org>
  14  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  15  */
  16 
  17 /*
  18  * LC_MONETARY database generation routines for localedef.
  19  */
  20 
  21 #include <stdio.h>
  22 #include <stdlib.h>
  23 #include <errno.h>
  24 #include <sys/types.h>
  25 #include <string.h>
  26 #include <unistd.h>
  27 #include "localedef.h"
  28 #include "parser.tab.h"
  29 #include "lmonetary.h"
  30 
  31 static struct lc_monetary mon;
  32 
  33 void
  34 init_monetary(void)
  35 {
  36         (void) memset(&mon, 0, sizeof (mon));
  37 }
  38 
  39 void
  40 add_monetary_str(wchar_t *wcs)
  41 {
  42         char *str;
  43 
  44         if ((str = to_mb_string(wcs)) == NULL) {
  45                 INTERR;
  46                 return;
  47         }
  48         free(wcs);
  49         switch (last_kw) {
  50         case T_INT_CURR_SYMBOL:
  51                 mon.int_curr_symbol = str;