xref: /onnv-gate/usr/src/cmd/filebench/common/misc.h (revision 5184:da60d2b4a9e2)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _FB_MISC_H
27 #define	_FB_MISC_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include "config.h"
32 
33 #include <stdio.h>
34 #ifdef HAVE_STDINT_H
35 #include <stdint.h>
36 #endif
37 
38 #include <sys/times.h>
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 #define	DATE_VAR "date"
45 #define	SCRIPT_VAR "scriptname"
46 #define	HOST_VAR "hostname"
47 
48 #ifndef HAVE_HRTIME
49 uint64_t gethrtime();
50 #define	hrtime_t uint64_t
51 #endif
52 #define	FSECS (double)1000000000.0
53 
54 #define	LOG_INFO 1
55 #define	LOG_VERBOSE 2
56 #define	LOG_DEBUG_SCRIPT 3
57 #define	LOG_DEBUG_IMPL 5
58 #define	LOG_DEBUG_NEVER 10
59 #define	LOG_LOG 1000
60 #define	LOG_DUMP 1001
61 #define	LOG_FATAL 999
62 #define	LOG_ERROR 0
63 
64 var_t *date_var(var_t *var);
65 var_t *script_var(var_t *var);
66 var_t *host_var(var_t *var);
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _FB_MISC_H */
73