640 number_to_scaled_string is duplicated in several commands
[unleashed.git] / usr / src / cmd / rpcgen / rpc_parse.h
blob404c6b5a7c1f776732724c7ac7e0f9cfb61bb684
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
29 * University Copyright- Copyright (c) 1982, 1986, 1988
30 * The Regents of the University of California
31 * All Rights Reserved
33 * University Acknowledgment- Portions of this document are derived from
34 * software developed by the University of California, Berkeley, and its
35 * contributors.
38 #ifndef _RPC_PARSE_H
39 #define _RPC_PARSE_H
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
46 * rpc_parse.h, Definitions for the RPCL parser
49 enum defkind {
50 DEF_CONST,
51 DEF_STRUCT,
52 DEF_UNION,
53 DEF_ENUM,
54 DEF_TYPEDEF,
55 DEF_PROGRAM,
56 DEF_RESULT
58 typedef enum defkind defkind;
60 typedef char *const_def;
62 enum relation {
63 REL_VECTOR, /* fixed length array */
64 REL_ARRAY, /* variable length array */
65 REL_POINTER, /* pointer */
66 REL_ALIAS /* simple */
68 typedef enum relation relation;
70 struct typedef_def {
71 char *old_prefix;
72 char *old_type;
73 relation rel;
74 char *array_max;
76 typedef struct typedef_def typedef_def;
78 struct enumval_list {
79 char *name;
80 char *assignment;
81 struct enumval_list *next;
83 typedef struct enumval_list enumval_list;
85 struct enum_def {
86 enumval_list *vals;
88 typedef struct enum_def enum_def;
90 struct declaration {
91 char *prefix;
92 char *type;
93 char *name;
94 relation rel;
95 char *array_max;
97 typedef struct declaration declaration;
99 struct decl_list {
100 declaration decl;
101 struct decl_list *next;
103 typedef struct decl_list decl_list;
105 struct struct_def {
106 decl_list *decls;
107 decl_list *tail;
108 char self_pointer;
110 typedef struct struct_def struct_def;
112 struct case_list {
113 char *case_name;
114 int contflag;
115 declaration case_decl;
116 struct case_list *next;
118 typedef struct case_list case_list;
120 struct union_def {
121 declaration enum_decl;
122 case_list *cases;
123 declaration *default_decl;
125 typedef struct union_def union_def;
127 struct arg_list {
128 char *argname; /* name of struct for arg */
129 decl_list *decls;
132 typedef struct arg_list arg_list;
134 struct proc_list {
135 char *proc_name;
136 char *proc_num;
137 arg_list args;
138 int arg_num;
139 char *res_type;
140 char *res_prefix;
141 struct proc_list *next;
143 typedef struct proc_list proc_list;
145 struct version_list {
146 char *vers_name;
147 char *vers_num;
148 proc_list *procs;
149 struct version_list *next;
151 typedef struct version_list version_list;
153 struct program_def {
154 char *prog_num;
155 version_list *versions;
157 typedef struct program_def program_def;
159 struct definition {
160 char *def_name;
161 defkind def_kind;
162 union {
163 const_def co;
164 struct_def st;
165 union_def un;
166 enum_def en;
167 typedef_def ty;
168 program_def pr;
169 } def;
171 typedef struct definition definition;
173 definition *get_definition();
176 struct bas_type
178 char *name;
179 int length;
180 struct bas_type *next;
183 typedef struct bas_type bas_type;
185 #ifdef __cplusplus
187 #endif
189 #endif /* !_RPC_PARSE_H */