xref: /onnv-gate/usr/src/lib/libbc/inc/include/locale.h (revision 722:636b850d4ee9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
22*722Smuffin /*
23*722Smuffin  * Copyright 1988 Sun Microsystems, Inc.  All rights reserved.
24*722Smuffin  * Use is subject to license terms.
25*722Smuffin  */
26*722Smuffin 
27*722Smuffin #ifndef	__locale_h
28*722Smuffin #define	__locale_h
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * Locale indices.
340Sstevel@tonic-gate  */
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #ifndef	NULL
370Sstevel@tonic-gate #define	NULL		0
380Sstevel@tonic-gate #endif
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #define	LC_ALL		0
410Sstevel@tonic-gate #define	LC_CTYPE	1
420Sstevel@tonic-gate #define	LC_NUMERIC	2
430Sstevel@tonic-gate #define	LC_TIME		3
440Sstevel@tonic-gate #define	LC_MONETARY	4
450Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
460Sstevel@tonic-gate #define	LANGINFO	5
470Sstevel@tonic-gate #endif
480Sstevel@tonic-gate #define	LC_COLLATE	6
490Sstevel@tonic-gate #define	LC_MESSAGES	7
500Sstevel@tonic-gate 
510Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
520Sstevel@tonic-gate #define	MAXLOCALE	8
530Sstevel@tonic-gate 
540Sstevel@tonic-gate #define	ON	1
550Sstevel@tonic-gate #define	OFF	0
560Sstevel@tonic-gate /* The maximum number of characters in the locale name */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate #define	MAXLOCALENAME   14
590Sstevel@tonic-gate 
600Sstevel@tonic-gate /* The maximum number of substitute mappings in LC_COLLATE table */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	MAXSUBS   	64
630Sstevel@tonic-gate 
640Sstevel@tonic-gate /* Max width of domain name */
650Sstevel@tonic-gate 
660Sstevel@tonic-gate #define	MAXDOMAIN	255
670Sstevel@tonic-gate 
680Sstevel@tonic-gate /* Max width of format string for message domains */
690Sstevel@tonic-gate 
700Sstevel@tonic-gate #define	MAXFMTS		32
710Sstevel@tonic-gate 
720Sstevel@tonic-gate /* Max width of the message string */
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #define	MAXMSGSTR	255
750Sstevel@tonic-gate 
760Sstevel@tonic-gate /* The directory where category components are kept */
770Sstevel@tonic-gate 
780Sstevel@tonic-gate #define	LOCALE_DIR	"/usr/share/lib/locale/"
790Sstevel@tonic-gate 
800Sstevel@tonic-gate /* The directory that is private to an individual workstation user */
810Sstevel@tonic-gate 
820Sstevel@tonic-gate #define	PRIVATE_LOCALE_DIR	"/etc/locale/"
830Sstevel@tonic-gate 
840Sstevel@tonic-gate /* The name of the file that contains default locale */
850Sstevel@tonic-gate 
860Sstevel@tonic-gate #define	DEFAULT_LOC		".default"
870Sstevel@tonic-gate 
880Sstevel@tonic-gate 
890Sstevel@tonic-gate /* size of "ctype" */
900Sstevel@tonic-gate 
910Sstevel@tonic-gate #define	CTYPE_SIZE	514
920Sstevel@tonic-gate #endif	/* _POSIX_SOURCE */
930Sstevel@tonic-gate 
940Sstevel@tonic-gate extern char *		setlocale(/* int category, const char *locale */);
950Sstevel@tonic-gate extern struct lconv *	localeconv(/* void */);
960Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
970Sstevel@tonic-gate extern struct dtconv *	localdtconv();
980Sstevel@tonic-gate #endif
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate /*
1010Sstevel@tonic-gate  * Numeric and monetary conversion information.
1020Sstevel@tonic-gate  */
1030Sstevel@tonic-gate struct lconv {
1040Sstevel@tonic-gate 	char	*decimal_point;	/* decimal point character */
1050Sstevel@tonic-gate 	char	*thousands_sep;	/* thousands separator character */
1060Sstevel@tonic-gate 	char	*grouping;	/* grouping of digits */
1070Sstevel@tonic-gate 	char	*int_curr_symbol;	/* international currency symbol */
1080Sstevel@tonic-gate 	char	*currency_symbol;	/* local currency symbol */
1090Sstevel@tonic-gate 	char	*mon_decimal_point;	/* monetary decimal point character */
1100Sstevel@tonic-gate 	char	*mon_thousands_sep;	/* monetary thousands separator */
1110Sstevel@tonic-gate 	char	*mon_grouping;	/* monetary grouping of digits */
1120Sstevel@tonic-gate 	char	*positive_sign;	/* monetary credit symbol */
1130Sstevel@tonic-gate 	char	*negative_sign;	/* monetary debit symbol */
1140Sstevel@tonic-gate 	char	int_frac_digits; /* intl monetary number of fractional digits */
1150Sstevel@tonic-gate 	char	frac_digits;	/* monetary number of fractional digits */
1160Sstevel@tonic-gate 	char	p_cs_precedes;	/* true if currency symbol precedes credit */
1170Sstevel@tonic-gate 	char	p_sep_by_space;	/* true if space separates c.s.  from credit */
1180Sstevel@tonic-gate 	char	n_cs_precedes;	/* true if currency symbol precedes debit */
1190Sstevel@tonic-gate 	char	n_sep_by_space;	/* true if space separates c.s.  from debit */
1200Sstevel@tonic-gate 	char	p_sign_posn;	/* position of sign for credit */
1210Sstevel@tonic-gate 	char	n_sign_posn;	/* position of sign for debit */
1220Sstevel@tonic-gate };
1230Sstevel@tonic-gate 
1240Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
1250Sstevel@tonic-gate /*
1260Sstevel@tonic-gate  * Date and time conversion information.
1270Sstevel@tonic-gate  */
1280Sstevel@tonic-gate struct dtconv {
1290Sstevel@tonic-gate 	char	*abbrev_month_names[12];	/* abbreviated month names */
1300Sstevel@tonic-gate 	char	*month_names[12];	/* full month names */
1310Sstevel@tonic-gate 	char	*abbrev_weekday_names[7];	/* abbreviated weekday names */
1320Sstevel@tonic-gate 	char	*weekday_names[7];	/* full weekday names */
1330Sstevel@tonic-gate 	char	*time_format;	/* time format */
1340Sstevel@tonic-gate 	char	*sdate_format;	/* short date format */
1350Sstevel@tonic-gate 	char	*dtime_format;	/* date/time format */
1360Sstevel@tonic-gate 	char	*am_string;	/* AM string */
1370Sstevel@tonic-gate 	char	*pm_string;	/* PM string */
1380Sstevel@tonic-gate 	char	*ldate_format;	/* long date format */
1390Sstevel@tonic-gate };
1400Sstevel@tonic-gate 
1410Sstevel@tonic-gate /*
1420Sstevel@tonic-gate  * Langinfo
1430Sstevel@tonic-gate  */
1440Sstevel@tonic-gate struct langinfo {
1450Sstevel@tonic-gate 	char *yesstr;	/* yes string */
1460Sstevel@tonic-gate 	char *nostr;	/* nostr */
1470Sstevel@tonic-gate };
1480Sstevel@tonic-gate 
1490Sstevel@tonic-gate /*
1500Sstevel@tonic-gate  * NLS nl_init
1510Sstevel@tonic-gate  */
1520Sstevel@tonic-gate #define	valid(ptr) (ptr != (char *) NULL)
1530Sstevel@tonic-gate #define	nl_init(lang) ((valid(lang) && *lang) ? \
1540Sstevel@tonic-gate     (valid(setlocale (LC_ALL, lang) ) ? 0 : -1) \
1550Sstevel@tonic-gate     : -1)
1560Sstevel@tonic-gate #endif	/* _POSIX_SOURCE */
1570Sstevel@tonic-gate 
158*722Smuffin #endif	/* !__locale_h */
159