diff options
Diffstat (limited to '')
-rw-r--r-- | command_line/CmdLine/Src/CLWriteObjectFile.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/command_line/CmdLine/Src/CLWriteObjectFile.c b/command_line/CmdLine/Src/CLWriteObjectFile.c index e69de29..6e92114 100644 --- a/command_line/CmdLine/Src/CLWriteObjectFile.c +++ b/command_line/CmdLine/Src/CLWriteObjectFile.c @@ -0,0 +1,44 @@ +#include "cmdline.h" + +extern char STSbuf[256]; + +int WriteObjectFile(File *file, OSType maccreator, OSType mactype) { + FSSpec srcfss; + FSSpec outfss; + +#line 22 + OPTION_ASSERT(file->objectdata && file->compiler); + + OS_OSSpec_To_FSSpec(&file->outfss, &outfss); + OS_OSSpec_To_FSSpec(&file->srcfss, &srcfss); + + if (optsCmdLine.verbose) { + CLReport(16, + (file->tempOnDisk & CmdLineStageMask_Cg) ? "temporary " : "", + OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf))); + } + + if (!Plugin_CL_WriteObjectFile(file->compiler, &srcfss, &outfss, maccreator, mactype, file->objectdata)) + return 0; + else + return 1; +} + +int WriteBrowseData(File *file, OSType maccreator, OSType mactype) { + OSHandle browsehandle; + OSSpec outfss; + const CWObjectFlags *cof; + + cof = Plugin_CL_GetObjectFlags(file->compiler); + outfss = file->outfss; + + OS_NameSpecSetExtension(&outfss.name, optsCompiler.brsFileExt[0] ? optsCompiler.brsFileExt : cof->brsFileExt); + if (optsCmdLine.verbose) { + CLReport(17, OS_SpecToStringRelative(&outfss, NULL, STSbuf, sizeof(STSbuf))); + } + + if (!Browser_PackBrowseFile(file->browsedata, &clState.browseTableHandle, &browsehandle)) + return 0; + + return WriteBinaryHandleToFile(&outfss, maccreator, mactype, &browsehandle) != 0; +} |