1272343Sngie/* 2272343Sngie */ 3272343Sngie/* 4272343Sngie * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5272343Sngie * unrestricted use provided that this legend is included on all tape 6272343Sngie * media and as a part of the software program in whole or part. Users 7272343Sngie * may copy or modify Sun RPC without charge, but are not authorized 8272343Sngie * to license or distribute it to anyone else except as part of a product or 9272343Sngie * program developed by the user. 10272343Sngie * 11272343Sngie * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 12272343Sngie * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 13272343Sngie * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 14272343Sngie * 15272343Sngie * Sun RPC is provided with no support and without any obligation on the 16272343Sngie * part of Sun Microsystems, Inc. to assist in its use, correction, 17272343Sngie * modification or enhancement. 18272343Sngie * 19272343Sngie * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 20272343Sngie * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 21272343Sngie * OR ANY PART THEREOF. 22272343Sngie * 23272343Sngie * In no event will Sun Microsystems, Inc. be liable for any lost revenue 24272343Sngie * or profits or other special, indirect and consequential damages, even if 25272343Sngie * Sun has been advised of the possibility of such damages. 26272343Sngie * 27272343Sngie * Sun Microsystems, Inc. 28272343Sngie * 2550 Garcia Avenue 29272343Sngie * Mountain View, California 94043 30272343Sngie */ 31272343Sngie/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 32272343Sngie/* All Rights Reserved */ 33272343Sngie 34272343Sngie/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */ 35272343Sngie/* The copyright notice above does not evidence any */ 36272343Sngie/* actual or intended publication of such source code. */ 37272343Sngie 38272343Sngie 39272343Sngie/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 40272343Sngie* PROPRIETARY NOTICE (Combined) 41272343Sngie* 42272343Sngie* This source code is unpublished proprietary information 43272343Sngie* constituting, or derived under license from AT&T's UNIX(r) System V. 44272343Sngie* In addition, portions of such source code were derived from Berkeley 45272343Sngie* 4.3 BSD under license from the Regents of the University of 46272343Sngie* California. 47272343Sngie* 48272343Sngie* 49272343Sngie* 50272343Sngie* Copyright Notice 51272343Sngie* 52272343Sngie* Notice of copyright on this source code product does not indicate 53272343Sngie* publication. 54272343Sngie* 55272343Sngie* (c) 1986,1987,1988.1989 Sun Microsystems, Inc 56272343Sngie* (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. 57272343Sngie* All rights reserved. 58272343Sngie*/ 59272343Sngie 60272343Sngie/* 61272343Sngie * rpc_parse.h, Definitions for the RPCL parser 62272343Sngie */ 63272343Sngie 64272343Sngieenum defkind { 65272343Sngie DEF_CONST, 66272343Sngie DEF_STRUCT, 67272343Sngie DEF_UNION, 68272343Sngie DEF_ENUM, 69272343Sngie DEF_TYPEDEF, 70272343Sngie DEF_PROGRAM 71272343Sngie}; 72272343Sngietypedef enum defkind defkind; 73272343Sngie 74272343Sngietypedef const char *const_def; 75272343Sngie 76272343Sngieenum relation { 77272343Sngie REL_VECTOR, /* fixed length array */ 78272343Sngie REL_ARRAY, /* variable length array */ 79272343Sngie REL_POINTER, /* pointer */ 80272343Sngie REL_ALIAS, /* simple */ 81272343Sngie}; 82272343Sngietypedef enum relation relation; 83272343Sngie 84272343Sngiestruct typedef_def { 85272343Sngie const char *old_prefix; 86272343Sngie const char *old_type; 87272343Sngie relation rel; 88272343Sngie const char *array_max; 89272343Sngie}; 90272343Sngietypedef struct typedef_def typedef_def; 91272343Sngie 92272343Sngiestruct enumval_list { 93272343Sngie const char *name; 94272343Sngie const char *assignment; 95272343Sngie struct enumval_list *next; 96272343Sngie}; 97272343Sngietypedef struct enumval_list enumval_list; 98272343Sngie 99272343Sngiestruct enum_def { 100272343Sngie enumval_list *vals; 101272343Sngie}; 102272343Sngietypedef struct enum_def enum_def; 103272343Sngie 104272343Sngiestruct declaration { 105272343Sngie const char *prefix; 106272343Sngie const char *type; 107272343Sngie const char *name; 108272343Sngie relation rel; 109272343Sngie const char *array_max; 110272343Sngie}; 111272343Sngietypedef struct declaration declaration; 112272343Sngie 113272343Sngiestruct decl_list { 114272343Sngie declaration decl; 115272343Sngie struct decl_list *next; 116272343Sngie}; 117272343Sngietypedef struct decl_list decl_list; 118272343Sngie 119272343Sngiestruct struct_def { 120272343Sngie decl_list *decls; 121272343Sngie}; 122272343Sngietypedef struct struct_def struct_def; 123272343Sngie 124272343Sngiestruct case_list { 125272343Sngie const char *case_name; 126272343Sngie int contflag; 127272343Sngie declaration case_decl; 128272343Sngie struct case_list *next; 129272343Sngie}; 130272343Sngietypedef struct case_list case_list; 131272343Sngie 132272343Sngiestruct union_def { 133272343Sngie declaration enum_decl; 134272343Sngie case_list *cases; 135272343Sngie declaration *default_decl; 136272343Sngie}; 137272343Sngietypedef struct union_def union_def; 138272343Sngie 139272343Sngiestruct arg_list { 140272343Sngie char *argname; /* name of struct for arg*/ 141272343Sngie decl_list *decls; 142272343Sngie}; 143272343Sngie 144272343Sngietypedef struct arg_list arg_list; 145272343Sngie 146272343Sngiestruct proc_list { 147272343Sngie const char *proc_name; 148272343Sngie const char *proc_num; 149272343Sngie arg_list args; 150272343Sngie int arg_num; 151272343Sngie const char *res_type; 152272343Sngie const char *res_prefix; 153272343Sngie struct proc_list *next; 154272343Sngie}; 155272343Sngietypedef struct proc_list proc_list; 156272343Sngie 157272343Sngiestruct version_list { 158272343Sngie const char *vers_name; 159272343Sngie const char *vers_num; 160272343Sngie proc_list *procs; 161272343Sngie struct version_list *next; 162272343Sngie}; 163272343Sngietypedef struct version_list version_list; 164272343Sngie 165272343Sngiestruct program_def { 166272343Sngie const char *prog_num; 167272343Sngie version_list *versions; 168272343Sngie}; 169272343Sngietypedef struct program_def program_def; 170272343Sngie 171272343Sngiestruct definition { 172272343Sngie const char *def_name; 173272343Sngie defkind def_kind; 174272343Sngie union { 175272343Sngie const_def co; 176272343Sngie struct_def st; 177272343Sngie union_def un; 178272343Sngie enum_def en; 179272343Sngie typedef_def ty; 180272343Sngie program_def pr; 181272343Sngie } def; 182272343Sngie}; 183272343Sngietypedef struct definition definition; 184272343Sngie 185272343Sngiedefinition *get_definition(void); 186272343Sngie 187272343Sngie 188272343Sngiestruct bas_type 189272343Sngie{ 190272343Sngie const char *name; 191272343Sngie int length; 192272343Sngie struct bas_type *next; 193272343Sngie}; 194272343Sngie 195272343Sngietypedef struct bas_type bas_type; 196272343Sngie