1989-03-17 21:42:05 -05:00
|
|
|
#ifndef PRIVATE_H
|
|
|
|
|
|
|
|
|
|
#define PRIVATE_H
|
|
|
|
|
|
|
|
|
|
/*
|
1989-03-17 22:10:45 -05:00
|
|
|
** This header is for use ONLY with the time conversion code.
|
1989-03-17 21:42:05 -05:00
|
|
|
** There is no guarantee that it will remain unchanged,
|
1989-03-17 22:06:54 -05:00
|
|
|
** or that it will remain at all.
|
1989-03-17 21:42:05 -05:00
|
|
|
** Do NOT copy it to any system include directory.
|
|
|
|
|
** Thank you!
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** ID
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef lint
|
|
|
|
|
#ifndef NOID
|
|
|
|
|
static char privatehid[] = "%W%";
|
|
|
|
|
#endif /* !defined NOID */
|
|
|
|
|
#endif /* !defined lint */
|
|
|
|
|
|
1995-01-03 11:08:20 -05:00
|
|
|
/*
|
|
|
|
|
** Here are defaults for various preprocessor symbols.
|
|
|
|
|
** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_ADJTIME
|
1995-01-06 15:29:02 -05:00
|
|
|
#define HAVE_ADJTIME 1
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined HAVE_ADJTIME */
|
1995-01-06 15:29:02 -05:00
|
|
|
|
1995-01-03 11:08:20 -05:00
|
|
|
#ifndef HAVE_SETLOCALE
|
1995-01-06 15:29:02 -05:00
|
|
|
#define HAVE_SETLOCALE 1
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined HAVE_SETLOCALE */
|
1995-01-06 15:29:02 -05:00
|
|
|
|
1995-01-03 11:08:20 -05:00
|
|
|
#ifndef HAVE_SETTIMEOFDAY
|
|
|
|
|
#define HAVE_SETTIMEOFDAY 3
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined HAVE_SETTIMEOFDAY */
|
1995-01-03 11:08:20 -05:00
|
|
|
|
|
|
|
|
#ifndef LOCALE_HOME
|
1995-01-06 15:29:02 -05:00
|
|
|
#define LOCALE_HOME "/usr/lib/locale"
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined LOCALE_HOME */
|
1995-01-03 11:08:20 -05:00
|
|
|
|
|
|
|
|
#ifndef alloc_size_T
|
1995-01-06 15:29:02 -05:00
|
|
|
#define alloc_size_T size_t
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined alloc_size_T */
|
1995-01-03 11:08:20 -05:00
|
|
|
|
|
|
|
|
#ifndef fwrite_size_T
|
1995-01-06 15:29:02 -05:00
|
|
|
#define fwrite_size_T size_t
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined fwrite_size_T */
|
1995-01-03 11:08:20 -05:00
|
|
|
|
|
|
|
|
#ifndef qsort_size_T
|
1995-01-06 15:29:02 -05:00
|
|
|
#define qsort_size_T size_t
|
1995-01-03 11:26:27 -05:00
|
|
|
#endif /* !defined qsort_size_T */
|
1995-01-03 11:08:20 -05:00
|
|
|
|
1989-03-17 21:42:05 -05:00
|
|
|
/*
|
1995-01-06 16:21:56 -05:00
|
|
|
** Workarounds for compilers/systems.
|
1989-03-17 21:42:05 -05:00
|
|
|
*/
|
|
|
|
|
|
1995-01-06 16:21:56 -05:00
|
|
|
/*
|
|
|
|
|
** SunOS 4.1.1 headers lack EXIT_SUCCESS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef EXIT_SUCCESS
|
|
|
|
|
#define EXIT_SUCCESS 0
|
|
|
|
|
#endif /* !defined EXIT_SUCCESS */
|
1989-03-17 21:42:05 -05:00
|
|
|
|
1994-06-04 17:05:45 -04:00
|
|
|
/*
|
1995-01-06 16:21:56 -05:00
|
|
|
** SunOS 4.1.1 headers lack EXIT_FAILURE.
|
1994-06-04 17:05:45 -04:00
|
|
|
*/
|
|
|
|
|
|
1995-01-06 16:21:56 -05:00
|
|
|
#ifndef EXIT_FAILURE
|
|
|
|
|
#define EXIT_FAILURE 1
|
|
|
|
|
#endif /* !defined EXIT_FAILURE */
|
1994-06-04 17:05:45 -04:00
|
|
|
|
1995-01-06 16:21:56 -05:00
|
|
|
/*
|
|
|
|
|
** SunOS 4.1.1 cc lacks const.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef const
|
|
|
|
|
#ifndef __STDC__
|
|
|
|
|
#define const
|
|
|
|
|
#endif /* !defined __STDC__ */
|
|
|
|
|
#endif /* !defined const */
|
1994-06-04 17:05:45 -04:00
|
|
|
|
1989-03-17 21:42:05 -05:00
|
|
|
/*
|
1995-01-06 16:21:56 -05:00
|
|
|
** SunOS 4.1.1 cc lacks prototypes.
|
1989-03-17 21:42:05 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef P
|
|
|
|
|
#ifdef __STDC__
|
|
|
|
|
#define P(x) x
|
1993-11-22 12:58:20 -05:00
|
|
|
#endif /* defined __STDC__ */
|
|
|
|
|
#ifndef __STDC__
|
1994-08-20 13:17:29 -04:00
|
|
|
#define P(x) ()
|
1989-03-17 22:06:54 -05:00
|
|
|
#endif /* !defined __STDC__ */
|
1989-03-17 21:42:05 -05:00
|
|
|
#endif /* !defined P */
|
|
|
|
|
|
1989-04-10 20:22:54 -04:00
|
|
|
#include "sys/types.h" /* for time_t */
|
1989-03-17 22:06:54 -05:00
|
|
|
#include "stdio.h"
|
1989-03-17 21:42:05 -05:00
|
|
|
#include "ctype.h"
|
|
|
|
|
#include "errno.h"
|
1989-03-17 22:06:54 -05:00
|
|
|
#include "string.h"
|
1993-05-29 20:41:04 -04:00
|
|
|
#include "limits.h" /* for CHAR_BIT */
|
1989-03-21 11:37:20 -05:00
|
|
|
#ifndef _TIME_
|
1989-03-17 22:06:54 -05:00
|
|
|
#include "time.h"
|
1989-03-21 11:37:20 -05:00
|
|
|
#endif /* !defined _TIME_ */
|
1989-03-17 21:42:05 -05:00
|
|
|
|
1995-01-03 11:08:20 -05:00
|
|
|
#include "stdlib.h"
|
|
|
|
|
#include "unistd.h"
|
|
|
|
|
|
1989-03-17 21:42:05 -05:00
|
|
|
#ifndef remove
|
|
|
|
|
extern int unlink P((const char * filename));
|
|
|
|
|
#define remove unlink
|
|
|
|
|
#endif /* !defined remove */
|
|
|
|
|
|
|
|
|
|
#ifndef FILENAME_MAX
|
|
|
|
|
|
|
|
|
|
#ifndef MAXPATHLEN
|
|
|
|
|
#ifdef unix
|
1989-03-17 22:09:14 -05:00
|
|
|
#include "sys/param.h"
|
1989-03-17 21:42:05 -05:00
|
|
|
#endif /* defined unix */
|
|
|
|
|
#endif /* !defined MAXPATHLEN */
|
|
|
|
|
|
|
|
|
|
#ifdef MAXPATHLEN
|
|
|
|
|
#define FILENAME_MAX MAXPATHLEN
|
1993-11-22 12:58:20 -05:00
|
|
|
#endif /* defined MAXPATHLEN */
|
|
|
|
|
#ifndef MAXPATHLEN
|
1989-03-17 21:42:05 -05:00
|
|
|
#define FILENAME_MAX 1024 /* Pure guesswork */
|
|
|
|
|
#endif /* !defined MAXPATHLEN */
|
|
|
|
|
|
|
|
|
|
#endif /* !defined FILENAME_MAX */
|
|
|
|
|
|
1995-01-06 16:21:56 -05:00
|
|
|
/*
|
|
|
|
|
** Finally, some convenience items.
|
|
|
|
|
*/
|
1989-03-17 21:42:05 -05:00
|
|
|
|
1989-03-22 18:09:56 -05:00
|
|
|
#ifndef TRUE
|
|
|
|
|
#define TRUE 1
|
|
|
|
|
#endif /* !defined TRUE */
|
|
|
|
|
|
|
|
|
|
#ifndef FALSE
|
|
|
|
|
#define FALSE 0
|
|
|
|
|
#endif /* !defined FALSE */
|
|
|
|
|
|
1993-05-29 20:18:37 -04:00
|
|
|
#ifndef INT_STRLEN_MAXIMUM
|
1993-05-30 16:25:00 -04:00
|
|
|
/*
|
|
|
|
|
** 302 / 1000 is log10(2.0) rounded up.
|
|
|
|
|
** Subtract one for the sign bit;
|
|
|
|
|
** add one for integer division truncation;
|
|
|
|
|
** add one more for a minus sign.
|
|
|
|
|
*/
|
|
|
|
|
#define INT_STRLEN_MAXIMUM(type) \
|
|
|
|
|
((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
|
1993-05-29 20:18:37 -04:00
|
|
|
#endif /* !defined INT_STRLEN_MAXIMUM */
|
|
|
|
|
|
1995-01-06 16:21:56 -05:00
|
|
|
/*
|
|
|
|
|
** INITIALIZE(x)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GNUC_or_lint
|
|
|
|
|
#ifdef lint
|
|
|
|
|
#define GNUC_or_lint
|
|
|
|
|
#endif /* defined lint */
|
|
|
|
|
#ifndef lint
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
#define GNUC_or_lint
|
|
|
|
|
#endif /* defined __GNUC__ */
|
|
|
|
|
#endif /* !defined lint */
|
|
|
|
|
#endif /* !defined GNUC_or_lint */
|
|
|
|
|
|
|
|
|
|
#ifndef INITIALIZE
|
|
|
|
|
#ifdef GNUC_or_lint
|
|
|
|
|
#define INITIALIZE(x) ((x) = 0)
|
|
|
|
|
#endif /* defined GNUC_or_lint */
|
|
|
|
|
#ifndef GNUC_or_lint
|
|
|
|
|
#define INITIALIZE(x)
|
|
|
|
|
#endif /* !defined GNUC_or_lint */
|
|
|
|
|
#endif /* !defined INITIALIZE */
|
|
|
|
|
|
1989-03-17 21:42:05 -05:00
|
|
|
/*
|
1994-08-20 13:41:21 -04:00
|
|
|
** UNIX was a registered trademark of UNIX System Laboratories in 1993.
|
1989-03-17 21:42:05 -05:00
|
|
|
** VAX is a trademark of Digital Equipment Corporation.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endif /* !defined PRIVATE_H */
|