xref: /titanic_52/usr/src/lib/libzoneinfo/common/libzoneinfo.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_LIBZONEINFO_H
28*7c478bd9Sstevel@tonic-gate #define	_LIBZONEINFO_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * WARNING:
34*7c478bd9Sstevel@tonic-gate  *
35*7c478bd9Sstevel@tonic-gate  * The interfaces defined in this header file are for Sun private use only.
36*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to change without notice for the
37*7c478bd9Sstevel@tonic-gate  * future releases.
38*7c478bd9Sstevel@tonic-gate  */
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate /*
41*7c478bd9Sstevel@tonic-gate  * Declarations for the functions in libzoneinfo
42*7c478bd9Sstevel@tonic-gate  */
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
45*7c478bd9Sstevel@tonic-gate extern "C" {
46*7c478bd9Sstevel@tonic-gate #endif
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate #define	_TZBUFLEN	128		/* timezone name buffer length */
49*7c478bd9Sstevel@tonic-gate #define	_CCBUFLEN	32		/* country code buffer length */
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate #define	_GMT_MAX	(12*60*60)	/* The maximum GMT offset */
52*7c478bd9Sstevel@tonic-gate #define	_GMT_MIN	(-13*60*60)	/* The minimum GMT offset */
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate #define	_VTZ_INSTALL	0		/* zoneinfo or POSIX offset-from-GMT */
55*7c478bd9Sstevel@tonic-gate #define	_VTZ_ALL	1		/* zoneinfo or POSIX */
56*7c478bd9Sstevel@tonic-gate #define	_VTZ_POSIX	2		/* POSIX timezone */
57*7c478bd9Sstevel@tonic-gate #define	_VTZ_ZONEINFO	3		/* zoneinfo timezone */
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate struct tz_timezone {
60*7c478bd9Sstevel@tonic-gate 	char tz_name[_TZBUFLEN];	/* timezone name */
61*7c478bd9Sstevel@tonic-gate 	char tz_oname[_TZBUFLEN];
62*7c478bd9Sstevel@tonic-gate 	char *tz_id_desc;		/* timezone description */
63*7c478bd9Sstevel@tonic-gate 	char *tz_display_desc;		/* l10n timezone description */
64*7c478bd9Sstevel@tonic-gate 	struct tz_coord {		/* coordinates */
65*7c478bd9Sstevel@tonic-gate 		int lat_sign;
66*7c478bd9Sstevel@tonic-gate 		unsigned int lat_degree;
67*7c478bd9Sstevel@tonic-gate 		unsigned int lat_minute;
68*7c478bd9Sstevel@tonic-gate 		unsigned int lat_second;
69*7c478bd9Sstevel@tonic-gate 		int long_sign;
70*7c478bd9Sstevel@tonic-gate 		unsigned int long_degree;
71*7c478bd9Sstevel@tonic-gate 		unsigned int long_minute;
72*7c478bd9Sstevel@tonic-gate 		unsigned int long_second;
73*7c478bd9Sstevel@tonic-gate 	} tz_coord;
74*7c478bd9Sstevel@tonic-gate 	struct tz_timezone *tz_next;	/* pointer to next element */
75*7c478bd9Sstevel@tonic-gate 	void *tz_reserved;		/* reserved */
76*7c478bd9Sstevel@tonic-gate };
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate struct tz_continent {
79*7c478bd9Sstevel@tonic-gate 	char ctnt_name[_TZBUFLEN];	/* continent name */
80*7c478bd9Sstevel@tonic-gate 	char *ctnt_id_desc;		/* continent name (descriptive) */
81*7c478bd9Sstevel@tonic-gate 	char *ctnt_display_desc;	/* localized continent name */
82*7c478bd9Sstevel@tonic-gate 	struct tz_continent *ctnt_next;	/* pointer to next element */
83*7c478bd9Sstevel@tonic-gate 	void *ctnt_reserved;		/* reserved */
84*7c478bd9Sstevel@tonic-gate };
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate struct tz_country {
87*7c478bd9Sstevel@tonic-gate 	char ctry_code[_CCBUFLEN];	/* country code */
88*7c478bd9Sstevel@tonic-gate 	char *ctry_id_desc;		/* country name (descriptive) */
89*7c478bd9Sstevel@tonic-gate 	char *ctry_display_desc;	/* localized country name */
90*7c478bd9Sstevel@tonic-gate 	int  ctry_status;		/* private use */
91*7c478bd9Sstevel@tonic-gate 	struct tz_country *ctry_next;	/* pointer to next element */
92*7c478bd9Sstevel@tonic-gate 	void *ctry_reserved;		/* reserved */
93*7c478bd9Sstevel@tonic-gate };
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate extern int get_tz_continents(struct tz_continent **);
96*7c478bd9Sstevel@tonic-gate extern int get_tz_countries(struct tz_country **, struct tz_continent *);
97*7c478bd9Sstevel@tonic-gate extern int get_timezones_by_country(struct tz_timezone **, struct tz_country *);
98*7c478bd9Sstevel@tonic-gate extern int free_tz_continents(struct tz_continent *);
99*7c478bd9Sstevel@tonic-gate extern int free_tz_countries(struct tz_country *);
100*7c478bd9Sstevel@tonic-gate extern int free_timezones(struct tz_timezone *);
101*7c478bd9Sstevel@tonic-gate extern char *conv_gmt(int, int);
102*7c478bd9Sstevel@tonic-gate extern char *get_system_tz(char *);
103*7c478bd9Sstevel@tonic-gate extern int set_system_tz(char *, char *);
104*7c478bd9Sstevel@tonic-gate extern int isvalid_tz(char *, char *, int);
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
107*7c478bd9Sstevel@tonic-gate }
108*7c478bd9Sstevel@tonic-gate #endif
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate #endif /* _LIBZONEINFO_H */
111