11897Swollman/*
299979Salfred * $FreeBSD$
399979Salfred */
499979Salfred/*
51897Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
61897Swollman * unrestricted use provided that this legend is included on all tape
71897Swollman * media and as a part of the software program in whole or part.  Users
81897Swollman * may copy or modify Sun RPC without charge, but are not authorized
91897Swollman * to license or distribute it to anyone else except as part of a product or
101897Swollman * program developed by the user.
11100441Scharnier *
121897Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
131897Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
141897Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15100441Scharnier *
161897Swollman * Sun RPC is provided with no support and without any obligation on the
171897Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
181897Swollman * modification or enhancement.
19100441Scharnier *
201897Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
211897Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
221897Swollman * OR ANY PART THEREOF.
23100441Scharnier *
241897Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
251897Swollman * or profits or other special, indirect and consequential damages, even if
261897Swollman * Sun has been advised of the possibility of such damages.
27100441Scharnier *
281897Swollman * Sun Microsystems, Inc.
291897Swollman * 2550 Garcia Avenue
301897Swollman * Mountain View, California  94043
311897Swollman */
3299979Salfred/* #pragma ident   "@(#)rpc_parse.h 1.10     94/05/15 SMI" */
331897Swollman
3412798Swpaul/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
3512798Swpaul/*	  All Rights Reserved  	*/
3612798Swpaul
3712798Swpaul/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
3812798Swpaul/*	The copyright notice above does not evidence any   	*/
3912798Swpaul/*	actual or intended publication of such source code.	*/
4012798Swpaul
4112798Swpaul
4212798Swpaul/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4312798Swpaul*	PROPRIETARY NOTICE (Combined)
4412798Swpaul*
4512798Swpaul* This source code is unpublished proprietary information
4612798Swpaul* constituting, or derived under license from AT&T's UNIX(r) System V.
4712798Swpaul* In addition, portions of such source code were derived from Berkeley
4812798Swpaul* 4.3 BSD under license from the Regents of the University of
4912798Swpaul* California.
5012798Swpaul*
5112798Swpaul*
5212798Swpaul*
53100441Scharnier*	Copyright Notice
5412798Swpaul*
55100441Scharnier* Notice of copyright on this source code product does not indicate
5612798Swpaul*  publication.
5712798Swpaul*
5812798Swpaul*	(c) 1986,1987,1988.1989  Sun Microsystems, Inc
5912798Swpaul*	(c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
6012798Swpaul*          All rights reserved.
61100441Scharnier*/
6212798Swpaul
6312798Swpaul/*      @(#)rpc_parse.h  1.3  90/08/29  (C) 1987 SMI   */
6412798Swpaul
651897Swollman/*
66100441Scharnier * rpc_parse.h, Definitions for the RPCL parser
671897Swollman */
681897Swollman
691897Swollmanenum defkind {
701897Swollman	DEF_CONST,
711897Swollman	DEF_STRUCT,
721897Swollman	DEF_UNION,
731897Swollman	DEF_ENUM,
741897Swollman	DEF_TYPEDEF,
751897Swollman	DEF_PROGRAM
761897Swollman};
771897Swollmantypedef enum defkind defkind;
781897Swollman
79152398Sdwmalonetypedef const char *const_def;
801897Swollman
811897Swollmanenum relation {
821897Swollman	REL_VECTOR,	/* fixed length array */
831897Swollman	REL_ARRAY,	/* variable length array */
841897Swollman	REL_POINTER,	/* pointer */
851897Swollman	REL_ALIAS,	/* simple */
861897Swollman};
871897Swollmantypedef enum relation relation;
881897Swollman
891897Swollmanstruct typedef_def {
90152398Sdwmalone	const char *old_prefix;
91152398Sdwmalone	const char *old_type;
921897Swollman	relation rel;
93152398Sdwmalone	const char *array_max;
941897Swollman};
951897Swollmantypedef struct typedef_def typedef_def;
961897Swollman
971897Swollmanstruct enumval_list {
98152398Sdwmalone	const char *name;
99152398Sdwmalone	const char *assignment;
1001897Swollman	struct enumval_list *next;
1011897Swollman};
1021897Swollmantypedef struct enumval_list enumval_list;
1031897Swollman
1041897Swollmanstruct enum_def {
1051897Swollman	enumval_list *vals;
1061897Swollman};
1071897Swollmantypedef struct enum_def enum_def;
1081897Swollman
1091897Swollmanstruct declaration {
110152398Sdwmalone	const char *prefix;
111152398Sdwmalone	const char *type;
112152398Sdwmalone	const char *name;
1131897Swollman	relation rel;
114152398Sdwmalone	const char *array_max;
1151897Swollman};
1161897Swollmantypedef struct declaration declaration;
1171897Swollman
1181897Swollmanstruct decl_list {
1191897Swollman	declaration decl;
1201897Swollman	struct decl_list *next;
1211897Swollman};
1221897Swollmantypedef struct decl_list decl_list;
1231897Swollman
1241897Swollmanstruct struct_def {
1251897Swollman	decl_list *decls;
1261897Swollman};
1271897Swollmantypedef struct struct_def struct_def;
1281897Swollman
1291897Swollmanstruct case_list {
130152398Sdwmalone	const char *case_name;
13112798Swpaul	int contflag;
1321897Swollman	declaration case_decl;
1331897Swollman	struct case_list *next;
1341897Swollman};
1351897Swollmantypedef struct case_list case_list;
1361897Swollman
1371897Swollmanstruct union_def {
1381897Swollman	declaration enum_decl;
1391897Swollman	case_list *cases;
1401897Swollman	declaration *default_decl;
1411897Swollman};
1421897Swollmantypedef struct union_def union_def;
1431897Swollman
14412798Swpaulstruct arg_list {
14512798Swpaul	char *argname; /* name of struct for arg*/
14612798Swpaul	decl_list *decls;
14712798Swpaul};
14812798Swpaul
14912798Swpaultypedef struct arg_list arg_list;
1501897Swollman
1511897Swollmanstruct proc_list {
152152398Sdwmalone	const char *proc_name;
153152398Sdwmalone	const char *proc_num;
15412798Swpaul	arg_list args;
15512798Swpaul	int arg_num;
156152398Sdwmalone	const char *res_type;
157152398Sdwmalone	const char *res_prefix;
1581897Swollman	struct proc_list *next;
1591897Swollman};
1601897Swollmantypedef struct proc_list proc_list;
1611897Swollman
1621897Swollmanstruct version_list {
163152398Sdwmalone	const char *vers_name;
164152398Sdwmalone	const char *vers_num;
1651897Swollman	proc_list *procs;
1661897Swollman	struct version_list *next;
1671897Swollman};
1681897Swollmantypedef struct version_list version_list;
1691897Swollman
1701897Swollmanstruct program_def {
171152398Sdwmalone	const char *prog_num;
1721897Swollman	version_list *versions;
1731897Swollman};
1741897Swollmantypedef struct program_def program_def;
1751897Swollman
1761897Swollmanstruct definition {
177152398Sdwmalone	const char *def_name;
1781897Swollman	defkind def_kind;
1791897Swollman	union {
1801897Swollman		const_def co;
1811897Swollman		struct_def st;
1821897Swollman		union_def un;
1831897Swollman		enum_def en;
1841897Swollman		typedef_def ty;
1851897Swollman		program_def pr;
1861897Swollman	} def;
1871897Swollman};
1881897Swollmantypedef struct definition definition;
1891897Swollman
190149682Sstefanfdefinition *get_definition(void);
19112798Swpaul
19212798Swpaul
19312798Swpaulstruct bas_type
19412798Swpaul{
195152398Sdwmalone  const char *name;
19612798Swpaul  int length;
19712798Swpaul  struct bas_type *next;
19812798Swpaul};
19912798Swpaul
20012798Swpaultypedef struct bas_type bas_type;
201