xref: /titanic_50/usr/src/cmd/zic/private.h (revision f430f59ab82e479697d158ab37aa51e306625e9a)
17c478bd9Sstevel@tonic-gate /*
2*f430f59aSrobbin  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
380868c53Srobbin  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate #ifndef	_PRIVATE_H
77c478bd9Sstevel@tonic-gate #define	_PRIVATE_H
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
107c478bd9Sstevel@tonic-gate 
117c478bd9Sstevel@tonic-gate /*
127c478bd9Sstevel@tonic-gate  * This file is in the public domain, so clarified as of
137c478bd9Sstevel@tonic-gate  * June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
147c478bd9Sstevel@tonic-gate  */
157c478bd9Sstevel@tonic-gate 
167c478bd9Sstevel@tonic-gate /*
177c478bd9Sstevel@tonic-gate  * This header is for use ONLY with the time conversion code.
187c478bd9Sstevel@tonic-gate  * There is no guarantee that it will remain unchanged,
197c478bd9Sstevel@tonic-gate  * or that it will remain at all.
207c478bd9Sstevel@tonic-gate  * Do NOT copy it to any system include directory.
217c478bd9Sstevel@tonic-gate  * Thank you!
227c478bd9Sstevel@tonic-gate  */
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
257c478bd9Sstevel@tonic-gate extern "C" {
267c478bd9Sstevel@tonic-gate #endif
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * Nested includes
307c478bd9Sstevel@tonic-gate  */
317c478bd9Sstevel@tonic-gate #include <sys/types.h>	/* for time_t */
327c478bd9Sstevel@tonic-gate #include <stdio.h>
337c478bd9Sstevel@tonic-gate #include <errno.h>
347c478bd9Sstevel@tonic-gate #include <string.h>
357c478bd9Sstevel@tonic-gate #include <limits.h>	/* for CHAR_BIT */
367c478bd9Sstevel@tonic-gate #include <time.h>
377c478bd9Sstevel@tonic-gate #include <stdlib.h>
387c478bd9Sstevel@tonic-gate #include <libintl.h>	/* for F_OK and R_OK */
397c478bd9Sstevel@tonic-gate #include <unistd.h>
4080868c53Srobbin #include <sys/wait.h>
417c478bd9Sstevel@tonic-gate 
4280868c53Srobbin /* static char	privatehid[] = "@(#)private.h	7.55"; */
4380868c53Srobbin 
4480868c53Srobbin #define	GRANDPARENTED	"Local time zone must be set--see zic manual page"
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.  */
477c478bd9Sstevel@tonic-gate #define	is_digit(c)		((unsigned)(c) - '0' <= 9)
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate /*
507c478bd9Sstevel@tonic-gate  * Private function declarations.
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate char 	*icatalloc(char *old, const char *new);
537c478bd9Sstevel@tonic-gate char 	*icpyalloc(const char *string);
547c478bd9Sstevel@tonic-gate char 	*imalloc(int n);
557c478bd9Sstevel@tonic-gate void 	*irealloc(void *pointer, int size);
567c478bd9Sstevel@tonic-gate void	ifree(char *pointer);
57*f430f59aSrobbin const char	*scheck(const char *string, const char *format);
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate /*
607c478bd9Sstevel@tonic-gate  * Finally, some convenience items.
617c478bd9Sstevel@tonic-gate  */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate #ifndef TRUE
647c478bd9Sstevel@tonic-gate #define	TRUE	1
657c478bd9Sstevel@tonic-gate #endif /* !defined TRUE */
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate #ifndef FALSE
687c478bd9Sstevel@tonic-gate #define	FALSE	0
697c478bd9Sstevel@tonic-gate #endif /* !defined FALSE */
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #ifndef TYPE_BIT
727c478bd9Sstevel@tonic-gate #define	TYPE_BIT(type)	(sizeof (type) * CHAR_BIT)
737c478bd9Sstevel@tonic-gate #endif /* !defined TYPE_BIT */
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #ifndef TYPE_SIGNED
767c478bd9Sstevel@tonic-gate #define	TYPE_SIGNED(type) (((type) -1) < 0)
777c478bd9Sstevel@tonic-gate #endif /* !defined TYPE_SIGNED */
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*
807c478bd9Sstevel@tonic-gate  * INITIALIZE(x)
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate #ifndef INITIALIZE
847c478bd9Sstevel@tonic-gate #ifdef lint
857c478bd9Sstevel@tonic-gate #define	INITIALIZE(x)	((x) = 0)
867c478bd9Sstevel@tonic-gate #endif /* defined lint */
877c478bd9Sstevel@tonic-gate #ifndef lint
887c478bd9Sstevel@tonic-gate #define	INITIALIZE(x)
897c478bd9Sstevel@tonic-gate #endif /* !defined lint */
907c478bd9Sstevel@tonic-gate #endif /* !defined INITIALIZE */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
937c478bd9Sstevel@tonic-gate }
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #endif	/* _PRIVATE_H */
97