Back to index

glibc  2.9
rpc_parse.h
Go to the documentation of this file.
00001 /*
00002  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00003  * unrestricted use provided that this legend is included on all tape
00004  * media and as a part of the software program in whole or part.  Users
00005  * may copy or modify Sun RPC without charge, but are not authorized
00006  * to license or distribute it to anyone else except as part of a product or
00007  * program developed by the user or with the express written consent of
00008  * Sun Microsystems, Inc.
00009  *
00010  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00011  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00012  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00013  *
00014  * Sun RPC is provided with no support and without any obligation on the
00015  * part of Sun Microsystems, Inc. to assist in its use, correction,
00016  * modification or enhancement.
00017  *
00018  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00019  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00020  * OR ANY PART THEREOF.
00021  *
00022  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00023  * or profits or other special, indirect and consequential damages, even if
00024  * Sun has been advised of the possibility of such damages.
00025  *
00026  * Sun Microsystems, Inc.
00027  * 2550 Garcia Avenue
00028  * Mountain View, California  94043
00029  */
00030 
00031 /*      @(#)rpc_parse.h  1.3  90/08/29  (C) 1987 SMI   */
00032 
00033 /*
00034  * rpc_parse.h, Definitions for the RPCL parser
00035  */
00036 
00037 enum defkind {
00038        DEF_CONST,
00039        DEF_STRUCT,
00040        DEF_UNION,
00041        DEF_ENUM,
00042        DEF_TYPEDEF,
00043        DEF_PROGRAM
00044 };
00045 typedef enum defkind defkind;
00046 
00047 typedef const char *const_def;
00048 
00049 enum relation {
00050        REL_VECTOR,   /* fixed length array */
00051        REL_ARRAY,    /* variable length array */
00052        REL_POINTER,  /* pointer */
00053        REL_ALIAS     /* simple */
00054 };
00055 typedef enum relation relation;
00056 
00057 struct typedef_def {
00058        const char *old_prefix;
00059        const char *old_type;
00060        relation rel;
00061        const char *array_max;
00062 };
00063 typedef struct typedef_def typedef_def;
00064 
00065 struct enumval_list {
00066        const char *name;
00067        const char *assignment;
00068        struct enumval_list *next;
00069 };
00070 typedef struct enumval_list enumval_list;
00071 
00072 struct enum_def {
00073        enumval_list *vals;
00074 };
00075 typedef struct enum_def enum_def;
00076 
00077 struct declaration {
00078        const char *prefix;
00079        const char *type;
00080        const char *name;
00081        relation rel;
00082        const char *array_max;
00083 };
00084 typedef struct declaration declaration;
00085 
00086 struct decl_list {
00087        declaration decl;
00088        struct decl_list *next;
00089 };
00090 typedef struct decl_list decl_list;
00091 
00092 struct struct_def {
00093        decl_list *decls;
00094 };
00095 typedef struct struct_def struct_def;
00096 
00097 struct case_list {
00098        const char *case_name;
00099        int contflag;
00100        declaration case_decl;
00101        struct case_list *next;
00102 };
00103 typedef struct case_list case_list;
00104 
00105 struct union_def {
00106        declaration enum_decl;
00107        case_list *cases;
00108        declaration *default_decl;
00109 };
00110 typedef struct union_def union_def;
00111 
00112 struct arg_list {
00113        const char *argname; /* name of struct for arg*/
00114        decl_list *decls;
00115 };
00116 
00117 typedef struct arg_list arg_list;
00118 
00119 struct proc_list {
00120        const char *proc_name;
00121        const char *proc_num;
00122        arg_list args;
00123        int arg_num;
00124        const char *res_type;
00125        const char *res_prefix;
00126        struct proc_list *next;
00127 };
00128 typedef struct proc_list proc_list;
00129 
00130 struct version_list {
00131        const char *vers_name;
00132        const char *vers_num;
00133        proc_list *procs;
00134        struct version_list *next;
00135 };
00136 typedef struct version_list version_list;
00137 
00138 struct program_def {
00139        const char *prog_num;
00140        version_list *versions;
00141 };
00142 typedef struct program_def program_def;
00143 
00144 struct definition {
00145        const char *def_name;
00146        defkind def_kind;
00147        union {
00148               const_def co;
00149               struct_def st;
00150               union_def un;
00151               enum_def en;
00152               typedef_def ty;
00153               program_def pr;
00154        } def;
00155 };
00156 typedef struct definition definition;
00157 
00158 definition *get_definition(void);
00159 
00160 
00161 struct bas_type
00162 {
00163   const char *name;
00164   int length;
00165   struct bas_type *next;
00166 };
00167 
00168 typedef struct bas_type bas_type;