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