9 * high resolution Tv_t interface definitions
14 #define TV_NSEC_IGNORE (1000000000L)
15 #define TV_TOUCH_RETAIN ((Tv_t*)1)
24 if mem stat.st_mtimespec.tv_nsec sys/stat.h {
25 #define ST_ATIME_NSEC_GET(st) ((st)->st_atimespec.tv_nsec)
26 #define ST_CTIME_NSEC_GET(st) ((st)->st_ctimespec.tv_nsec)
27 #define ST_MTIME_NSEC_GET(st) ((st)->st_mtimespec.tv_nsec)
29 elif mem stat.st_mtim.st__tim.tv_nsec sys/stat.h {
30 #define ST_ATIME_NSEC_GET(st) ((st)->st_atim.st__tim.tv_nsec)
31 #define ST_CTIME_NSEC_GET(st) ((st)->st_ctim.st__tim.tv_nsec)
32 #define ST_MTIME_NSEC_GET(st) ((st)->st_mtim.st__tim.tv_nsec)
34 elif mem stat.st_mtim.tv_nsec sys/stat.h {
35 #define ST_ATIME_NSEC_GET(st) ((st)->st_atim.tv_nsec)
36 #define ST_CTIME_NSEC_GET(st) ((st)->st_ctim.tv_nsec)
37 #define ST_MTIME_NSEC_GET(st) ((st)->st_mtim.tv_nsec)
39 elif mem stat.st_mtimensec sys/stat.h {
40 #define ST_ATIME_NSEC_GET(st) ((st)->st_atimensec)
41 #define ST_CTIME_NSEC_GET(st) ((st)->st_ctimensec)
42 #define ST_MTIME_NSEC_GET(st) ((st)->st_mtimensec)
44 else pass{ no_stat_nsec=1 }end {
45 #define ST_ATIME_NSEC_GET(st) 0
46 #define ST_CTIME_NSEC_GET(st) 0
47 #define ST_MTIME_NSEC_GET(st) 0
49 #define ST_ATIME_NSEC_SET(st,n) 0
50 #define ST_CTIME_NSEC_SET(st,n) 0
51 #define ST_MTIME_NSEC_SET(st,n) 0
54 if ( !no_stat_nsec ) {
55 #define ST_ATIME_NSEC_SET(st,n) (ST_ATIME_NSEC_GET(st)=(n))
56 #define ST_CTIME_NSEC_SET(st,n) (ST_CTIME_NSEC_GET(st)=(n))
57 #define ST_MTIME_NSEC_SET(st,n) (ST_MTIME_NSEC_GET(st)=(n))
62 #define tvgetatime(t,s) ((t)->tv_nsec=ST_ATIME_NSEC_GET(s),(t)->tv_sec=(s)->st_atime)
63 #define tvgetmtime(t,s) ((t)->tv_nsec=ST_MTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_mtime)
64 #define tvgetctime(t,s) ((t)->tv_nsec=ST_CTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_ctime)
66 #define tvsetatime(t,s) (ST_ATIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_atime=(t)->tv_sec)
67 #define tvsetmtime(t,s) (ST_MTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_mtime=(t)->tv_sec)
68 #define tvsetctime(t,s) (ST_CTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_ctime=(t)->tv_sec)
70 #if _BLD_ast && defined(__EXPORT__)
71 #define extern __EXPORT__
74 extern int tvgettime(Tv_t*);
75 extern int tvsettime(const Tv_t*);
76 extern int tvcmp(const Tv_t*, const Tv_t*);
77 extern int tvtouch(const char*, const Tv_t*, const Tv_t*, const Tv_t*, int);
78 extern int tvsleep(const Tv_t*, Tv_t*);
80 extern char* fmttv(const char*, Tv_t*);