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