summaryrefslogtreecommitdiff
path: root/command_line/CmdLine/Src/CLWriteObjectFile.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
commitd1f153d34b023d81768f6087f67dbfff714bafc9 (patch)
treea694d470a60655d0cda15a70791fbdb90a2398cf /command_line/CmdLine/Src/CLWriteObjectFile.c
parent775b6861666af36d317fb577cf489e2c6377f878 (diff)
downloadMWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.tar.gz
MWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.zip
let's commit all this before my VM blows up and nukes my work
Diffstat (limited to '')
-rw-r--r--command_line/CmdLine/Src/CLWriteObjectFile.c44
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;
+}