summaryrefslogtreecommitdiff
path: root/unsorted/Targets.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-14 23:15:32 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-14 23:15:32 +0100
commit775b6861666af36d317fb577cf489e2c6377f878 (patch)
tree2ae8c829eb861c85a6e2b5acf42f51919a0d78f2 /unsorted/Targets.c
parentb8df05413a4e8b299de07b915cddce73a3bb16e3 (diff)
downloadMWCC-775b6861666af36d317fb577cf489e2c6377f878.tar.gz
MWCC-775b6861666af36d317fb577cf489e2c6377f878.zip
add tons of stuff
Diffstat (limited to '')
-rw-r--r--unsorted/Targets.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/unsorted/Targets.c b/unsorted/Targets.c
new file mode 100644
index 0000000..b4307ff
--- /dev/null
+++ b/unsorted/Targets.c
@@ -0,0 +1,66 @@
+#include "mwcc_decomp.h"
+
+ParserTool *pTool;
+
+int SetParserToolInfo(ParserTool *tool) {
+ pTool = tool;
+
+#line 16
+ OPTION_ASSERT(pTool->toolInfo && (parseopts.toolVersion || pTool->copyright));
+
+ return 1;
+}
+
+Boolean ParserToolMatchesPlugin(OSType type, OSType lang, OSType cpu, OSType os) {
+ if (!pTool) {
+ CLPFatalError("No options loaded for command line\n");
+ return 0;
+ }
+
+ if (
+ (type == CWFOURCHAR('*','*','*','*') || pTool->TYPE == CWFOURCHAR('*','*','*','*') || pTool->TYPE == type) &&
+ (lang == CWFOURCHAR('*','*','*','*') || pTool->LANG == CWFOURCHAR('*','*','*','*') || pTool->LANG == lang) &&
+ (cpu == targetCPUAny || pTool->CPU == targetCPUAny || pTool->CPU == cpu) &&
+ (os == targetOSAny || pTool->OS == targetOSAny || pTool->OS == os)
+ )
+ {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+Boolean ParserToolHandlesPanels(int numPanels, const char **panelNames) {
+ int idx;
+ int scan;
+
+ if (!pTool)
+ CLPFatalError("No options loaded for command line\n");
+
+ for (idx = 0; idx < numPanels; idx++) {
+ for (scan = 0; scan < pTool->numPrefPanels; scan++) {
+ if (!ustrcmp(pTool->prefPanels[scan], panelNames[idx]))
+ break;
+ }
+
+ if (scan >= pTool->numPrefPanels)
+ break;
+ }
+
+ if (idx >= numPanels)
+ return 1;
+ else
+ return 0;
+}
+
+Boolean SetupParserToolOptions() {
+ int idx;
+
+ Options_Init();
+ for (idx = 0; idx < pTool->numOptionLists; idx++) {
+ Options_AddList(pTool->optionLists[idx]);
+ }
+ Options_SortOptions();
+
+ return 1;
+}