drm/radeon: add missing ttm_eu_backoff_reservation to radeon_bo_list_validate
[dragonfly.git] / lib / libc / stdtime / private.h
blobfe658484e9b55c1cb0e3eecc73e81998b4a30487
1 /*
2 * $FreeBSD: head/contrib/tzcode/stdtime/private.h 192625 2009-05-23 06:31:50Z edwin $
3 */
5 #ifndef PRIVATE_H
7 #define PRIVATE_H
8 /*
9 ** This file is in the public domain, so clarified as of
10 ** 1996-06-05 by Arthur David Olson.
13 /* Stuff moved from Makefile.inc to reduce clutter */
14 #ifndef TM_GMTOFF
15 #define TM_GMTOFF tm_gmtoff
16 #define TM_ZONE tm_zone
17 #define TZDIR "/usr/share/zoneinfo"
18 #endif /* ndef TM_GMTOFF */
21 ** This header is for use ONLY with the time conversion code.
22 ** There is no guarantee that it will remain unchanged,
23 ** or that it will remain at all.
24 ** Do NOT copy it to any system include directory.
25 ** Thank you!
28 #define GRANDPARENTED "Local time zone must be set--see zic manual page"
31 ** Defaults for preprocessor symbols.
32 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
35 #ifndef HAVE_GETTEXT
36 #define HAVE_GETTEXT 0
37 #endif /* !defined HAVE_GETTEXT */
40 ** Nested includes
43 #include "sys/types.h" /* for time_t */
44 #include "stdio.h"
45 #include "errno.h"
46 #include "string.h"
47 #include "limits.h" /* for CHAR_BIT et al. */
48 #include "time.h"
49 #include "stdlib.h"
51 #if HAVE_GETTEXT
52 #include "libintl.h"
53 #endif /* HAVE_GETTEXT */
55 #include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */
57 #include "unistd.h" /* for F_OK, R_OK, and other POSIX goodness */
59 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
60 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
62 #include "stdint.h"
63 #include <inttypes.h>
66 ** Private function declarations.
69 char * icatalloc(char * old, const char * new);
70 char * icpyalloc(const char * string);
71 const char * scheck(const char * string, const char * format);
74 ** Finally, some convenience items.
77 #ifndef TRUE
78 #define TRUE 1
79 #endif /* !defined TRUE */
81 #ifndef FALSE
82 #define FALSE 0
83 #endif /* !defined FALSE */
85 #ifndef TYPE_BIT
86 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
87 #endif /* !defined TYPE_BIT */
89 #ifndef TYPE_SIGNED
90 #define TYPE_SIGNED(type) (((type) -1) < 0)
91 #endif /* !defined TYPE_SIGNED */
93 /* The minimum and maximum finite time values. */
94 static time_t const time_t_min =
95 (TYPE_SIGNED(time_t)
96 ? (time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1)
97 : 0);
98 static time_t const time_t_max =
99 (TYPE_SIGNED(time_t)
100 ? - (~ 0 < 0) - ((time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1))
101 : -1);
104 ** Since the definition of TYPE_INTEGRAL contains floating point numbers,
105 ** it cannot be used in preprocessor directives.
108 #ifndef TYPE_INTEGRAL
109 #define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5)
110 #endif /* !defined TYPE_INTEGRAL */
112 #ifndef INT_STRLEN_MAXIMUM
114 ** 302 / 1000 is log10(2.0) rounded up.
115 ** Subtract one for the sign bit if the type is signed;
116 ** add one for integer division truncation;
117 ** add one more for a minus sign if the type is signed.
119 #define INT_STRLEN_MAXIMUM(type) \
120 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
121 1 + TYPE_SIGNED(type))
122 #endif /* !defined INT_STRLEN_MAXIMUM */
125 ** INITIALIZE(x)
128 #ifndef GNUC_or_lint
129 #ifdef lint
130 #define GNUC_or_lint
131 #endif /* defined lint */
132 #ifndef lint
133 #ifdef __GNUC__
134 #define GNUC_or_lint
135 #endif /* defined __GNUC__ */
136 #endif /* !defined lint */
137 #endif /* !defined GNUC_or_lint */
139 #ifndef INITIALIZE
140 #ifdef GNUC_or_lint
141 #define INITIALIZE(x) ((x) = 0)
142 #endif /* defined GNUC_or_lint */
143 #ifndef GNUC_or_lint
144 #define INITIALIZE(x)
145 #endif /* !defined GNUC_or_lint */
146 #endif /* !defined INITIALIZE */
149 ** For the benefit of GNU folk...
150 ** `_(MSGID)' uses the current locale's message library string for MSGID.
151 ** The default is to use gettext if available, and use MSGID otherwise.
154 #ifndef _
155 #if HAVE_GETTEXT
156 #define _(msgid) gettext(msgid)
157 #else /* !HAVE_GETTEXT */
158 #define _(msgid) msgid
159 #endif /* !HAVE_GETTEXT */
160 #endif /* !defined _ */
162 #ifndef TZ_DOMAIN
163 #define TZ_DOMAIN "tz"
164 #endif /* !defined TZ_DOMAIN */
166 #ifndef YEARSPERREPEAT
167 #define YEARSPERREPEAT 400 /* years before a Gregorian repeat */
168 #endif /* !defined YEARSPERREPEAT */
171 ** The Gregorian year averages 365.2425 days, which is 31556952 seconds.
174 #ifndef AVGSECSPERYEAR
175 #define AVGSECSPERYEAR 31556952L
176 #endif /* !defined AVGSECSPERYEAR */
178 #ifndef SECSPERREPEAT
179 #define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
180 #endif /* !defined SECSPERREPEAT */
182 #ifndef SECSPERREPEAT_BITS
183 #define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
184 #endif /* !defined SECSPERREPEAT_BITS */
187 ** UNIX was a registered trademark of The Open Group in 2003.
190 #endif /* !defined PRIVATE_H */