xref: /titanic_51/usr/src/cmd/zic/private.h (revision fa9e4066f08beec538e775443c5be79dd423fcab)
1 /*
2  * Copyright (c) 1994-1999, by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 #ifndef	_PRIVATE_H
7 #define	_PRIVATE_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 /*
12  * This file is in the public domain, so clarified as of
13  * June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
14  */
15 
16 /*
17  * This header is for use ONLY with the time conversion code.
18  * There is no guarantee that it will remain unchanged,
19  * or that it will remain at all.
20  * Do NOT copy it to any system include directory.
21  * Thank you!
22  */
23 
24 #ifdef	__cplusplus
25 extern "C" {
26 #endif
27 
28 /*
29  * Nested includes
30  */
31 #include <sys/types.h>	/* for time_t */
32 #include <stdio.h>
33 #include <errno.h>
34 #include <string.h>
35 #include <limits.h>	/* for CHAR_BIT */
36 #include <time.h>
37 #include <stdlib.h>
38 #include <libintl.h>	/* for F_OK and R_OK */
39 #include <unistd.h>
40 
41 /* static char	privatehid[] = "@(#)private.h	7.48"; */
42 
43 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX.  */
44 #define	is_digit(c)		((unsigned)(c) - '0' <= 9)
45 
46 /*
47  * Private function declarations.
48  */
49 char 	*icatalloc(char * old, const char * new);
50 char 	*icpyalloc(const char * string);
51 char 	*imalloc(int n);
52 void 	*irealloc(void * pointer, int size);
53 void	ifree(char * pointer);
54 char	*scheck(const char *string, const char *format);
55 
56 /*
57  * Finally, some convenience items.
58  */
59 
60 #ifndef TRUE
61 #define	TRUE	1
62 #endif /* !defined TRUE */
63 
64 #ifndef FALSE
65 #define	FALSE	0
66 #endif /* !defined FALSE */
67 
68 #ifndef TYPE_BIT
69 #define	TYPE_BIT(type)	(sizeof (type) * CHAR_BIT)
70 #endif /* !defined TYPE_BIT */
71 
72 #ifndef TYPE_SIGNED
73 #define	TYPE_SIGNED(type) (((type) -1) < 0)
74 #endif /* !defined TYPE_SIGNED */
75 
76 /*
77  * INITIALIZE(x)
78  */
79 
80 #ifndef INITIALIZE
81 #ifdef lint
82 #define	INITIALIZE(x)	((x) = 0)
83 #endif /* defined lint */
84 #ifndef lint
85 #define	INITIALIZE(x)
86 #endif /* !defined lint */
87 #endif /* !defined INITIALIZE */
88 
89 #ifdef	__cplusplus
90 }
91 #endif
92 
93 #endif	/* _PRIVATE_H */
94