1 /*
2  * BEGIN illumos section
3  *   This is an unstable interface; changes may be made
4  *   without notice.
5  * END illumos section
6  */
7 /***********************************************************************
8 *                                                                      *
9 *               This software is part of the ast package               *
10 *          Copyright (c) 1985-2025 AT&T Intellectual Property          *
11 *                         All Rights Reserved                          *
12 *       This software is licensed by AT&T Intellectual Property        *
13 *           under the terms and conditions of the license in           *
14 *          http://www.eclipse.org/org/documents/epl-v10.html           *
15 *      (with an md5 checksum of b35adb5213ca9657e911e9befb180842)      *
16 *                                                                      *
17 *              Information and Software Systems Research               *
18 *                            AT&T Research                             *
19 *                           Florham Park NJ                            *
20 *                                                                      *
21 *                 Glenn Fowler <gsf@research.att.com>                  *
22 *                  David Korn <dgk@research.att.com>                   *
23 *                   Phong Vo <kpv@research.att.com>                    *
24 *                                                                      *
25 ***********************************************************************/
26 
27 /* : : generated by proto : : */
28 /* : : generated from contrib/ast/src/lib/libast/features/tv by iffe version 2012-07-17 : : */
29 
30 #ifndef _TV_H
31 #if !defined(__PROTO__)
32 #  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
33 #    if defined(__cplusplus)
34 #      define __LINKAGE__	"C"
35 #    else
36 #      define __LINKAGE__
37 #    endif
38 #    define __STDARG__
39 #    define __PROTO__(x)	x
40 #    define __OTORP__(x)
41 #    define __PARAM__(n,o)	n
42 #    if !defined(__STDC__) && !defined(__cplusplus)
43 #      if !defined(c_plusplus)
44 #      	define const
45 #      endif
46 #      define signed
47 #      define void		int
48 #      define volatile
49 #      define __V_		char
50 #    else
51 #      define __V_		void
52 #    endif
53 #  else
54 #    define __PROTO__(x)	()
55 #    define __OTORP__(x)	x
56 #    define __PARAM__(n,o)	o
57 #    define __LINKAGE__
58 #    define __V_		char
59 #    define const
60 #    define signed
61 #    define void		int
62 #    define volatile
63 #  endif
64 #  define __MANGLE__	__LINKAGE__
65 #  if defined(__cplusplus) || defined(c_plusplus)
66 #    define __VARARG__	...
67 #  else
68 #    define __VARARG__
69 #  endif
70 #  if defined(__STDARG__)
71 #    define __VA_START__(p,a)	va_start(p,a)
72 #  else
73 #    define __VA_START__(p,a)	va_start(p)
74 #  endif
75 #  if !defined(__INLINE__)
76 #    if defined(__cplusplus)
77 #      define __INLINE__	extern __MANGLE__ inline
78 #    else
79 #      if defined(_WIN32) && !defined(__GNUC__)
80 #      	define __INLINE__	__inline
81 #      endif
82 #    endif
83 #  endif
84 #endif
85 #if !defined(__LINKAGE__)
86 #define __LINKAGE__		/* 2004-08-11 transition */
87 #endif
88 
89 #define _TV_H	1
90 /*
91  * AT&T Research
92  *
93  * high resolution Tv_t interface definitions
94  */
95 
96 #include <ast.h>
97 
98 #define TV_NSEC_IGNORE		(1000000000L)
99 #define TV_TOUCH_RETAIN		((Tv_t*)1)
100 
101 typedef struct Tv_s
102 {
103 	uint32_t	tv_sec;
104 	uint32_t	tv_nsec;
105 } Tv_t;
106 
107 #define ST_ATIME_NSEC_GET(st)	((st)->st_atim.tv_nsec)
108 #define ST_CTIME_NSEC_GET(st)	((st)->st_ctim.tv_nsec)
109 #define ST_MTIME_NSEC_GET(st)	((st)->st_mtim.tv_nsec)
110 
111 #define ST_ATIME_NSEC_SET(st,n)	(ST_ATIME_NSEC_GET(st)=(n))
112 #define ST_CTIME_NSEC_SET(st,n)	(ST_CTIME_NSEC_GET(st)=(n))
113 #define ST_MTIME_NSEC_SET(st,n)	(ST_MTIME_NSEC_GET(st)=(n))
114 
115 #define tvgetatime(t,s)	((t)->tv_nsec=ST_ATIME_NSEC_GET(s),(t)->tv_sec=(s)->st_atime)
116 #define tvgetmtime(t,s)	((t)->tv_nsec=ST_MTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_mtime)
117 #define tvgetctime(t,s)	((t)->tv_nsec=ST_CTIME_NSEC_GET(s),(t)->tv_sec=(s)->st_ctime)
118 
119 #define tvsetatime(t,s)	(ST_ATIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_atime=(t)->tv_sec)
120 #define tvsetmtime(t,s)	(ST_MTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_mtime=(t)->tv_sec)
121 #define tvsetctime(t,s)	(ST_CTIME_NSEC_SET(s,(t)->tv_nsec),(s)->st_ctime=(t)->tv_sec)
122 
123 #if _BLD_ast && defined(__EXPORT__)
124 #undef __MANGLE__
125 #define __MANGLE__ __LINKAGE__		__EXPORT__
126 #endif
127 
128 extern __MANGLE__ int		tvgettime __PROTO__((Tv_t*));
129 extern __MANGLE__ int		tvsettime __PROTO__((const Tv_t*));
130 extern __MANGLE__ int		tvcmp __PROTO__((const Tv_t*, const Tv_t*));
131 extern __MANGLE__ int		tvtouch __PROTO__((const char*, const Tv_t*, const Tv_t*, const Tv_t*, int));
132 extern __MANGLE__ int		tvsleep __PROTO__((const Tv_t*, Tv_t*));
133 
134 extern __MANGLE__ char*		fmttv __PROTO__((const char*, Tv_t*));
135 
136 #endif
137