1 /* BLURB gpl
2 
3                            Coda File System
4                               Release 5
5 
6           Copyright (c) 1987-2016 Carnegie Mellon University
7                   Additional copyrights listed below
8 
9 This  code  is  distributed "AS IS" without warranty of any kind under
10 the terms of the GNU General Public Licence Version 2, as shown in the
11 file  LICENSE.  The  technical and financial  contributors to Coda are
12 listed in the file CREDITS.
13 
14                         Additional copyrights
15 
16 #*/
17 
18 /*
19                          IBM COPYRIGHT NOTICE
20 
21                           Copyright (C) 1986
22              International Business Machines Corporation
23                          All Rights Reserved
24 
25 This  file  contains  some  code identical to or derived from the 1986
26 version of the Andrew File System ("AFS"), which is owned by  the  IBM
27 Corporation.   This  code is provided "AS IS" and IBM does not warrant
28 that it is free of infringement of  any  intellectual  rights  of  any
29 third  party.    IBM  disclaims  liability of any kind for any damages
30 whatsoever resulting directly or indirectly from use of this  software
31 or  of  any  derivative work.  Carnegie Mellon University has obtained
32 permission to  modify,  distribute and sublicense this code,  which is
33 based on Version 2  of  AFS  and  does  not  contain  the features and
34 enhancements that are part of  Version 3 of  AFS.  Version 3 of AFS is
35 commercially   available   and  supported  by   Transarc  Corporation,
36 Pittsburgh, PA.
37 
38 */
39 
40 
41 #include <rpc2/rpc2.h>
42 #include <stdlib.h>
43 
44 /* Satya (7/31/96): changed bool, FALSE, TRUE to rp2_bool, RP2_{FALSE,TRUE}
45 to avoid name clash with builtin bool on some versions of gcc; similar to
46 fix in rvmh.h */
47 typedef unsigned char rp2_bool;
48 
49 #define RP2_FALSE	0
50 #define RP2_TRUE	1
51 
52 #define NIL	0
53 
54 /* Subsystem information structure */
55 
56 struct subsystem {
57     char	*subsystem_name;
58     char	*timeout;
59 };
60 
61 /* This structure is used for typed variables (this includes structure fields) */
62 
63 
64 typedef struct {
65     char		*name;
66     MODE		mode;	/* Must be NO_MODE for structure fields */
67     struct entry	*type;
68     char		*array; /* If array structure, array suffix name */
69     char                *arraymax; /* if array && !IN_MODE, array_max_size */
70 } VAR;
71 
72 /* RPC2 types */
73 
74 typedef struct {
75     char	*name;
76     char	*rep;
77 } ENUM;
78 
79 typedef struct {
80     TYPE_TAG	tag;
81 
82     union {
83 
84 	/* when RPC2_STRUCT_TAG => */
85 		VAR	**struct_fields;
86 
87 	/* when RPC2_ENUM_TAG => */
88 		ENUM	**values;
89 
90     }		fields;
91 } RPC2_TYPE;
92 
93 /* Symbol table entry */
94 
95 typedef struct entry {
96     struct entry	*thread;	/* For symbol table */
97     char		*name;
98     char		*bound;		/* NIL => not array, ELSE => bound */
99     RPC2_TYPE		*type;		/* Pointer to underlying RPC2_TYPE */
100     struct entry	*defined;	/* Pointer to type that this was defined in terms of
101 					   (or NIL) */
102 } ENTRY;
103 
104 typedef struct proc {
105     struct proc	*thread;	/* For chaining proc's together */
106     char	*name;
107     VAR		**formals;
108     char	*timeout;	/* NIL => no timeout override */
109     VAR		*bd;		/* Pointer to bulk descriptor parameter */
110     rp2_bool	new_connection;	/* TRUE if this is the unique new connection procedure */
111     char	*op_code;	/* Name of op code for this procedure */
112     int		op_number;	/* Opcode number for this proc */
113     int         linenum;        /* Line number where this proc was defined */
114 } PROC;
115 
116 /* Language values are specified for use in array */
117 typedef enum{ NONE=0, C=1, PASCAL=2, F77=3 } LANGUAGE;
118 
119 
120 typedef struct stubelem {
121     char        *type;
122     char        *name;
123 }  STUBELEM;
124 
125 /*
126  * crout needs to know whether to spit out ansi paste tokens, or
127  * traditional ones.
128  */
129 
130 extern rp2_bool ansi;
131 
132 
133 /* make line number an externally-accessible variable so it can be
134    set on semantic errors for yyerror() and yywarn() */
135 
136 extern int line;
137 
138 
139