xref: /titanic_52/usr/src/lib/libbc/inc/include/locale.h (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
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  */
22*5d54f3d8Smuffin /*
23*5d54f3d8Smuffin  * Copyright 1988 Sun Microsystems, Inc.  All rights reserved.
24*5d54f3d8Smuffin  * Use is subject to license terms.
25*5d54f3d8Smuffin  */
26*5d54f3d8Smuffin 
27*5d54f3d8Smuffin #ifndef	__locale_h
28*5d54f3d8Smuffin #define	__locale_h
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate /*
337c478bd9Sstevel@tonic-gate  * Locale indices.
347c478bd9Sstevel@tonic-gate  */
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifndef	NULL
377c478bd9Sstevel@tonic-gate #define	NULL		0
387c478bd9Sstevel@tonic-gate #endif
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #define	LC_ALL		0
417c478bd9Sstevel@tonic-gate #define	LC_CTYPE	1
427c478bd9Sstevel@tonic-gate #define	LC_NUMERIC	2
437c478bd9Sstevel@tonic-gate #define	LC_TIME		3
447c478bd9Sstevel@tonic-gate #define	LC_MONETARY	4
457c478bd9Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
467c478bd9Sstevel@tonic-gate #define	LANGINFO	5
477c478bd9Sstevel@tonic-gate #endif
487c478bd9Sstevel@tonic-gate #define	LC_COLLATE	6
497c478bd9Sstevel@tonic-gate #define	LC_MESSAGES	7
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
527c478bd9Sstevel@tonic-gate #define	MAXLOCALE	8
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #define	ON	1
557c478bd9Sstevel@tonic-gate #define	OFF	0
567c478bd9Sstevel@tonic-gate /* The maximum number of characters in the locale name */
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate #define	MAXLOCALENAME   14
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate /* The maximum number of substitute mappings in LC_COLLATE table */
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #define	MAXSUBS   	64
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /* Max width of domain name */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #define	MAXDOMAIN	255
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /* Max width of format string for message domains */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate #define	MAXFMTS		32
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /* Max width of the message string */
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate #define	MAXMSGSTR	255
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate /* The directory where category components are kept */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate #define	LOCALE_DIR	"/usr/share/lib/locale/"
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate /* The directory that is private to an individual workstation user */
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate #define	PRIVATE_LOCALE_DIR	"/etc/locale/"
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /* The name of the file that contains default locale */
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #define	DEFAULT_LOC		".default"
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /* size of "ctype" */
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate #define	CTYPE_SIZE	514
927c478bd9Sstevel@tonic-gate #endif	/* _POSIX_SOURCE */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate extern char *		setlocale(/* int category, const char *locale */);
957c478bd9Sstevel@tonic-gate extern struct lconv *	localeconv(/* void */);
967c478bd9Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
977c478bd9Sstevel@tonic-gate extern struct dtconv *	localdtconv();
987c478bd9Sstevel@tonic-gate #endif
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /*
1017c478bd9Sstevel@tonic-gate  * Numeric and monetary conversion information.
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate struct lconv {
1047c478bd9Sstevel@tonic-gate 	char	*decimal_point;	/* decimal point character */
1057c478bd9Sstevel@tonic-gate 	char	*thousands_sep;	/* thousands separator character */
1067c478bd9Sstevel@tonic-gate 	char	*grouping;	/* grouping of digits */
1077c478bd9Sstevel@tonic-gate 	char	*int_curr_symbol;	/* international currency symbol */
1087c478bd9Sstevel@tonic-gate 	char	*currency_symbol;	/* local currency symbol */
1097c478bd9Sstevel@tonic-gate 	char	*mon_decimal_point;	/* monetary decimal point character */
1107c478bd9Sstevel@tonic-gate 	char	*mon_thousands_sep;	/* monetary thousands separator */
1117c478bd9Sstevel@tonic-gate 	char	*mon_grouping;	/* monetary grouping of digits */
1127c478bd9Sstevel@tonic-gate 	char	*positive_sign;	/* monetary credit symbol */
1137c478bd9Sstevel@tonic-gate 	char	*negative_sign;	/* monetary debit symbol */
1147c478bd9Sstevel@tonic-gate 	char	int_frac_digits; /* intl monetary number of fractional digits */
1157c478bd9Sstevel@tonic-gate 	char	frac_digits;	/* monetary number of fractional digits */
1167c478bd9Sstevel@tonic-gate 	char	p_cs_precedes;	/* true if currency symbol precedes credit */
1177c478bd9Sstevel@tonic-gate 	char	p_sep_by_space;	/* true if space separates c.s.  from credit */
1187c478bd9Sstevel@tonic-gate 	char	n_cs_precedes;	/* true if currency symbol precedes debit */
1197c478bd9Sstevel@tonic-gate 	char	n_sep_by_space;	/* true if space separates c.s.  from debit */
1207c478bd9Sstevel@tonic-gate 	char	p_sign_posn;	/* position of sign for credit */
1217c478bd9Sstevel@tonic-gate 	char	n_sign_posn;	/* position of sign for debit */
1227c478bd9Sstevel@tonic-gate };
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate #ifndef	_POSIX_SOURCE
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * Date and time conversion information.
1277c478bd9Sstevel@tonic-gate  */
1287c478bd9Sstevel@tonic-gate struct dtconv {
1297c478bd9Sstevel@tonic-gate 	char	*abbrev_month_names[12];	/* abbreviated month names */
1307c478bd9Sstevel@tonic-gate 	char	*month_names[12];	/* full month names */
1317c478bd9Sstevel@tonic-gate 	char	*abbrev_weekday_names[7];	/* abbreviated weekday names */
1327c478bd9Sstevel@tonic-gate 	char	*weekday_names[7];	/* full weekday names */
1337c478bd9Sstevel@tonic-gate 	char	*time_format;	/* time format */
1347c478bd9Sstevel@tonic-gate 	char	*sdate_format;	/* short date format */
1357c478bd9Sstevel@tonic-gate 	char	*dtime_format;	/* date/time format */
1367c478bd9Sstevel@tonic-gate 	char	*am_string;	/* AM string */
1377c478bd9Sstevel@tonic-gate 	char	*pm_string;	/* PM string */
1387c478bd9Sstevel@tonic-gate 	char	*ldate_format;	/* long date format */
1397c478bd9Sstevel@tonic-gate };
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate /*
1427c478bd9Sstevel@tonic-gate  * Langinfo
1437c478bd9Sstevel@tonic-gate  */
1447c478bd9Sstevel@tonic-gate struct langinfo {
1457c478bd9Sstevel@tonic-gate 	char *yesstr;	/* yes string */
1467c478bd9Sstevel@tonic-gate 	char *nostr;	/* nostr */
1477c478bd9Sstevel@tonic-gate };
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate /*
1507c478bd9Sstevel@tonic-gate  * NLS nl_init
1517c478bd9Sstevel@tonic-gate  */
1527c478bd9Sstevel@tonic-gate #define	valid(ptr) (ptr != (char *) NULL)
1537c478bd9Sstevel@tonic-gate #define	nl_init(lang) ((valid(lang) && *lang) ? \
1547c478bd9Sstevel@tonic-gate     (valid(setlocale (LC_ALL, lang) ) ? 0 : -1) \
1557c478bd9Sstevel@tonic-gate     : -1)
1567c478bd9Sstevel@tonic-gate #endif	/* _POSIX_SOURCE */
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #endif	/* !__locale_h */
159