1da2e3ebdSchin /*********************************************************************** 2da2e3ebdSchin * * 3da2e3ebdSchin * This software is part of the ast package * 4*3e14f97fSRoger A. Faulkner * Copyright (c) 1985-2010 AT&T Intellectual Property * 5da2e3ebdSchin * and is licensed under the * 6da2e3ebdSchin * Common Public License, Version 1.0 * 77c2fbfb3SApril Chin * by AT&T Intellectual Property * 8da2e3ebdSchin * * 9da2e3ebdSchin * A copy of the License is available at * 10da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt * 11da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 12da2e3ebdSchin * * 13da2e3ebdSchin * Information and Software Systems Research * 14da2e3ebdSchin * AT&T Research * 15da2e3ebdSchin * Florham Park NJ * 16da2e3ebdSchin * * 17da2e3ebdSchin * Glenn Fowler <gsf@research.att.com> * 18da2e3ebdSchin * David Korn <dgk@research.att.com> * 19da2e3ebdSchin * Phong Vo <kpv@research.att.com> * 20da2e3ebdSchin * * 21da2e3ebdSchin ***********************************************************************/ 22da2e3ebdSchin 23da2e3ebdSchin /* : : generated by proto : : */ 24*3e14f97fSRoger A. Faulkner /* : : generated from /home/gisburn/ksh93/ast_ksh_20100309/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2009-12-04 : : */ 25da2e3ebdSchin 26da2e3ebdSchin #ifndef _TMX_H 27da2e3ebdSchin #if !defined(__PROTO__) 28da2e3ebdSchin # if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) 29da2e3ebdSchin # if defined(__cplusplus) 30da2e3ebdSchin # define __LINKAGE__ "C" 31da2e3ebdSchin # else 32da2e3ebdSchin # define __LINKAGE__ 33da2e3ebdSchin # endif 34da2e3ebdSchin # define __STDARG__ 35da2e3ebdSchin # define __PROTO__(x) x 36da2e3ebdSchin # define __OTORP__(x) 37da2e3ebdSchin # define __PARAM__(n,o) n 38da2e3ebdSchin # if !defined(__STDC__) && !defined(__cplusplus) 39da2e3ebdSchin # if !defined(c_plusplus) 40da2e3ebdSchin # define const 41da2e3ebdSchin # endif 42da2e3ebdSchin # define signed 43da2e3ebdSchin # define void int 44da2e3ebdSchin # define volatile 45da2e3ebdSchin # define __V_ char 46da2e3ebdSchin # else 47da2e3ebdSchin # define __V_ void 48da2e3ebdSchin # endif 49da2e3ebdSchin # else 50da2e3ebdSchin # define __PROTO__(x) () 51da2e3ebdSchin # define __OTORP__(x) x 52da2e3ebdSchin # define __PARAM__(n,o) o 53da2e3ebdSchin # define __LINKAGE__ 54da2e3ebdSchin # define __V_ char 55da2e3ebdSchin # define const 56da2e3ebdSchin # define signed 57da2e3ebdSchin # define void int 58da2e3ebdSchin # define volatile 59da2e3ebdSchin # endif 60da2e3ebdSchin # define __MANGLE__ __LINKAGE__ 61da2e3ebdSchin # if defined(__cplusplus) || defined(c_plusplus) 62da2e3ebdSchin # define __VARARG__ ... 63da2e3ebdSchin # else 64da2e3ebdSchin # define __VARARG__ 65da2e3ebdSchin # endif 66da2e3ebdSchin # if defined(__STDARG__) 67da2e3ebdSchin # define __VA_START__(p,a) va_start(p,a) 68da2e3ebdSchin # else 69da2e3ebdSchin # define __VA_START__(p,a) va_start(p) 70da2e3ebdSchin # endif 71da2e3ebdSchin # if !defined(__INLINE__) 72da2e3ebdSchin # if defined(__cplusplus) 73da2e3ebdSchin # define __INLINE__ extern __MANGLE__ inline 74da2e3ebdSchin # else 75da2e3ebdSchin # if defined(_WIN32) && !defined(__GNUC__) 76da2e3ebdSchin # define __INLINE__ __inline 77da2e3ebdSchin # endif 78da2e3ebdSchin # endif 79da2e3ebdSchin # endif 80da2e3ebdSchin #endif 81da2e3ebdSchin #if !defined(__LINKAGE__) 82da2e3ebdSchin #define __LINKAGE__ /* 2004-08-11 transition */ 83da2e3ebdSchin #endif 84da2e3ebdSchin 85da2e3ebdSchin #define _TMX_H 1 86da2e3ebdSchin /* 87da2e3ebdSchin * AT&T Research 88da2e3ebdSchin * 89da2e3ebdSchin * high resolution Time_t support 90da2e3ebdSchin */ 91da2e3ebdSchin 92da2e3ebdSchin #include <tm.h> 93da2e3ebdSchin #include <tv.h> 94da2e3ebdSchin 95da2e3ebdSchin #define TMX_MAXDATE "2554-07-21+23:34:33.709551614 UTC" 96da2e3ebdSchin #define TMX_MAXYEAR 2554 97da2e3ebdSchin #define TMX_MAXSEC ((Time_t)18446744073) 98da2e3ebdSchin #define TMX_MAXNSEC 709551614 99da2e3ebdSchin #define TMX_RESOLUTION 1000000000 100da2e3ebdSchin 101da2e3ebdSchin typedef uint64_t Time_t; 102da2e3ebdSchin typedef uint64_t Tmxsec_t; 103da2e3ebdSchin typedef uint32_t Tmxnsec_t; 104da2e3ebdSchin 105da2e3ebdSchin #define tmxsec(t) ((Tmxsec_t)((t)/1000000000)) 106da2e3ebdSchin #define tmxnsec(t) ((Tmxnsec_t)((t)%1000000000)) 107da2e3ebdSchin #define tmxsns(s,n) (((((Time_t)(s))*1000000000))+((Time_t)(n))) 108da2e3ebdSchin 109da2e3ebdSchin #define TMX_NOTIME ((Time_t)(-1)) 110da2e3ebdSchin #define TMX_NOW tmxgettime() 111da2e3ebdSchin #define TMX_MAXTIME tmxsns(TMX_MAXSEC,TMX_MAXNSEC) 112da2e3ebdSchin 113da2e3ebdSchin #define tmx2tv(t,v) ((v)->tv_nsec=tmxnsec(t),(v)->tv_sec=tmxsec(t)) 114da2e3ebdSchin #define tv2tmx(v) tmxsns((v)->tv_sec,(v)->tv_nsec) 115da2e3ebdSchin 116da2e3ebdSchin #define tmxclock(p) tmxsns(((p)?*(p):time(NiL)),0) 117da2e3ebdSchin 118da2e3ebdSchin #define tmxgetatime(s) tmxsns((s)->st_atime,ST_ATIME_NSEC_GET(s)) 119da2e3ebdSchin #define tmxgetctime(s) tmxsns((s)->st_ctime,ST_CTIME_NSEC_GET(s)) 120da2e3ebdSchin #define tmxgetmtime(s) tmxsns((s)->st_mtime,ST_MTIME_NSEC_GET(s)) 121da2e3ebdSchin 122da2e3ebdSchin #define tmxsetatime(s,t) ((s)->st_atime=tmxsec(t),ST_ATIME_NSEC_SET(s,tmxnsec(t))) 123da2e3ebdSchin #define tmxsetctime(s,t) ((s)->st_ctime=tmxsec(t),ST_CTIME_NSEC_SET(s,tmxnsec(t))) 124da2e3ebdSchin #define tmxsetmtime(s,t) ((s)->st_mtime=tmxsec(t),ST_MTIME_NSEC_SET(s,tmxnsec(t))) 125da2e3ebdSchin 126da2e3ebdSchin #if _BLD_ast && defined(__EXPORT__) 127da2e3ebdSchin #undef __MANGLE__ 128da2e3ebdSchin #define __MANGLE__ __LINKAGE__ __EXPORT__ 129da2e3ebdSchin #endif 130da2e3ebdSchin 131da2e3ebdSchin extern __MANGLE__ Time_t tmxdate __PROTO__((const char*, char**, Time_t)); 13234f9b3eeSRoland Mainz extern __MANGLE__ Time_t tmxduration __PROTO__((const char*, char**)); 133da2e3ebdSchin extern __MANGLE__ char* tmxfmt __PROTO__((char*, size_t, const char*, Time_t)); 134da2e3ebdSchin extern __MANGLE__ Time_t tmxleap __PROTO__((Time_t)); 135da2e3ebdSchin extern __MANGLE__ Tm_t* tmxmake __PROTO__((Time_t)); 136da2e3ebdSchin extern __MANGLE__ Time_t tmxscan __PROTO__((const char*, char**, const char*, char**, Time_t, long)); 137da2e3ebdSchin extern __MANGLE__ int tmxsleep __PROTO__((Time_t)); 138da2e3ebdSchin extern __MANGLE__ Time_t tmxtime __PROTO__((Tm_t*, int)); 13934f9b3eeSRoland Mainz extern __MANGLE__ Tm_t* tmxtm __PROTO__((Tm_t*, Time_t, Tm_zone_t*)); 140da2e3ebdSchin 141da2e3ebdSchin extern __MANGLE__ Time_t tmxgettime __PROTO__((void)); 142da2e3ebdSchin extern __MANGLE__ int tmxsettime __PROTO__((Time_t)); 143da2e3ebdSchin 144da2e3ebdSchin extern __MANGLE__ int tmxtouch __PROTO__((const char*, Time_t, Time_t, Time_t, int)); 145da2e3ebdSchin 146da2e3ebdSchin extern __MANGLE__ char* fmttmx __PROTO__((const char*, Time_t)); 147da2e3ebdSchin 148da2e3ebdSchin #undef __MANGLE__ 149da2e3ebdSchin #define __MANGLE__ __LINKAGE__ 150da2e3ebdSchin 151da2e3ebdSchin #endif 152