xref: /onnv-gate/usr/src/cmd/filebench/common/parsertypes.h (revision 9801:4a9784073e11)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_FB_PARSERTYPES_H
27 #define	_FB_PARSERTYPES_H
28 
29 #include "config.h"
30 
31 #include "filebench.h"
32 #include "vars.h"
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #ifndef sun
39 typedef unsigned char uchar_t;
40 #endif
41 
42 #define	E_ERROR 1
43 #define	E_USAGE 2
44 #define	FS_FALSE 0
45 #define	FS_TRUE 1
46 
47 #define	FSE_SYSTEM 1
48 
49 typedef struct list {
50 	struct list	*list_next;
51 	avd_t		 list_string;
52 	avd_t		 list_integer;
53 } list_t;
54 
55 typedef struct attr {
56 	int		 attr_name;
57 	struct attr	*attr_next;
58 	avd_t		 attr_avd;
59 	list_t		*attr_param_list;
60 	void		*attr_obj;
61 } attr_t;
62 
63 typedef struct cmd {
64 	void (*cmd)(struct cmd *);
65 	char		*cmd_name;
66 	char		*cmd_tgt1;
67 	char		*cmd_tgt2;
68 	char		*cmd_tgt3;
69 	char		*thread_name;
70 	int		cmd_subtype;
71 	uint64_t	cmd_qty;
72 	struct cmd	*cmd_list;
73 	struct cmd	*cmd_next;
74 	attr_t		*cmd_attr_list;
75 	list_t		*cmd_param_list;
76 	list_t		*cmd_param_list2;
77 } cmd_t;
78 
79 typedef union {
80 	int64_t i;
81 	uchar_t b;
82 	char *s;
83 } fs_u;
84 
85 typedef struct pidlist {
86 	struct pidlist	*pl_next;
87 	int		pl_fd;
88 	pid_t		pl_pid;
89 } pidlist_t;
90 
91 typedef void (*cmdfunc)(cmd_t *);
92 int yy_switchfileparent(FILE *file);
93 int yy_switchfilescript(FILE *file);
94 
95 #ifdef	__cplusplus
96 }
97 #endif
98 
99 #endif	/* _FB_PARSERTYPES_H */
100