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/CLMain.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'command_line/CmdLine/Src/CLMain.c') diff --git a/command_line/CmdLine/Src/CLMain.c b/command_line/CmdLine/Src/CLMain.c index f8247c4..6e041ad 100644 --- a/command_line/CmdLine/Src/CLMain.c +++ b/command_line/CmdLine/Src/CLMain.c @@ -1,10 +1,10 @@ -#include "mwcc_decomp.h" +#include "cmdline.h" jmp_buf exit_program; int numPlugins; CLPluginInfo *pluginInfo; int numPanels; -char **panelNames; +const char **panelNames; CWCommandLineArgs *panel_args; CWCommandLineArgs *plugin_args; Project mainProj; @@ -18,14 +18,14 @@ char cmdline_build_date[32]; char cmdline_build_time[32]; Project *gProj = &mainProj; -static SInt16 CLT_dummymain(void *context) { +static CWPLUGIN_ENTRY(CLT_dummymain)(CWPluginContext) { return 0; } -static SInt16 CLT_GetDropInFlags(const DropInFlags **flags, SInt32 *flagsSize) { +static CWPLUGIN_ENTRY(CLT_GetDropInFlags)(const DropInFlags **flags, SInt32 *flagsSize) { static const DropInFlags sFlags = { kCurrentDropInFlagsVersion, - CWFOURCHAR('c','l','d','r'), + CWDROPINDRIVERTYPE, 7, 0, 0, @@ -36,19 +36,19 @@ static SInt16 CLT_GetDropInFlags(const DropInFlags **flags, SInt32 *flagsSize) { return 0; } -static SInt16 CLT_GetDropInName(const char **dropinName) { +static CWPLUGIN_ENTRY(CLT_GetDropInName)(const char **dropinName) { static const char *sDropInName = "Command-Line Driver"; *dropinName = sDropInName; return 0; } -static SInt16 CLT_GetDisplayName(const char **displayName) { +static CWPLUGIN_ENTRY(CLT_GetDisplayName)(const char **displayName) { static const char *sDisplayName = "Command-Line Driver"; *displayName = sDisplayName; return 0; } -static SInt16 CLT_GetPanelList(const CWPanelList **panelList) { +static CWPLUGIN_ENTRY(CLT_GetPanelList)(const CWPanelList **panelList) { static const char *sPanelNames[4]; static CWPanelList sPanelList = { kCurrentCWPanelListVersion, @@ -70,7 +70,7 @@ static SInt16 CLT_GetPanelList(const CWPanelList **panelList) { return 0; } -static SInt16 CLT_GetTargetList(const CWTargetList **targetList) { +static CWPLUGIN_ENTRY(CLT_GetTargetList)(const CWTargetList **targetList) { static FourCharCode sCPU = targetCPUAny; static FourCharCode sOS = targetOSAny; static CWTargetList sTargetList = { @@ -84,7 +84,7 @@ static SInt16 CLT_GetTargetList(const CWTargetList **targetList) { return 0; } -static SInt16 CLT_GetVersionInfo(const VersionInfo **versioninfo) { +static CWPLUGIN_ENTRY(CLT_GetVersionInfo)(const VersionInfo **versioninfo) { static const VersionInfo vi = { 3, 0, 0, 0 }; @@ -92,7 +92,7 @@ static SInt16 CLT_GetVersionInfo(const VersionInfo **versioninfo) { return 0; } -static SInt16 CLT_GetFileTypeMappings(const OSFileTypeMappingList **mappinglist) { +static CWPLUGIN_ENTRY(CLT_GetFileTypeMappings)(const OSFileTypeMappingList **mappinglist) { static const OSFileTypeMapping ftmes[2] = { {CWFOURCHAR('B','r','w','s'), "DubL", 4, 0, 0}, {CWFOURCHAR('M','M','P','r'), "looc", 4, 0, 0} @@ -278,12 +278,6 @@ int Main_Terminate(int exitcode) { return exitcode; } -enum { - ResultCode_0 = 0, - ResultCode_1 = 1, - ResultCode_2 = 2 -}; - static int Main_ParseCommandLine() { Plugin *parser; CWCommandLineArgs myargs; @@ -308,7 +302,7 @@ static int Main_ParseCommandLine() { myargs.envp = 0; if (!SendParserRequest(parser, gTarg, &myargs, gTarg->cpu, gTarg->os, numPlugins, pluginInfo, numPanels, panelNames, plugin_args, panel_args, cmdline_build_date, cmdline_build_time, Plugin_GetToolVersionInfo())) { - return CheckForUserBreak() ? ResultCode_2 : ResultCode_1; + return CheckForUserBreak() ? Result_Cancelled : Result_Failed; } if (clState.pluginDebug) { @@ -340,7 +334,7 @@ static int Main_ParseCommandLine() { } } - return ResultCode_0; + return Result_Success; } static int Main_SetupParamBlock() { @@ -622,7 +616,7 @@ static int Main_SetupContext() { CLFatalError("The linker plugin was not found!"); } - gTarg->linkmodel = 0; + gTarg->linkmodel = LinkModel0; Framework_GetEnvInfo(); return 1; -- cgit v1.2.3