home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.2 / util-lin / util-linux-2.2 / time / private.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-22  |  4.2 KB  |  211 lines

  1. #ifndef PRIVATE_H
  2.  
  3. #define PRIVATE_H
  4.  
  5. /*
  6. ** This header is for use ONLY with the time conversion code.
  7. ** There is no guarantee that it will remain unchanged,
  8. ** or that it will remain at all.
  9. ** Do NOT copy it to any system include directory.
  10. ** Thank you!
  11. */
  12.  
  13. /*
  14. ** ID
  15. */
  16.  
  17. #ifndef lint
  18. #ifndef NOID
  19. static char    privatehid[] = "@(#)private.h    7.10";
  20. #endif /* !defined NOID */
  21. #endif /* !defined lint */
  22.  
  23. /*
  24. ** const
  25. */
  26.  
  27. #ifndef const
  28. #ifndef __STDC__
  29. #define const
  30. #endif /* !defined __STDC__ */
  31. #endif /* !defined const */
  32.  
  33. /*
  34. ** void
  35. */
  36.  
  37. #ifndef void
  38. #ifndef __STDC__
  39. #ifndef vax
  40. #ifndef sun
  41. #define void    char
  42. #endif /* !defined sun */
  43. #endif /* !defined vax */
  44. #endif /* !defined __STDC__ */
  45. #endif /* !defined void */
  46.  
  47. /*
  48. ** INITIALIZE
  49. */
  50.  
  51. #ifndef GNUC_or_lint
  52. #ifdef lint
  53. #define GNUC_or_lint
  54. #endif /* defined lint */
  55. #ifdef __GNUC__
  56. #define GNUC_or_lint
  57. #endif /* defined __GNUC__ */
  58. #endif /* !defined GNUC_or_lint */
  59.  
  60. #ifndef INITIALIZE
  61. #ifdef GNUC_or_lint
  62. #define INITIALIZE(x)    ((x) = 0)
  63. #endif /* defined GNUC_or_lint */
  64. #ifndef GNUC_or_lint
  65. #define INITIALIZE(x)
  66. #endif /* !defined GNUC_or_lint */
  67. #endif /* !defined INITIALIZE */
  68.  
  69. /*
  70. ** P((args))
  71. */
  72.  
  73. #ifndef P
  74. #ifdef __STDC__
  75. #define P(x)    x
  76. #endif /* defined __STDC__ */
  77. #ifndef __STDC__
  78. #define P(x)    ()
  79. #endif /* !defined __STDC__ */
  80. #endif /* !defined P */
  81.  
  82. /*
  83. ** genericptr_T
  84. */
  85.  
  86. #ifdef __STDC__
  87. typedef void *        genericptr_T;
  88. #endif /* defined __STDC__ */
  89. #ifndef __STDC__
  90. typedef char *        genericptr_T;
  91. #endif /* !defined __STDC__ */
  92.  
  93. #include "sys/types.h"    /* for time_t */
  94. #include "stdio.h"
  95. #include "ctype.h"
  96. #include "errno.h"
  97. #include "string.h"
  98. #include "limits.h"    /* for CHAR_BIT */
  99. #ifndef _TIME_
  100. #include "time.h"
  101. #endif /* !defined _TIME_ */
  102.  
  103. #ifndef remove
  104. extern int    unlink P((const char * filename));
  105. #define remove    unlink
  106. #endif /* !defined remove */
  107.  
  108. #ifndef FILENAME_MAX
  109.  
  110. #ifndef MAXPATHLEN
  111. #ifdef unix
  112. #include "sys/param.h"
  113. #endif /* defined unix */
  114. #endif /* !defined MAXPATHLEN */
  115.  
  116. #ifdef MAXPATHLEN
  117. #define FILENAME_MAX    MAXPATHLEN
  118. #endif /* defined MAXPATHLEN */
  119. #ifndef MAXPATHLEN
  120. #define FILENAME_MAX    1024        /* Pure guesswork */
  121. #endif /* !defined MAXPATHLEN */
  122.  
  123. #endif /* !defined FILENAME_MAX */
  124.  
  125. #ifndef EXIT_SUCCESS
  126. #define EXIT_SUCCESS    0
  127. #endif /* !defined EXIT_SUCCESS */
  128.  
  129. #ifndef EXIT_FAILURE
  130. #define EXIT_FAILURE    1
  131. #endif /* !defined EXIT_FAILURE */
  132.  
  133. #ifdef __STDC__
  134.  
  135. #define alloc_size_T    size_t
  136. #define qsort_size_T    size_t
  137. #define fwrite_size_T    size_t
  138.  
  139. #endif /* defined __STDC__ */
  140. #ifndef __STDC__
  141.  
  142. #ifndef alloc_size_T
  143. #define alloc_size_T    unsigned
  144. #endif /* !defined alloc_size_T */
  145.  
  146. #ifndef qsort_size_T
  147. #ifdef USG
  148. #define qsort_size_T    unsigned
  149. #endif /* defined USG */
  150. #ifndef USG
  151. #define qsort_size_T    int
  152. #endif /* !defined USG */
  153. #endif /* !defined qsort_size_T */
  154.  
  155. #ifndef fwrite_size_T
  156. #define fwrite_size_T    int
  157. #endif /* !defined fwrite_size_T */
  158.  
  159. #ifndef USG
  160. extern char *        sprintf P((char * buf, const char * format, ...));
  161. #endif /* !defined USG */
  162.  
  163. #endif /* !defined __STDC__ */
  164.  
  165. /*
  166. ** Ensure that these are declared--redundantly declaring them shouldn't hurt.
  167. */
  168.  
  169. extern char *        getenv P((const char * name));
  170. extern genericptr_T    malloc P((alloc_size_T size));
  171. extern genericptr_T    calloc P((alloc_size_T nelem, alloc_size_T elsize));
  172. extern genericptr_T    realloc P((genericptr_T oldptr, alloc_size_T newsize));
  173.  
  174. #ifdef USG
  175. extern void        exit P((int s));
  176. extern void        qsort P((genericptr_T base, qsort_size_T nelem,
  177.                 qsort_size_T elsize, int (*comp)()));
  178. extern void        perror P((const char * string));
  179. extern void        free P((char * buf));
  180. #endif /* defined USG */
  181.  
  182. #ifndef TRUE
  183. #define TRUE    1
  184. #endif /* !defined TRUE */
  185.  
  186. #ifndef FALSE
  187. #define FALSE    0
  188. #endif /* !defined FALSE */
  189.  
  190. #ifndef INT_STRLEN_MAXIMUM
  191. /*
  192. ** 302 / 1000 is log10(2.0) rounded up.
  193. ** Subtract one for the sign bit;
  194. ** add one for integer division truncation;
  195. ** add one more for a minus sign.
  196. */
  197. #define INT_STRLEN_MAXIMUM(type) \
  198.     ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
  199. #endif /* !defined INT_STRLEN_MAXIMUM */
  200.  
  201. #ifndef LOCALE_HOME
  202. #define LOCALE_HOME    "/usr/lib/locale"
  203. #endif /* !defined LOCALE_HOME */
  204.  
  205. /*
  206. ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
  207. ** VAX is a trademark of Digital Equipment Corporation.
  208. */
  209.  
  210. #endif /* !defined PRIVATE_H */
  211.