2022-10-11 02:18:42 +00:00
|
|
|
#include "mwcc_decomp.h"
|
|
|
|
|
2022-10-13 16:56:43 +00:00
|
|
|
int RegisterResource(const char *name, SInt16 rsrcid, const char **list) {
|
2022-10-11 02:18:42 +00:00
|
|
|
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);
|
|
|
|
}
|