version 1.5, 2001/07/17 02:23:59 |
version 1.6, 2001/07/18 22:26:00 |
|
|
#include "rpc_parse.h" |
#include "rpc_parse.h" |
#include "rpc_util.h" |
#include "rpc_util.h" |
|
|
static void pconstdef __P((definition *)); |
static pconstdef __P((definition *)); |
static void pargdef __P((definition *)); |
static pargdef __P((definition *)); |
static void pstructdef __P((definition *)); |
static pstructdef __P((definition *)); |
static void puniondef __P((definition *)); |
static puniondef __P((definition *)); |
static void pprogramdef __P((definition *)); |
static pprogramdef __P((definition *)); |
static void penumdef __P((definition *)); |
static penumdef __P((definition *)); |
static void ptypedef __P((definition *)); |
static ptypedef __P((definition *)); |
static void pdefine __P((char *, char *)); |
static pdefine __P((char *, char *)); |
static void puldefine __P((char *, char *)); |
static puldefine __P((char *, char *)); |
static int define_printed __P((proc_list *, version_list *)); |
static define_printed __P((proc_list *, version_list *)); |
static int undefined2 __P((char *, char *)); |
static undefined2 __P((char *, char *)); |
static void parglist __P((proc_list *, char *)); |
static parglist __P((proc_list *, char *)); |
|
|
/* |
/* |
* Print the C-version of an xdr definition |
* Print the C-version of an xdr definition |
|
|
f_print(fout, "\n"); |
f_print(fout, "\n"); |
pprogramdef(def); |
pprogramdef(def); |
break; |
break; |
case DEF_CONST: |
} |
case DEF_STRUCT: |
|
case DEF_UNION: |
|
case DEF_ENUM: |
|
case DEF_TYPEDEF: |
|
break; |
|
} |
|
} |
} |
|
|
void |
|
pxdrfuncdecl( name, pointerp ) |
pxdrfuncdecl( name, pointerp ) |
char* name; |
char* name; |
int pointerp; |
int pointerp; |
{ |
{ |
|
|
f_print(fout,"#ifdef __cplusplus\n"); |
f_print(fout,"#ifdef __cplusplus\n"); |
|
|
} |
} |
|
|
|
|
static void |
static |
pconstdef(def) |
pconstdef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
/* print out the definitions for the arguments of functions in the |
/* print out the definitions for the arguments of functions in the |
header file |
header file |
*/ |
*/ |
static void |
static |
pargdef(def) |
pargdef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
} |
} |
|
|
|
|
static void |
static |
pstructdef(def) |
pstructdef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
f_print(fout, "typedef struct %s %s;\n", name, name); |
f_print(fout, "typedef struct %s %s;\n", name, name); |
} |
} |
|
|
static void |
static |
puniondef(def) |
puniondef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
f_print(fout, "typedef struct %s %s;\n", name, name); |
f_print(fout, "typedef struct %s %s;\n", name, name); |
} |
} |
|
|
static void |
static |
pdefine(name, num) |
pdefine(name, num) |
char *name; |
char *name; |
char *num; |
char *num; |
|
|
f_print(fout, "#define %s %s\n", name, num); |
f_print(fout, "#define %s %s\n", name, num); |
} |
} |
|
|
static void |
static |
puldefine(name, num) |
puldefine(name, num) |
char *name; |
char *name; |
char *num; |
char *num; |
|
|
f_print(fout, "#define %s ((u_long)%s)\n", name, num); |
f_print(fout, "#define %s ((u_long)%s)\n", name, num); |
} |
} |
|
|
static int |
static |
define_printed(stop, start) |
define_printed(stop, start) |
proc_list *stop; |
proc_list *stop; |
version_list *start; |
version_list *start; |
|
|
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
|
static void |
static |
pprogramdef(def) |
pprogramdef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
} |
} |
} |
} |
|
|
void |
|
pprocdef(proc, vp, addargtype, server_p,mode) |
pprocdef(proc, vp, addargtype, server_p,mode) |
proc_list *proc; |
proc_list *proc; |
version_list *vp; |
version_list *vp; |
|
|
|
|
|
|
/* print out argument list of procedure */ |
/* print out argument list of procedure */ |
static void |
static |
parglist(proc, addargtype) |
parglist(proc, addargtype) |
proc_list *proc; |
proc_list *proc; |
char* addargtype; |
char* addargtype; |
|
|
f_print(fout, "%s);\n", addargtype); |
f_print(fout, "%s);\n", addargtype); |
} |
} |
|
|
static void |
static |
penumdef(def) |
penumdef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
f_print(fout, "typedef enum %s %s;\n", name, name); |
f_print(fout, "typedef enum %s %s;\n", name, name); |
} |
} |
|
|
static void |
static |
ptypedef(def) |
ptypedef(def) |
definition *def; |
definition *def; |
{ |
{ |
|
|
} |
} |
} |
} |
|
|
void |
|
pdeclaration(name, dec, tab, separator) |
pdeclaration(name, dec, tab, separator) |
char *name; |
char *name; |
declaration *dec; |
declaration *dec; |
|
|
f_print(fout, separator ); |
f_print(fout, separator ); |
} |
} |
|
|
static int |
static |
undefined2(type, stop) |
undefined2(type, stop) |
char *type; |
char *type; |
char *stop; |
char *stop; |