home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / devtools / rpcgen / rpc_parse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-09  |  3.5 KB  |  169 lines

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