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