1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
23 /* : : generated by proto : : */
24 /* : : generated from /home/gisburn/ksh93/ast_ksh_20100309/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2009-12-04 : : */
27 #if !defined(__PROTO__)
28 # if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
29 # if defined(__cplusplus)
30 # define __LINKAGE__ "C"
35 # define __PROTO__(x) x
37 # define __PARAM__(n,o) n
38 # if !defined(__STDC__) && !defined(__cplusplus)
39 # if !defined(c_plusplus)
50 # define __PROTO__(x) ()
51 # define __OTORP__(x) x
52 # define __PARAM__(n,o) o
60 # define __MANGLE__ __LINKAGE__
61 # if defined(__cplusplus) || defined(c_plusplus)
62 # define __VARARG__ ...
66 # if defined(__STDARG__)
67 # define __VA_START__(p,a) va_start(p,a)
69 # define __VA_START__(p,a) va_start(p)
71 # if !defined(__INLINE__)
72 # if defined(__cplusplus)
73 # define __INLINE__ extern __MANGLE__ inline
75 # if defined(_WIN32) && !defined(__GNUC__)
76 # define __INLINE__ __inline
81 #if !defined(__LINKAGE__)
82 #define __LINKAGE__ /* 2004-08-11 transition */
89 * high resolution Time_t support
95 #define TMX_MAXDATE "2554-07-21+23:34:33.709551614 UTC"
96 #define TMX_MAXYEAR 2554
97 #define TMX_MAXSEC ((Time_t)18446744073)
98 #define TMX_MAXNSEC 709551614
99 #define TMX_RESOLUTION 1000000000
101 typedef uint64_t Time_t
;
102 typedef uint64_t Tmxsec_t
;
103 typedef uint32_t Tmxnsec_t
;
105 #define tmxsec(t) ((Tmxsec_t)((t)/1000000000))
106 #define tmxnsec(t) ((Tmxnsec_t)((t)%1000000000))
107 #define tmxsns(s,n) (((((Time_t)(s))*1000000000))+((Time_t)(n)))
109 #define TMX_NOTIME ((Time_t)(-1))
110 #define TMX_NOW tmxgettime()
111 #define TMX_MAXTIME tmxsns(TMX_MAXSEC,TMX_MAXNSEC)
113 #define tmx2tv(t,v) ((v)->tv_nsec=tmxnsec(t),(v)->tv_sec=tmxsec(t))
114 #define tv2tmx(v) tmxsns((v)->tv_sec,(v)->tv_nsec)
116 #define tmxclock(p) tmxsns(((p)?*(p):time(NiL)),0)
118 #define tmxgetatime(s) tmxsns((s)->st_atime,ST_ATIME_NSEC_GET(s))
119 #define tmxgetctime(s) tmxsns((s)->st_ctime,ST_CTIME_NSEC_GET(s))
120 #define tmxgetmtime(s) tmxsns((s)->st_mtime,ST_MTIME_NSEC_GET(s))
122 #define tmxsetatime(s,t) ((s)->st_atime=tmxsec(t),ST_ATIME_NSEC_SET(s,tmxnsec(t)))
123 #define tmxsetctime(s,t) ((s)->st_ctime=tmxsec(t),ST_CTIME_NSEC_SET(s,tmxnsec(t)))
124 #define tmxsetmtime(s,t) ((s)->st_mtime=tmxsec(t),ST_MTIME_NSEC_SET(s,tmxnsec(t)))
126 #if _BLD_ast && defined(__EXPORT__)
128 #define __MANGLE__ __LINKAGE__ __EXPORT__
131 extern __MANGLE__ Time_t tmxdate
__PROTO__((const char*, char**, Time_t
));
132 extern __MANGLE__ Time_t tmxduration
__PROTO__((const char*, char**));
133 extern __MANGLE__
char* tmxfmt
__PROTO__((char*, size_t, const char*, Time_t
));
134 extern __MANGLE__ Time_t tmxleap
__PROTO__((Time_t
));
135 extern __MANGLE__ Tm_t
* tmxmake
__PROTO__((Time_t
));
136 extern __MANGLE__ Time_t tmxscan
__PROTO__((const char*, char**, const char*, char**, Time_t
, long));
137 extern __MANGLE__
int tmxsleep
__PROTO__((Time_t
));
138 extern __MANGLE__ Time_t tmxtime
__PROTO__((Tm_t
*, int));
139 extern __MANGLE__ Tm_t
* tmxtm
__PROTO__((Tm_t
*, Time_t
, Tm_zone_t
*));
141 extern __MANGLE__ Time_t tmxgettime
__PROTO__((void));
142 extern __MANGLE__
int tmxsettime
__PROTO__((Time_t
));
144 extern __MANGLE__
int tmxtouch
__PROTO__((const char*, Time_t
, Time_t
, Time_t
, int));
146 extern __MANGLE__
char* fmttmx
__PROTO__((const char*, Time_t
));
149 #define __MANGLE__ __LINKAGE__