Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/locale/mbsinit.c
          +++ new/usr/src/lib/libc/port/locale/mbsinit.c
   1    1  /*
   2      - * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
   3      - * Copyright (c) 2002-2004 Tim J. Robbins.
   4      - * All rights reserved.
        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.
   5    6   *
   6      - * Redistribution and use in source and binary forms, with or without
   7      - * modification, are permitted provided that the following conditions
   8      - * are met:
   9      - * 1. Redistributions of source code must retain the above copyright
  10      - *    notice, this list of conditions and the following disclaimer.
  11      - * 2. Redistributions in binary form must reproduce the above copyright
  12      - *    notice, this list of conditions and the following disclaimer in the
  13      - *    documentation and/or other materials provided with the distribution.
  14      - *
  15      - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16      - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17      - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18      - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  19      - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20      - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21      - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22      - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23      - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24      - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25      - * SUCH DAMAGE.
        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.
  26   10   */
  27   11  
       12 +/*
       13 + * Copyright 2013 Garrett D'Amore <garrett@damore.org>
       14 + */
       15 +
  28   16  #include "lint.h"
  29      -#include <wchar.h>
  30      -#include "mblocal.h"
       17 +#include <locale.h>
       18 +#include "localeimpl.h"
       19 +#include "lctype.h"
  31   20  
  32   21  int
  33      -mbsinit(const mbstate_t *ps)
       22 +mbsinit_l(const mbstate_t *s, locale_t loc)
  34   23  {
       24 +        return (loc->ctype->lc_mbsinit(s));
       25 +}
  35   26  
  36      -        return (__mbsinit(ps));
       27 +int
       28 +mbsinit(const mbstate_t *s)
       29 +{
       30 +        return (mbsinit_l(s, uselocale(NULL)));
  37   31  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX