Added binary file open as first step for creating typelib files.

This commit is contained in:
coop%netscape.com 1999-01-06 23:47:45 +00:00
parent c8b50d42a1
commit 21ec63486f
2 changed files with 32 additions and 2 deletions

View File

@ -490,9 +490,24 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
return 0;
}
if (generate_typelib) {
if (strcmp(basename, "-")) {
outname = g_strdup_printf("%s.xpt", basename);
state.file = fopen(outname, "wb");
if (!state.file) {
perror("error opening output file");
free(outname);
return 0;
}
} else {
state.file = stdout;
}
state.mode = TREESTATE_TYPELIB;
state.tree = top;
if (!process_tree(&state))
ok = process_tree(&state);
free(outname);
if (state.file != stdout)
fclose(state.file);
if (!ok)
return 0;
}
if (generate_docs) {

View File

@ -490,9 +490,24 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
return 0;
}
if (generate_typelib) {
if (strcmp(basename, "-")) {
outname = g_strdup_printf("%s.xpt", basename);
state.file = fopen(outname, "wb");
if (!state.file) {
perror("error opening output file");
free(outname);
return 0;
}
} else {
state.file = stdout;
}
state.mode = TREESTATE_TYPELIB;
state.tree = top;
if (!process_tree(&state))
ok = process_tree(&state);
free(outname);
if (state.file != stdout)
fclose(state.file);
if (!ok)
return 0;
}
if (generate_docs) {