xref: /illumos-gate/usr/src/cmd/ast/libast/sparcv9/FEATURE/tv (revision 379728489ed47862c4927c75771e767b9476c9c4)
1
2/* : : generated by proto : : */
3/* : : generated from contrib/ast/src/lib/libast/features/tv by iffe version 2012-07-17 : : */
4
5#ifndef _TV_H
6#if !defined(__PROTO__)
7#  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
8#    if defined(__cplusplus)
9#      define __LINKAGE__	"C"
10#    else
11#      define __LINKAGE__
12#    endif
13#    define __STDARG__
14#    define __PROTO__(x)	x
15#    define __OTORP__(x)
16#    define __PARAM__(n,o)	n
17#    if !defined(__STDC__) && !defined(__cplusplus)
18#      if !defined(c_plusplus)
19#      	define const
20#      endif
21#      define signed
22#      define void		int
23#      define volatile
24#      define __V_		char
25#    else
26#      define __V_		void
27#    endif
28#  else
29#    define __PROTO__(x)	()
30#    define __OTORP__(x)	x
31#    define __PARAM__(n,o)	o
32#    define __LINKAGE__
33#    define __V_		char
34#    define const
35#    define signed
36#    define void		int
37#    define volatile
38#  endif
39#  define __MANGLE__	__LINKAGE__
40#  if defined(__cplusplus) || defined(c_plusplus)
41#    define __VARARG__	...
42#  else
43#    define __VARARG__
44#  endif
45#  if defined(__STDARG__)
46#    define __VA_START__(p,a)	va_start(p,a)
47#  else
48#    define __VA_START__(p,a)	va_start(p)
49#  endif
50#  if !defined(__INLINE__)
51#    if defined(__cplusplus)
52#      define __INLINE__	extern __MANGLE__ inline
53#    else
54#      if defined(_WIN32) && !defined(__GNUC__)
55#      	define __INLINE__	__inline
56#      endif
57#    endif
58#  endif
59#endif
60#if !defined(__LINKAGE__)
61#define __LINKAGE__		/* 2004-08-11 transition */
62#endif
63
64#define _TV_H	1
65/*
66 * AT&T Research
67 *
68 * high resolution Tv_t interface definitions
69 */
70
71#include <ast.h>
72
73#define TV_NSEC_IGNORE		(1000000000L)
74#define TV_TOUCH_RETAIN		((Tv_t*)1)
75
76typedef struct Tv_s
77{
78	uint32_t	tv_sec;
79	uint32_t	tv_nsec;
80} Tv_t;
81
82#define ST_ATIME_NSEC_GET(st)	((st)->st_atim.tv_nsec)
83#define ST_CTIME_NSEC_GET(st)	((st)->st_ctim.tv_nsec)
84#define ST_MTIME_NSEC_GET(st)	((st)->st_mtim.tv_nsec)
85
86#define ST_ATIME_NSEC_SET(st,n)	(ST_ATIME_NSEC_GET(st)=(n))
87#define ST_CTIME_NSEC_SET(st,n)	(ST_CTIME_NSEC_GET(st)=(n))
88#define ST_MTIME_NSEC_SET(st,n)	(ST_MTIME_NSEC_GET(st)=(n))
89
90#define tvgetatime(t,s)	((t)->tv_nsec=ST_ATIME_NSEC_GET(s),(t)->tv_sec=(s)->st_atime)
91#define tvgetmtime(t,s)	((t)->tv_nsec=ST_MTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_mtime)
92#define tvgetctime(t,s)	((t)->tv_nsec=ST_CTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_ctime)
93
94#define tvsetatime(t,s)	(ST_ATIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_atime=(t)->tv_sec)
95#define tvsetmtime(t,s)	(ST_MTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_mtime=(t)->tv_sec)
96#define tvsetctime(t,s)	(ST_CTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_ctime=(t)->tv_sec)
97
98#if _BLD_ast && defined(__EXPORT__)
99#undef __MANGLE__
100#define __MANGLE__ __LINKAGE__		__EXPORT__
101#endif
102
103extern __MANGLE__ int		tvgettime __PROTO__((Tv_t*));
104extern __MANGLE__ int		tvsettime __PROTO__((const Tv_t*));
105extern __MANGLE__ int		tvcmp __PROTO__((const Tv_t*, const Tv_t*));
106extern __MANGLE__ int		tvtouch __PROTO__((const char*, const Tv_t*, const Tv_t*, const Tv_t*, int));
107extern __MANGLE__ int		tvsleep __PROTO__((const Tv_t*, Tv_t*));
108
109extern __MANGLE__ char*		fmttv __PROTO__((const char*, Tv_t*));
110
111#endif
112