17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 237c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 27*2d08521bSGarrett D'Amore /* 28*2d08521bSGarrett D'Amore * Copyright 2013 Garrett D'Amore <garrett@damore.org> 29*2d08521bSGarrett D'Amore * 30*2d08521bSGarrett D'Amore * Portions of this file developed by Garrett D'Amore are licensed 31*2d08521bSGarrett D'Amore * under the terms of the Common Development and Distribution License (CDDL) 32*2d08521bSGarrett D'Amore * version 1.0 only. The use of subsequent versions of the License are 33*2d08521bSGarrett D'Amore * is specifically prohibited unless those terms are not in conflict with 34*2d08521bSGarrett D'Amore * version 1.0 of the License. You can find this license on-line at 35*2d08521bSGarrett D'Amore * http://www.illumos.org/license/CDDL 36*2d08521bSGarrett D'Amore */ 37*2d08521bSGarrett D'Amore 387c478bd9Sstevel@tonic-gate #ifndef _LOCALE_H 397c478bd9Sstevel@tonic-gate #define _LOCALE_H 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #include <iso/locale_iso.h> 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ 447c478bd9Sstevel@tonic-gate defined(__EXTENSIONS__) 457c478bd9Sstevel@tonic-gate #include <libintl.h> 467c478bd9Sstevel@tonic-gate #endif 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* 497c478bd9Sstevel@tonic-gate * Allow global visibility for symbols defined in 507c478bd9Sstevel@tonic-gate * C++ "std" namespace in <iso/locale_iso.h>. 517c478bd9Sstevel@tonic-gate */ 527c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L 537c478bd9Sstevel@tonic-gate using std::lconv; 547c478bd9Sstevel@tonic-gate using std::setlocale; 557c478bd9Sstevel@tonic-gate using std::localeconv; 567c478bd9Sstevel@tonic-gate #endif 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate #ifdef __cplusplus 597c478bd9Sstevel@tonic-gate extern "C" { 607c478bd9Sstevel@tonic-gate #endif 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate #define _LastCategory LC_MESSAGES /* This must be last category */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate #define _ValidCategory(c) \ 657c478bd9Sstevel@tonic-gate (((int)(c) >= LC_CTYPE) && ((int)(c) <= _LastCategory) || \ 667c478bd9Sstevel@tonic-gate ((int)c == LC_ALL)) 677c478bd9Sstevel@tonic-gate 68*2d08521bSGarrett D'Amore 69*2d08521bSGarrett D'Amore #if defined(_XPG7) || !defined(_STRICT_SYMBOLS) 70*2d08521bSGarrett D'Amore 71*2d08521bSGarrett D'Amore /* 72*2d08521bSGarrett D'Amore * These were added in POSIX 2008 as part of the newlocale() specification. 73*2d08521bSGarrett D'Amore */ 74*2d08521bSGarrett D'Amore #define LC_CTYPE_MASK (1 << LC_CTYPE) 75*2d08521bSGarrett D'Amore #define LC_NUMERIC_MASK (1 << LC_NUMERIC) 76*2d08521bSGarrett D'Amore #define LC_TIME_MASK (1 << LC_TIME) 77*2d08521bSGarrett D'Amore #define LC_COLLATE_MASK (1 << LC_COLLATE) 78*2d08521bSGarrett D'Amore #define LC_MONETARY_MASK (1 << LC_MONETARY) 79*2d08521bSGarrett D'Amore #define LC_MESSAGES_MASK (1 << LC_MESSAGES) 80*2d08521bSGarrett D'Amore #define LC_ALL_MASK (0x3f) 81*2d08521bSGarrett D'Amore 82*2d08521bSGarrett D'Amore #ifndef _LOCALE_T 83*2d08521bSGarrett D'Amore #define _LOCALE_T 84*2d08521bSGarrett D'Amore typedef struct locale *locale_t; 85*2d08521bSGarrett D'Amore #endif 86*2d08521bSGarrett D'Amore 87*2d08521bSGarrett D'Amore #if defined(__STDC__) 88*2d08521bSGarrett D'Amore extern locale_t duplocale(locale_t); 89*2d08521bSGarrett D'Amore extern void freelocale(locale_t); 90*2d08521bSGarrett D'Amore extern locale_t newlocale(int, const char *, locale_t); 91*2d08521bSGarrett D'Amore extern locale_t uselocale(locale_t); 92*2d08521bSGarrett D'Amore #else /* __STDC__ */ 93*2d08521bSGarrett D'Amore extern locale_t duplocale(); 94*2d08521bSGarrett D'Amore extern void freelocale(); 95*2d08521bSGarrett D'Amore extern locale_t newlocale(); 96*2d08521bSGarrett D'Amore extern locale_t uselocale(); 97*2d08521bSGarrett D'Amore #endif /* __STDC__ */ 98*2d08521bSGarrett D'Amore 99*2d08521bSGarrett D'Amore #define LC_GLOBAL_LOCALE (__global_locale()) 100*2d08521bSGarrett D'Amore extern locale_t __global_locale(void); 101*2d08521bSGarrett D'Amore 102*2d08521bSGarrett D'Amore #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */ 103*2d08521bSGarrett D'Amore 1047c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1057c478bd9Sstevel@tonic-gate } 1067c478bd9Sstevel@tonic-gate #endif 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate #endif /* _LOCALE_H */ 109