xref: /onnv-gate/usr/src/cmd/zic/private.h (revision 1442:9e0554a556ed)
10Sstevel@tonic-gate /*
2*1442Srobbin  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
31138Srobbin  * Use is subject to license terms.
40Sstevel@tonic-gate  */
50Sstevel@tonic-gate 
60Sstevel@tonic-gate #ifndef	_PRIVATE_H
70Sstevel@tonic-gate #define	_PRIVATE_H
80Sstevel@tonic-gate 
90Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
100Sstevel@tonic-gate 
110Sstevel@tonic-gate /*
120Sstevel@tonic-gate  * This file is in the public domain, so clarified as of
130Sstevel@tonic-gate  * June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
140Sstevel@tonic-gate  */
150Sstevel@tonic-gate 
160Sstevel@tonic-gate /*
170Sstevel@tonic-gate  * This header is for use ONLY with the time conversion code.
180Sstevel@tonic-gate  * There is no guarantee that it will remain unchanged,
190Sstevel@tonic-gate  * or that it will remain at all.
200Sstevel@tonic-gate  * Do NOT copy it to any system include directory.
210Sstevel@tonic-gate  * Thank you!
220Sstevel@tonic-gate  */
230Sstevel@tonic-gate 
240Sstevel@tonic-gate #ifdef	__cplusplus
250Sstevel@tonic-gate extern "C" {
260Sstevel@tonic-gate #endif
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * Nested includes
300Sstevel@tonic-gate  */
310Sstevel@tonic-gate #include <sys/types.h>	/* for time_t */
320Sstevel@tonic-gate #include <stdio.h>
330Sstevel@tonic-gate #include <errno.h>
340Sstevel@tonic-gate #include <string.h>
350Sstevel@tonic-gate #include <limits.h>	/* for CHAR_BIT */
360Sstevel@tonic-gate #include <time.h>
370Sstevel@tonic-gate #include <stdlib.h>
380Sstevel@tonic-gate #include <libintl.h>	/* for F_OK and R_OK */
390Sstevel@tonic-gate #include <unistd.h>
401138Srobbin #include <sys/wait.h>
410Sstevel@tonic-gate 
421138Srobbin /* static char	privatehid[] = "@(#)private.h	7.55"; */
431138Srobbin 
441138Srobbin #define	GRANDPARENTED	"Local time zone must be set--see zic manual page"
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.  */
470Sstevel@tonic-gate #define	is_digit(c)		((unsigned)(c) - '0' <= 9)
480Sstevel@tonic-gate 
490Sstevel@tonic-gate /*
500Sstevel@tonic-gate  * Private function declarations.
510Sstevel@tonic-gate  */
521138Srobbin char 	*icatalloc(char *old, const char *new);
531138Srobbin char 	*icpyalloc(const char *string);
540Sstevel@tonic-gate char 	*imalloc(int n);
551138Srobbin void 	*irealloc(void *pointer, int size);
561138Srobbin void	ifree(char *pointer);
57*1442Srobbin const char	*scheck(const char *string, const char *format);
580Sstevel@tonic-gate 
590Sstevel@tonic-gate /*
600Sstevel@tonic-gate  * Finally, some convenience items.
610Sstevel@tonic-gate  */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate #ifndef TRUE
640Sstevel@tonic-gate #define	TRUE	1
650Sstevel@tonic-gate #endif /* !defined TRUE */
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #ifndef FALSE
680Sstevel@tonic-gate #define	FALSE	0
690Sstevel@tonic-gate #endif /* !defined FALSE */
700Sstevel@tonic-gate 
710Sstevel@tonic-gate #ifndef TYPE_BIT
720Sstevel@tonic-gate #define	TYPE_BIT(type)	(sizeof (type) * CHAR_BIT)
730Sstevel@tonic-gate #endif /* !defined TYPE_BIT */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate #ifndef TYPE_SIGNED
760Sstevel@tonic-gate #define	TYPE_SIGNED(type) (((type) -1) < 0)
770Sstevel@tonic-gate #endif /* !defined TYPE_SIGNED */
780Sstevel@tonic-gate 
790Sstevel@tonic-gate /*
800Sstevel@tonic-gate  * INITIALIZE(x)
810Sstevel@tonic-gate  */
820Sstevel@tonic-gate 
830Sstevel@tonic-gate #ifndef INITIALIZE
840Sstevel@tonic-gate #ifdef lint
850Sstevel@tonic-gate #define	INITIALIZE(x)	((x) = 0)
860Sstevel@tonic-gate #endif /* defined lint */
870Sstevel@tonic-gate #ifndef lint
880Sstevel@tonic-gate #define	INITIALIZE(x)
890Sstevel@tonic-gate #endif /* !defined lint */
900Sstevel@tonic-gate #endif /* !defined INITIALIZE */
910Sstevel@tonic-gate 
920Sstevel@tonic-gate #ifdef	__cplusplus
930Sstevel@tonic-gate }
940Sstevel@tonic-gate #endif
950Sstevel@tonic-gate 
960Sstevel@tonic-gate #endif	/* _PRIVATE_H */
97