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
Родитель 6ebe2daa2c
Коммит b90a415ed9
2 изменённых файлов: 32 добавлений и 2 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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) {