|
Packit |
6c4009 |
/* @(#)rpc_parse.h 1.3 90/08/29
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* Copyright (c) 2010, Oracle America, Inc.
|
|
Packit |
6c4009 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
6c4009 |
* modification, are permitted provided that the following conditions are
|
|
Packit |
6c4009 |
* met:
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* * Redistributions of source code must retain the above copyright
|
|
Packit |
6c4009 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
6c4009 |
* * Redistributions in binary form must reproduce the above
|
|
Packit |
6c4009 |
* copyright notice, this list of conditions and the following
|
|
Packit |
6c4009 |
* disclaimer in the documentation and/or other materials
|
|
Packit |
6c4009 |
* provided with the distribution.
|
|
Packit |
6c4009 |
* * Neither the name of the "Oracle America, Inc." nor the names of its
|
|
Packit |
6c4009 |
* contributors may be used to endorse or promote products derived
|
|
Packit |
6c4009 |
* from this software without specific prior written permission.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit |
6c4009 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit |
6c4009 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
Packit |
6c4009 |
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
Packit |
6c4009 |
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
Packit |
6c4009 |
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
6c4009 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
Packit |
6c4009 |
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
Packit |
6c4009 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
Packit |
6c4009 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
Packit |
6c4009 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
6c4009 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* rpc_parse.h, Definitions for the RPCL parser
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
enum defkind {
|
|
Packit |
6c4009 |
DEF_CONST,
|
|
Packit |
6c4009 |
DEF_STRUCT,
|
|
Packit |
6c4009 |
DEF_UNION,
|
|
Packit |
6c4009 |
DEF_ENUM,
|
|
Packit |
6c4009 |
DEF_TYPEDEF,
|
|
Packit |
6c4009 |
DEF_PROGRAM
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef enum defkind defkind;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef const char *const_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
enum relation {
|
|
Packit |
6c4009 |
REL_VECTOR, /* fixed length array */
|
|
Packit |
6c4009 |
REL_ARRAY, /* variable length array */
|
|
Packit |
6c4009 |
REL_POINTER, /* pointer */
|
|
Packit |
6c4009 |
REL_ALIAS /* simple */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef enum relation relation;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct typedef_def {
|
|
Packit |
6c4009 |
const char *old_prefix;
|
|
Packit |
6c4009 |
const char *old_type;
|
|
Packit |
6c4009 |
relation rel;
|
|
Packit |
6c4009 |
const char *array_max;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct typedef_def typedef_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct enumval_list {
|
|
Packit |
6c4009 |
const char *name;
|
|
Packit |
6c4009 |
const char *assignment;
|
|
Packit |
6c4009 |
struct enumval_list *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct enumval_list enumval_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct enum_def {
|
|
Packit |
6c4009 |
enumval_list *vals;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct enum_def enum_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct declaration {
|
|
Packit |
6c4009 |
const char *prefix;
|
|
Packit |
6c4009 |
const char *type;
|
|
Packit |
6c4009 |
const char *name;
|
|
Packit |
6c4009 |
relation rel;
|
|
Packit |
6c4009 |
const char *array_max;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct declaration declaration;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct decl_list {
|
|
Packit |
6c4009 |
declaration decl;
|
|
Packit |
6c4009 |
struct decl_list *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct decl_list decl_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct struct_def {
|
|
Packit |
6c4009 |
decl_list *decls;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct struct_def struct_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct case_list {
|
|
Packit |
6c4009 |
const char *case_name;
|
|
Packit |
6c4009 |
int contflag;
|
|
Packit |
6c4009 |
declaration case_decl;
|
|
Packit |
6c4009 |
struct case_list *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct case_list case_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct union_def {
|
|
Packit |
6c4009 |
declaration enum_decl;
|
|
Packit |
6c4009 |
case_list *cases;
|
|
Packit |
6c4009 |
declaration *default_decl;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct union_def union_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct arg_list {
|
|
Packit |
6c4009 |
const char *argname; /* name of struct for arg*/
|
|
Packit |
6c4009 |
decl_list *decls;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct arg_list arg_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct proc_list {
|
|
Packit |
6c4009 |
const char *proc_name;
|
|
Packit |
6c4009 |
const char *proc_num;
|
|
Packit |
6c4009 |
arg_list args;
|
|
Packit |
6c4009 |
int arg_num;
|
|
Packit |
6c4009 |
const char *res_type;
|
|
Packit |
6c4009 |
const char *res_prefix;
|
|
Packit |
6c4009 |
struct proc_list *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct proc_list proc_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct version_list {
|
|
Packit |
6c4009 |
const char *vers_name;
|
|
Packit |
6c4009 |
const char *vers_num;
|
|
Packit |
6c4009 |
proc_list *procs;
|
|
Packit |
6c4009 |
struct version_list *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct version_list version_list;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct program_def {
|
|
Packit |
6c4009 |
const char *prog_num;
|
|
Packit |
6c4009 |
version_list *versions;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct program_def program_def;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct definition {
|
|
Packit |
6c4009 |
const char *def_name;
|
|
Packit |
6c4009 |
defkind def_kind;
|
|
Packit |
6c4009 |
union {
|
|
Packit |
6c4009 |
const_def co;
|
|
Packit |
6c4009 |
struct_def st;
|
|
Packit |
6c4009 |
union_def un;
|
|
Packit |
6c4009 |
enum_def en;
|
|
Packit |
6c4009 |
typedef_def ty;
|
|
Packit |
6c4009 |
program_def pr;
|
|
Packit |
6c4009 |
} def;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
typedef struct definition definition;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
definition *get_definition(void);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct bas_type
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
const char *name;
|
|
Packit |
6c4009 |
int length;
|
|
Packit |
6c4009 |
struct bas_type *next;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct bas_type bas_type;
|