1/* $NetBSD: rpc_parse.h,v 1.3 1995/06/11 21:50:00 pk Exp $ */ 2/* 3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 4 * unrestricted use provided that this legend is included on all tape 5 * media and as a part of the software program in whole or part. Users 6 * may copy or modify Sun RPC without charge, but are not authorized 7 * to license or distribute it to anyone else except as part of a product or 8 * program developed by the user or with the express written consent of 9 * Sun Microsystems, Inc. 10 * 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 14 * 15 * Sun RPC is provided with no support and without any obligation on the 16 * part of Sun Microsystems, Inc. to assist in its use, correction, 17 * modification or enhancement. 18 * 19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 21 * OR ANY PART THEREOF. 22 * 23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 24 * or profits or other special, indirect and consequential damages, even if 25 * Sun has been advised of the possibility of such damages. 26 * 27 * Sun Microsystems, Inc. 28 * 2550 Garcia Avenue 29 * Mountain View, California 94043 30 */ 31 32/* @(#)rpc_parse.h 1.3 90/08/29 (C) 1987 SMI */ 33 34/* 35 * rpc_parse.h, Definitions for the RPCL parser 36 */ 37 38enum defkind { 39 DEF_CONST, 40 DEF_STRUCT, 41 DEF_UNION, 42 DEF_ENUM, 43 DEF_TYPEDEF, 44 DEF_PROGRAM 45}; 46typedef enum defkind defkind; 47 48typedef char *const_def; 49 50enum relation { 51 REL_VECTOR, /* fixed length array */ 52 REL_ARRAY, /* variable length array */ 53 REL_POINTER, /* pointer */ 54 REL_ALIAS, /* simple */ 55}; 56typedef enum relation relation; 57 58struct typedef_def { 59 char *old_prefix; 60 char *old_type; 61 relation rel; 62 char *array_max; 63}; 64typedef struct typedef_def typedef_def; 65 66struct enumval_list { 67 char *name; 68 char *assignment; 69 struct enumval_list *next; 70}; 71typedef struct enumval_list enumval_list; 72 73struct enum_def { 74 enumval_list *vals; 75}; 76typedef struct enum_def enum_def; 77 78struct declaration { 79 char *prefix; 80 char *type; 81 char *name; 82 relation rel; 83 char *array_max; 84}; 85typedef struct declaration declaration; 86 87struct decl_list { 88 declaration decl; 89 struct decl_list *next; 90}; 91typedef struct decl_list decl_list; 92 93struct struct_def { 94 decl_list *decls; 95}; 96typedef struct struct_def struct_def; 97 98struct case_list { 99 char *case_name; 100 int contflag; 101 declaration case_decl; 102 struct case_list *next; 103}; 104typedef struct case_list case_list; 105 106struct union_def { 107 declaration enum_decl; 108 case_list *cases; 109 declaration *default_decl; 110}; 111typedef struct union_def union_def; 112 113struct arg_list { 114 char *argname; /* name of struct for arg*/ 115 decl_list *decls; 116}; 117 118typedef struct arg_list arg_list; 119 120struct proc_list { 121 char *proc_name; 122 char *proc_num; 123 arg_list args; 124 int arg_num; 125 char *res_type; 126 char *res_prefix; 127 struct proc_list *next; 128}; 129typedef struct proc_list proc_list; 130 131struct version_list { 132 char *vers_name; 133 char *vers_num; 134 proc_list *procs; 135 struct version_list *next; 136}; 137typedef struct version_list version_list; 138 139struct program_def { 140 char *prog_num; 141 version_list *versions; 142}; 143typedef struct program_def program_def; 144 145struct definition { 146 char *def_name; 147 defkind def_kind; 148 union { 149 const_def co; 150 struct_def st; 151 union_def un; 152 enum_def en; 153 typedef_def ty; 154 program_def pr; 155 } def; 156}; 157typedef struct definition definition; 158 159definition *get_definition __P((void)); 160 161struct bas_type 162{ 163 char *name; 164 int length; 165 struct bas_type *next; 166}; 167 168typedef struct bas_type bas_type; 169