diff options
author | Ash Wolf <ninji@wuffs.org> | 2022-10-11 03:18:42 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2022-10-11 03:18:42 +0100 |
commit | 26b57fbea1a969ef6405365ff78391e9d3605621 (patch) | |
tree | b6f14f5c083d0fbb42c5495eea7c74099ff45315 /command_line/CmdLine/Src/Clients/ClientGlue.c | |
parent | 7d4bee5f8f28b72610c8518e5cb9dc145c68b816 (diff) | |
download | MWCC-26b57fbea1a969ef6405365ff78391e9d3605621.tar.gz MWCC-26b57fbea1a969ef6405365ff78391e9d3605621.zip |
add cmakelists for CLion, tons and tons of reorganisation using new info from the Pro8 compiler
Diffstat (limited to '')
-rw-r--r-- | command_line/CmdLine/Src/Clients/ClientGlue.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/command_line/CmdLine/Src/Clients/ClientGlue.c b/command_line/CmdLine/Src/Clients/ClientGlue.c new file mode 100644 index 0000000..9573f51 --- /dev/null +++ b/command_line/CmdLine/Src/Clients/ClientGlue.c @@ -0,0 +1,57 @@ +#include "mwcc_decomp.h" + +int RegisterResource(const char *name, SInt16 rsrcid, Handle list) { + Handle h; + + if (list == 0) { + h = GetResource('STR#', rsrcid); + if (h == 0) { + CLFatalError("Resource ('STR#',%d) '%s' not found in executable\n", rsrcid, name); + return 0; + } + ReleaseResource(h); + return 1; + } else { + return Res_AddResource(name, rsrcid, list); + } +} + +int RegisterStaticPlugin(const BasePluginCallbacks *callbacks) { + return Plugins_Add(Plugin_New(callbacks, 0, 0)); +} + +int RegisterStaticCompilerLinkerPlugin(const BasePluginCallbacks *callbacks, const CompilerLinkerPluginCallbacks *cl_callbacks) { + return Plugins_Add(Plugin_New(callbacks, cl_callbacks, 0)); +} + +int RegisterStaticParserPlugin(const BasePluginCallbacks *callbacks, const ParserPluginCallbacks *pr_callbacks) { + return Plugins_Add(Plugin_New(callbacks, 0, pr_callbacks)); +} + +void SetBuildTarget(OSType cpu, OSType os) { + clState.cpu = cpu; + clState.os = os; +} + +void SetParserType(OSType plang) { + clState.parserstyle = plang; +} + +void SetPluginType(OSType lang, OSType type) { + clState.language = lang; + clState.plugintype = type; +} + +int CmdLine_Initialize(int argc, const char **argv, const char *builddate, const char *buildtime) { + strncpy(cmdline_build_date, builddate, sizeof(cmdline_build_date)); + strncpy(cmdline_build_time, buildtime, sizeof(cmdline_build_time)); + return Main_Initialize(argc, argv); +} + +int CmdLine_Driver() { + return Main_Driver(); +} + +int CmdLine_Terminate(int exitcode) { + return Main_Terminate(exitcode); +} |