From d1f153d34b023d81768f6087f67dbfff714bafc9 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 19 Oct 2022 21:16:13 +0100 Subject: let's commit all this before my VM blows up and nukes my work --- command_line/CmdLine/Src/CLWriteObjectFile.c | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'command_line/CmdLine/Src/CLWriteObjectFile.c') 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; +} -- cgit v1.2.3