2022-10-19 20:16:13 +00:00
|
|
|
#include "parser.h"
|
2022-10-14 22:15:32 +00:00
|
|
|
|
|
|
|
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 (
|
2022-10-19 20:16:13 +00:00
|
|
|
(type == CWDROPINANYTYPE || pTool->TYPE == CWDROPINANYTYPE || pTool->TYPE == type) &&
|
|
|
|
(lang == Lang_Any || pTool->LANG == Lang_Any || pTool->LANG == lang) &&
|
2022-10-14 22:15:32 +00:00
|
|
|
(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;
|
|
|
|
}
|
|
|
|
|
2023-01-11 22:29:53 +00:00
|
|
|
Boolean SetupParserToolOptions(void) {
|
2022-10-14 22:15:32 +00:00
|
|
|
int idx;
|
|
|
|
|
|
|
|
Options_Init();
|
|
|
|
for (idx = 0; idx < pTool->numOptionLists; idx++) {
|
|
|
|
Options_AddList(pTool->optionLists[idx]);
|
|
|
|
}
|
|
|
|
Options_SortOptions();
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|