version 1.11, 2002/06/01 01:40:38 |
version 1.12, 2002/07/05 05:39:42 |
|
|
{ |
{ |
|
|
if (def->def_kind == DEF_PROGRAM) /* handle data only */ |
if (def->def_kind == DEF_PROGRAM) /* handle data only */ |
return; |
return; |
|
|
if (def->def_kind != DEF_CONST) |
if (def->def_kind != DEF_CONST) |
fprintf(fout, "\n"); |
fprintf(fout, "\n"); |
|
|
break; |
break; |
} |
} |
if (def->def_kind != DEF_PROGRAM && def->def_kind != DEF_CONST) { |
if (def->def_kind != DEF_PROGRAM && def->def_kind != DEF_CONST) { |
pxdrfuncdecl( def->def_name, |
pxdrfuncdecl(def->def_name, |
def->def_kind != DEF_TYPEDEF || |
def->def_kind != DEF_TYPEDEF || |
!isvectordef(def->def.ty.old_type, def->def.ty.rel)); |
!isvectordef(def->def.ty.old_type, def->def.ty.rel)); |
} |
} |
|
|
pdefine(def->def_name, def->def.co); |
pdefine(def->def_name, def->def.co); |
} |
} |
|
|
/* print out the definitions for the arguments of functions in the |
/* |
header file |
* print out the definitions for the arguments of functions in the |
*/ |
* header file |
|
*/ |
static void |
static void |
pargdef(def) |
pargdef(def) |
definition *def; |
definition *def; |
|
|
proc_list *plist; |
proc_list *plist; |
|
|
for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { |
for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { |
for(plist = vers->procs; plist != NULL; |
for (plist = vers->procs; plist != NULL; |
plist = plist->next) { |
plist = plist->next) { |
if (!newstyle || plist->arg_num < 2) { |
if (!newstyle || plist->arg_num < 2) { |
continue; /* old style or single args */ |
continue; /* old style or single args */ |
|
|
name = plist->args.argname; |
name = plist->args.argname; |
fprintf(fout, "struct %s {\n", name); |
fprintf(fout, "struct %s {\n", name); |
for (l = plist->args.decls; |
for (l = plist->args.decls; |
l != NULL; l = l->next) { |
l != NULL; l = l->next) { |
pdeclaration(name, &l->decl, 1, ";\n"); |
pdeclaration(name, &l->decl, 1, ";\n"); |
} |
} |
fprintf(fout, "};\n"); |
fprintf(fout, "};\n"); |
|
|
* Print out 3 definitions, one for ANSI-C, another for C++, |
* Print out 3 definitions, one for ANSI-C, another for C++, |
* a third for old style C |
* a third for old style C |
*/ |
*/ |
for(i=0; i<3; i++) { |
for (i=0; i<3; i++) { |
if (i==0) { |
if (i==0) { |
fprintf(fout,"\n#ifdef __cplusplus\n"); |
fprintf(fout,"\n#ifdef __cplusplus\n"); |
ext = "extern \"C\" "; |
ext = "extern \"C\" "; |
|
|
char *name; |
char *name; |
declaration *dec; |
declaration *dec; |
int tab; |
int tab; |
char *separator; |
char *separator; |
{ |
{ |
char buf[8]; /* enough to hold "struct ", include NUL */ |
char buf[8]; /* enough to hold "struct ", include NUL */ |
char *prefix; |
char *prefix; |