Files
amiga-tz/private.h
T

209 lines
4.0 KiB
C
Raw Normal View History

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-06 17:01:53 -05:00
/*
1995-01-06 17:19:28 -05:00
** Defaults for preprocessor symbols.
1995-01-03 11:08:20 -05:00
** 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_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
1995-03-04 11:22:05 -05:00
#ifndef HAVE_UNISTD_H
#define HAVE_UNISTD_H 1
#endif /* !defined HAVE_UNISTD_H */
1996-01-10 16:44:45 -05:00
#ifndef HAVE_UTMPX_H
1996-01-10 16:46:40 -05:00
#define HAVE_UTMPX_H 0
1996-01-10 16:44:45 -05:00
#endif /* !defined HAVE_UTMPX_H */
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
1995-03-04 11:22:05 -05:00
/*
** Nested includes
*/
#include "sys/types.h" /* for time_t */
#include "stdio.h"
#include "errno.h"
#include "string.h"
#include "limits.h" /* for CHAR_BIT */
#include "time.h"
#include "stdlib.h"
#if HAVE_UNISTD_H - 0
#include "unistd.h" /* for F_OK and R_OK */
#endif /* HAVE_UNISTD_H - 0 */
#if !(HAVE_UNISTD_H - 0)
#ifndef F_OK
#define F_OK 0
#endif /* !defined F_OK */
#ifndef R_OK
#define R_OK 4
#endif /* !defined R_OK */
#endif /* !(HAVE_UNISTD_H - 0) */
1995-10-30 10:19:57 -05:00
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
1989-03-17 21:42:05 -05:00
/*
1995-01-06 16:21:56 -05:00
** Workarounds for compilers/systems.
*/
/*
** SunOS 4.1.1 cc lacks const.
1989-03-17 21:42:05 -05:00
*/
#ifndef const
1989-03-17 22:06:54 -05:00
#ifndef __STDC__
1989-03-17 21:42:05 -05:00
#define const
1989-03-17 22:06:54 -05:00
#endif /* !defined __STDC__ */
1989-03-17 21:42:05 -05:00
#endif /* !defined const */
1994-06-04 17:05:45 -04: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 */
1995-01-06 17:01:53 -05:00
/*
** SunOS 4.1.1 headers lack EXIT_SUCCESS.
*/
1989-03-17 21:42:05 -05:00
1995-01-06 17:01:53 -05:00
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */
1995-01-03 11:08:20 -05:00
1995-01-06 17:01:53 -05:00
/*
** SunOS 4.1.1 headers lack EXIT_FAILURE.
*/
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif /* !defined EXIT_FAILURE */
/*
** SunOS 4.1.1 headers lack FILENAME_MAX.
*/
1989-03-17 21:42:05 -05:00
#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 17:01:53 -05:00
/*
** SunOS 4.1.1 libraries lack remove.
*/
#ifndef remove
extern int unlink P((const char * filename));
#define remove unlink
#endif /* !defined remove */
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 */
1996-01-06 13:41:43 -05:00
#ifndef TYPE_BIT
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
#endif /* !defined TYPE_BIT */
#ifndef TYPE_SIGNED
#define TYPE_SIGNED(type) (((type) -1) < 0)
#endif /* !defined TYPE_SIGNED */
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.
1996-01-06 13:28:07 -05:00
** Subtract one for the sign bit if the type is signed;
** add one for integer division truncation;
** add one more for a minus sign if the type is signed.
1993-05-30 16:25:00 -04:00
*/
#define INT_STRLEN_MAXIMUM(type) \
1996-01-06 13:28:07 -05:00
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
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
*/
#endif /* !defined PRIVATE_H */