diff --git a/command_line/C++_Parser/Src/Library/IO.c b/command_line/C++_Parser/Src/Library/IO.c index 36d809b..0ce74df 100644 --- a/command_line/C++_Parser/Src/Library/IO.c +++ b/command_line/C++_Parser/Src/Library/IO.c @@ -7,7 +7,7 @@ void ShowTextHandle(const char *description, Handle text) { return; if (description) - CLPStatus(71, description); + CLPStatus(CLPStr71, description); CWSecretAttachHandle(parseopts.context, text, &mh); CWParserDisplayTextHandle(parseopts.context, description, mh); } diff --git a/command_line/C++_Parser/Src/Library/Parameter.c b/command_line/C++_Parser/Src/Library/Parameter.c index 31669e1..4b640b3 100644 --- a/command_line/C++_Parser/Src/Library/Parameter.c +++ b/command_line/C++_Parser/Src/Library/Parameter.c @@ -162,7 +162,7 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { val = 0; opstr = pstr; if (!pstr[0]) { - Param_Error(5, "", pstr); + Param_Error(CLPStr5, "", pstr); return 0; } @@ -175,12 +175,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { while (*pstr) { if (!my_isxdigit(*pstr)) { - Param_Error(5, "hexadecimal ", opstr); + Param_Error(CLPStr5, "hexadecimal ", opstr); return 0; } if (val > 0xFFFFFFF) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -192,12 +192,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { while (*pstr) { if (*pstr < '0' || *pstr >= '8') { - Param_Error(5, "octal ", opstr); + Param_Error(CLPStr5, "octal ", opstr); return 0; } if (val > 0x1FFFFFFF) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -207,12 +207,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { } else { while (*pstr) { if (!my_isdigit(*pstr)) { - Param_Error(5, "decimal ", opstr); + Param_Error(CLPStr5, "decimal ", opstr); return 0; } if (val > 0x19999999) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -238,15 +238,15 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { } if (!p->fit && (val < lo || val > hi)) { - Param_Error(6, val, lo, hi); + Param_Error(CLPStr6, val, lo, hi); return 0; } if (val < lo) { - Param_Warning(7, val, lo, hi, lo); + Param_Warning(CLPStr7, val, lo, hi, lo); val = lo; } else if (val > hi) { - Param_Warning(7, val, lo, hi, hi); + Param_Warning(CLPStr7, val, lo, hi, hi); val = hi; } @@ -309,7 +309,7 @@ static int Param_FTypeCreator(FTYPE_T *p, const char *pstr, int flags) { } if (*pstr) { - Param_Error(8, opstr); + Param_Error(CLPStr8, opstr); return 0; } @@ -352,7 +352,7 @@ static int Param_String(STRING_T *p, const char *pstr, int flags) { c2pstr(p->str); if (len > p->maxlen) { - Param_Error(9, pstr, pstr + len - 5, p->maxlen - 1); + Param_Error(CLPStr9, pstr, pstr + len - 5, p->maxlen - 1); return 0; } @@ -399,10 +399,10 @@ static int Param_ID_or_SYM(STRING_T *p, const char *pstr, int flags) { for (ptr = pstr; *ptr; ++ptr) { if (ptr == pstr && my_isdigit(*ptr)) - Param_Warning(10, pstr); + Param_Warning(CLPStr10, pstr); if (!my_isalnum(*ptr) && !strchr(x, *ptr)) - Param_Warning(11, pstr, *ptr); + Param_Warning(CLPStr11, pstr, *ptr); } return 1; @@ -444,7 +444,7 @@ static int Param_OnOff(ONOFF_T *p, const char *pstr, int flags) { } else if (!ustrcmp(pstr, "off")) { *(p->var) = mytrue == 0; } else { - Param_Error(12, pstr); + Param_Error(CLPStr12, pstr); return 0; } @@ -484,7 +484,7 @@ static int Param_OffOn(OFFON_T *p, const char *pstr, int flags) { } else if (!ustrcmp(pstr, "on")) { *(p->var) = mytrue == 0; } else { - Param_Error(12, pstr); + Param_Error(CLPStr12, pstr); return 0; } @@ -518,7 +518,7 @@ static int Param_FilePath(FILEPATH_T *p, const char *pstr, int flags) { err = OS_MakeFileSpec(pstr, &spec); if (err) { - Param_Error(18, pstr, OS_GetErrText(err)); + Param_Error(CLPStr18, pstr, OS_GetErrText(err)); return 0; } @@ -528,7 +528,7 @@ static int Param_FilePath(FILEPATH_T *p, const char *pstr, int flags) { } else { clen = strlen(canon); if (clen > p->maxlen) { - Param_Error(13, canon + clen - 32, canon); + Param_Error(CLPStr13, canon + clen - 32, canon); return 0; } strcpy(p->filename, canon); @@ -744,7 +744,7 @@ static int Param_Setting(SETTING_T *p, const char *pstr, int flags) { Boolean equals = 0; if (!pstr) { - Param_Error(40); + Param_Error(CLPStr40); return 0; } @@ -988,7 +988,7 @@ static Boolean Param_IsNonTextFile(const char *fname, Boolean warn) { if (!OS_GetMacFileType(&tmp, &mactype)) { if (mactype != 'TEXT') { if (warn) - Param_Warning(77, fname); + Param_Warning(CLPStr77, fname); return 1; } } @@ -1018,11 +1018,11 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) { if (tok->val == nextParam || tok->val == ATK_EQUALS) tok = Arg_UsedToken(); if (tok->val == nextOpt || tok->val == nextParam || tok->val == lastOpt) { - Param_Error(34); + Param_Error(CLPStr34_ArgumentsExpected); return 0; } if (tok->val != ATK_ARG) { - Param_Error(57, "parameter", Arg_GetTokenName(tok)); + Param_Error(CLPStr57, "parameter", Arg_GetTokenName(tok)); return 0; } Arg_GetTokenText(tok, curparam, sizeof(curparam), 1); @@ -1038,7 +1038,7 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) { *cparam = 0; if (tok->val == ATK_EQUALS && !subparse) { if (!(exec & PARAMPARSEFLAGS_40)) { - Param_Error(37); + Param_Error(CLPStr37); return 0; } Arg_UsedToken(); diff --git a/command_line/C++_Parser/Src/Library/Projects.c b/command_line/C++_Parser/Src/Library/Projects.c index dca9df2..b310398 100644 --- a/command_line/C++_Parser/Src/Library/Projects.c +++ b/command_line/C++_Parser/Src/Library/Projects.c @@ -27,7 +27,7 @@ int AddFileToProject(OSSpec *oss, SInt16 which, char *outfilename, Boolean exist err = OS_OSSpec_To_FSSpec(oss, &cws); if (err) { - CLPOSAlert(44, err, OS_SpecToStringRelative(oss, 0, STSbuf, sizeof(STSbuf))); + CLPOSAlert(CLPStr44, err, OS_SpecToStringRelative(oss, 0, STSbuf, sizeof(STSbuf))); return 0; } @@ -79,7 +79,7 @@ int AddAccessPath(OSPathSpec *oss, SInt16 type, SInt32 position, Boolean recursi CWAccessPathListInfo apli; if ((err = OS_MakeSpecWithPath(oss, NULL, 0, &spec)) || (err = OS_OSSpec_To_FSSpec(&spec, &api.pathSpec))) { - CLPOSAlert(45, err, OS_PathSpecToString(&spec.path, STSbuf, sizeof(STSbuf))); + CLPOSAlert(CLPStr45, err, OS_PathSpecToString(&spec.path, STSbuf, sizeof(STSbuf))); return 0; } @@ -173,7 +173,7 @@ void AddOverlayGroup(const char *name, CWAddr64 *addr, SInt32 *groupnum, SInt32 result = CWParserAddOverlay1Group(parseopts.context, name, addr, groupnum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(72); + CLPReportError(CLPStr72); } else { failedCallback = "CWParserAddOverlay1Group"; longjmp(exit_plugin, result); @@ -187,7 +187,7 @@ void AddOverlay(SInt32 groupnum, const char *name, SInt32 *overlaynum) { result = CWParserAddOverlay1(parseopts.context, name, groupnum, overlaynum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(72); + CLPReportError(CLPStr72); } else { failedCallback = "CWParserAddOverlay1"; longjmp(exit_plugin, result); @@ -201,7 +201,7 @@ void AddSegment(const char *name, SInt16 attrs, SInt32 *segmentnum) { result = CWParserAddSegment(parseopts.context, name, attrs, segmentnum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } else { failedCallback = "CWParserAddSegment"; longjmp(exit_plugin, result); @@ -215,7 +215,7 @@ void ChangeSegment(SInt32 segmentnum, const char *name, SInt16 attrs) { result = CWParserSetSegment(parseopts.context, segmentnum, name, attrs); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } else { failedCallback = "CWParserSetSegment"; longjmp(exit_plugin, result); @@ -230,7 +230,7 @@ int GetSegment(SInt32 segmentnum, char *name, SInt16 *attrs) { result = CWGetSegmentInfo(parseopts.context, segmentnum, &psi); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } return 0; } diff --git a/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c b/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c index b58f188..6c19b5b 100644 --- a/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c +++ b/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c @@ -21,9 +21,9 @@ void FinishCompilerTool(void) { strcpy(pCmdLineCompiler.outMakefile, parseopts.lastoutputname); } else if (outputOrdering == OutputOrdering2) { if (parseopts.possibleFiles > 0 || parseopts.userSpecifiedFiles > 0) - CLPReportError(41, parseopts.lastoutputname); + CLPReportError(CLPStr41, parseopts.lastoutputname); else - CLPReportError(42, parseopts.lastoutputname); + CLPReportError(CLPStr42, parseopts.lastoutputname); } else { SetFileOutputName(numfiles - 1, lastStage, parseopts.lastoutputname); } diff --git a/command_line/CmdLine/Project/Resources/CLErrors.r b/command_line/CmdLine/Project/Resources/CLErrors.r index 5d457b1..5303d06 100644 --- a/command_line/CmdLine/Project/Resources/CLErrors.r +++ b/command_line/CmdLine/Project/Resources/CLErrors.r @@ -1,4 +1,4 @@ -static const char *STR12000[112] = { +static const char *STR12000[108] = { "Could not get current working directory", "Cannot find my executable '%s'", "Could not initialize plugin '%s'", diff --git a/command_line/CmdLine/Src/CLDependencies.c b/command_line/CmdLine/Src/CLDependencies.c index 724141a..2292dfb 100644 --- a/command_line/CmdLine/Src/CLDependencies.c +++ b/command_line/CmdLine/Src/CLDependencies.c @@ -267,7 +267,7 @@ int Deps_ChangeSpecialAccessPath(OSSpec *srcfss, Boolean initialize) { specialAccessPath = FindOrAddGlobalInclPath(gTarg->incls.allPaths, pathspecptr); if (optsCmdLine.verbose > 2) - CLReport(105, OS_PathSpecToString(pathspecptr, STSbuf, sizeof(STSbuf))); + CLReport(CLStr105, OS_PathSpecToString(pathspecptr, STSbuf, sizeof(STSbuf))); return 1; } diff --git a/command_line/CmdLine/Src/CLFileOps.c b/command_line/CmdLine/Src/CLFileOps.c index a5976be..a79522a 100644 --- a/command_line/CmdLine/Src/CLFileOps.c +++ b/command_line/CmdLine/Src/CLFileOps.c @@ -13,7 +13,7 @@ static int OutputTextData(File *file, SInt16 stage, OSType maccreator, OSType ma ret = ShowHandle(file->textdata, size, 0); } else { if (optsCmdLine.verbose) - CLReport(15, OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf))); + CLReport(CLStr15, OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf))); ret = WriteHandleToFile(&file->outfss, file->textdata, size, maccreator, mactype); file->wroteToDisk |= stage; } @@ -145,7 +145,7 @@ int GetOutputFile(File *file, SInt16 stage) { if (!err) { if (OS_EqualSpec(&file->srcfss, &file->outfss)) { if (specifiedName) { - CLReportError(102, targetoutfilename); + CLReportError(CLStr102, targetoutfilename); file->writeToDisk &= ~stage; file->tempOnDisk &= ~stage; return 0; @@ -170,7 +170,7 @@ static int PreprocessFile(File *file) { const CWObjectFlags *cof; if (!(file->dropinflags & kCanpreprocess)) { - CLReportWarning(53, Plugin_GetDropInName(file->compiler), file->srcfilename); + CLReportWarning(CLStr53, Plugin_GetDropInName(file->compiler), file->srcfilename); return 1; } @@ -188,7 +188,7 @@ static int PreprocessFile(File *file) { optsCompiler.ppFileType ? optsCompiler.ppFileType : cof->ppFileType); } - CLReportError(96, "preprocessing", file->srcfilename); + CLReportError(CLStr96, "preprocessing", file->srcfilename); return 0; } @@ -228,7 +228,7 @@ static int RecordBrowseInfo(File *file) { return 1; if (!file->browsedata) { - CLReportError(101, Plugin_GetDropInName(file->compiler), OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf))); + CLReportError(CLStr101, Plugin_GetDropInName(file->compiler), OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf))); return 0; } @@ -278,7 +278,7 @@ static int CompileFile(File *file) { int ret = 1; if (!(file->dropinflags & kCanprecompile) && ((optsCompiler.forcePrecompile == 1) || (file->mappingflags & kPrecompile))) { - CLReportWarning(54, Plugin_GetDropInName(file->compiler), file->srcfilename); + CLReportWarning(CLStr54, Plugin_GetDropInName(file->compiler), file->srcfilename); return 1; } @@ -294,7 +294,7 @@ static int CompileFile(File *file) { file->recordbrowseinfo = ret < 0; file->browseFileID = id; if (optsCmdLine.verbose > 1) - CLReport(22, file->srcfilename, file->browseFileID); + CLReport(CLStr22, file->srcfilename, file->browseFileID); } else { memset(file->browseoptions, 0, sizeof(file->browseoptions)); file->recordbrowseinfo = 0; @@ -306,7 +306,7 @@ static int CompileFile(File *file) { ret = 0; } else { if ((!file->hasobjectcode || !file->objectdata) && (file->dropinflags & kGeneratescode) && (file->objectUsage & 2)) { - CLReportError(96, "compiling", file->srcfilename); + CLReportError(CLStr96, "compiling", file->srcfilename); ret = 0; } else if (optsCmdLine.state == OptsCmdLineState_2 && !StoreObjectFile(file)) { ret = 0; @@ -334,7 +334,7 @@ static int DisassembleFile(File *file) { Plugin *disasm; if (!file->hasobjectcode && !file->hasresources) { - CLReportError(56, file->srcfilename); + CLReportError(CLStr56, file->srcfilename); return 0; } @@ -352,7 +352,7 @@ static int DisassembleFile(File *file) { optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator, optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType); } - CLReportError(96, "disassembling", file->srcfilename); + CLReportError(CLStr96, "disassembling", file->srcfilename); return 0; } else { @@ -370,7 +370,7 @@ static int DisassembleFile(File *file) { optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator, optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType); } - CLReportError(96, "disassembling", file->srcfilename); + CLReportError(CLStr96, "disassembling", file->srcfilename); } return 0; } @@ -383,15 +383,15 @@ static int DisassembleFile(File *file) { optsCompiler.disFileCreator ? optsCompiler.disFileCreator : cof->disFileCreator, optsCompiler.disFileType ? optsCompiler.disFileType : cof->disFileType); } - CLReportError(96, "disassembling", file->srcfilename); + CLReportError(CLStr96, "disassembling", file->srcfilename); } return 0; } if (gTarg->linker) - CLReportError(58, Plugin_GetDropInName(gTarg->linker), Plugin_GetDropInName(file->compiler), file->srcfilename); + CLReportError(CLStr58, Plugin_GetDropInName(gTarg->linker), Plugin_GetDropInName(file->compiler), file->srcfilename); else - CLReportError(57, Plugin_GetDropInName(file->compiler), file->srcfilename); + CLReportError(CLStr57, Plugin_GetDropInName(file->compiler), file->srcfilename); return 0; } @@ -437,10 +437,10 @@ static int CompileEntry(File *file, Boolean *compiled) { const char *cun; const char *dun; const char *uun; - CLReport(25, file->compiledlines); + CLReport(CLStr25, file->compiledlines); tinfo->linesCompiled += file->compiledlines; cun = dun = uun = "bytes"; - CLReport(26, file->codesize, cun, file->idatasize, dun, file->udatasize, uun); + CLReport(CLStr26, file->codesize, cun, file->idatasize, dun, file->udatasize, uun); } tinfo->codeSize += file->codesize; tinfo->iDataSize += file->idatasize; @@ -451,9 +451,9 @@ static int CompileEntry(File *file, Boolean *compiled) { if (optsCmdLine.timeWorking) { if (optsCmdLine.verbose) - CLReport(24, (endWork - beginWork) / 1000.0, "compile", "", "", ""); + CLReport(CLStr24, (endWork - beginWork) / 1000.0, "compile", "", "", ""); else - CLReport(24, (endWork - beginWork) / 1000.0, "compile", "'", file->srcfilename, "'"); + CLReport(CLStr24, (endWork - beginWork) / 1000.0, "compile", "'", file->srcfilename, "'"); } return 1; @@ -463,16 +463,16 @@ static void DumpFileAndPathInfo(void) { int i; int n; - CLReport(84, "Framework search paths ([d] = default, [r] = recursive)"); + CLReport(CLStr84, "Framework search paths ([d] = default, [r] = recursive)"); n = Paths_Count(&FrameworkPaths); if (!n) { - CLReport(85, "(none)", ""); + CLReport(CLStr85, "(none)", ""); } else { for (i = 0; i < n; i++) { Path *path = Paths_GetPath(&FrameworkPaths, i); OS_ASSERT(961, path != NULL); - CLReport(85, + CLReport(CLStr85, OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), ((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : "" ); @@ -482,7 +482,7 @@ static void DumpFileAndPathInfo(void) { for (j = 0; j < Paths_Count(path->recursive); j++) { Path *sub = Paths_GetPath(path->recursive, j); OS_ASSERT(976, sub); - CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); + CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); } } } @@ -490,7 +490,7 @@ static void DumpFileAndPathInfo(void) { n = Frameworks_GetCount(); if (Frameworks_GetCount()) { - CLReport(84, "Included frameworks"); + CLReport(CLStr84, "Included frameworks"); for (i = 0; i < n; i++) { char version[80]; Paths_FWInfo *info = Frameworks_GetInfo(i); @@ -504,23 +504,23 @@ static void DumpFileAndPathInfo(void) { strncat(version, info->version.s, sizeof(version) - 4); strcat(version, ")"); } - CLReport(85, info->name.s, version); + CLReport(CLStr85, info->name.s, version); } } if (clState.plugintype == CWDROPINCOMPILERTYPE) - CLReport(84, "User include search paths ([d] = default, [r] = recursive)"); + CLReport(CLStr84, "User include search paths ([d] = default, [r] = recursive)"); else - CLReport(84, "Library search paths ([d] = default, [r] = recursive)"); + CLReport(CLStr84, "Library search paths ([d] = default, [r] = recursive)"); if (!Paths_Count(&gTarg->userPaths) && clState.plugintype == CWDROPINCOMPILERTYPE) { - CLReport(85, "(none)", ""); + CLReport(CLStr85, "(none)", ""); } else { for (i = 0; i < Paths_Count(&gTarg->userPaths); i++) { Path *path = Paths_GetPath(&gTarg->userPaths, i); OS_ASSERT(1024, path != NULL); - CLReport(85, + CLReport(CLStr85, OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), ((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : "" ); @@ -530,23 +530,23 @@ static void DumpFileAndPathInfo(void) { for (j = 0; j < Paths_Count(path->recursive); j++) { Path *sub = Paths_GetPath(path->recursive, j); OS_ASSERT(1039, sub); - CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); + CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); } } } } if (clState.plugintype == CWDROPINCOMPILERTYPE) - CLReport(84, "System include search paths ([d] = default, [r] = recursive)"); + CLReport(CLStr84, "System include search paths ([d] = default, [r] = recursive)"); if (!Paths_Count(&gTarg->sysPaths)) - CLReport(85, "(none)", ""); + CLReport(CLStr85, "(none)", ""); for (i = 0; i < Paths_Count(&gTarg->sysPaths); i++) { Path *path = Paths_GetPath(&gTarg->sysPaths, i); OS_ASSERT(1054, path != NULL); - CLReport(85, + CLReport(CLStr85, OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), ((path->flags & 2) && path->recursive) ? " [d] [r]" : (path->flags & 2) ? " [d]" : path->recursive ? " [r]" : "" ); @@ -556,22 +556,22 @@ static void DumpFileAndPathInfo(void) { for (j = 0; j < Paths_Count(path->recursive); j++) { Path *sub = Paths_GetPath(path->recursive, j); OS_ASSERT(1069, sub); - CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); + CLReport(CLStr85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); } } } if (clState.plugintype == CWDROPINCOMPILERTYPE) - CLReport(84, "Files in project (relative to CWD)"); + CLReport(CLStr84, "Files in project (relative to CWD)"); else - CLReport(84, "Link order for project (relative to CWD)"); + CLReport(CLStr84, "Link order for project (relative to CWD)"); for (i = 0; i < Files_Count(&gTarg->files); i++) { File *file = Files_GetFile(&gTarg->files, i); if (!VFiles_Find(gTarg->virtualFiles, file->srcfilename)) - CLReport(85, OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)), ""); + CLReport(CLStr85, OS_SpecToStringRelative(&file->srcfss, NULL, STSbuf, sizeof(STSbuf)), ""); else - CLReport(85, file->srcfilename, "\t(virtual file)"); + CLReport(CLStr85, file->srcfilename, "\t(virtual file)"); } } @@ -655,16 +655,16 @@ int CompileFilesInProject(void) { const char *dun; const char *uun; cun = dun = uun = "bytes"; - CLReport(27, tinfo->codeSize, cun, tinfo->iDataSize, dun, tinfo->uDataSize, uun); + CLReport(CLStr27, tinfo->codeSize, cun, tinfo->iDataSize, dun, tinfo->uDataSize, uun); } endTime = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (endTime - startTime) / 1000.0, "compile", "", "", "project"); + CLReport(CLStr24, (endTime - startTime) / 1000.0, "compile", "", "", "project"); if (ignored > 0 && compiled == 0 && (gTarg->preLinker || gTarg->linker)) - CLReportError(29); + CLReportError(CLStr29); if (failed) return Result_Failed; @@ -696,7 +696,7 @@ static int PostLinkFilesInProject(void) { endTime = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (endTime - startTime) / 1000.0, "compile", "", "", "project"); + CLReport(CLStr24, (endTime - startTime) / 1000.0, "compile", "", "", "project"); return CheckForUserBreak() ? Result_Cancelled : Result_Success; } @@ -726,7 +726,7 @@ int LinkProject(void) { subEnd = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (subEnd - subStart) / 1000.0, "prelink project", "", "", ""); + CLReport(CLStr24, (subEnd - subStart) / 1000.0, "prelink project", "", "", ""); } if (gTarg->linker && optsLinker.callLinker && optsCmdLine.state == OptsCmdLineState_3) { @@ -744,7 +744,7 @@ int LinkProject(void) { subEnd = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (subEnd - subStart) / 1000.0, "link project", "", "", ""); + CLReport(CLStr24, (subEnd - subStart) / 1000.0, "link project", "", "", ""); } if (gTarg->postLinker && optsLinker.callPostLinker && optsCmdLine.state == OptsCmdLineState_3) { @@ -772,12 +772,12 @@ int LinkProject(void) { subEnd = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (subEnd - subStart) / 1000.0, "postlink project", "", "", ""); + CLReport(CLStr24, (subEnd - subStart) / 1000.0, "postlink project", "", "", ""); if (!optsLinker.keepLinkerOutput && gTarg->targetinfo->outputType == linkOutputFile) { if (optsCmdLine.verbose > 1) { OS_FSSpec_To_OSSpec(&fss, &outfile); - CLReport(19, OS_SpecToString(&outfile, STSbuf, sizeof(STSbuf))); + CLReport(CLStr19, OS_SpecToString(&outfile, STSbuf, sizeof(STSbuf))); } FSpDelete(&fss); } @@ -789,7 +789,7 @@ int LinkProject(void) { endTime = OS_GetMilliseconds(); if (optsCmdLine.timeWorking) - CLReport(24, (endTime - startTime) / 1000.0, "finish link stage", "", "", ""); + CLReport(CLStr24, (endTime - startTime) / 1000.0, "finish link stage", "", "", ""); return Result_Success; } diff --git a/command_line/CmdLine/Src/CLMain.c b/command_line/CmdLine/Src/CLMain.c index ae678fa..ef55b55 100644 --- a/command_line/CmdLine/Src/CLMain.c +++ b/command_line/CmdLine/Src/CLMain.c @@ -253,7 +253,7 @@ int Main_Initialize(int argc, char **argv) { } if (OS_FindProgram(exename, &clState.programSpec)) - CLReportError(2, exename); + CLReportError(CLStr2, exename); Plugins_Init(); if (!RegisterStaticCmdLinePlugin()) @@ -387,7 +387,7 @@ static int Main_ResolveProject(void) { endTime = LMGetTicks(); if (optsCmdLine.timeWorking) { - CLReport(24, (endTime - startTime) / 60.0, "resolve", "", "project", ""); + CLReport(CLStr24, (endTime - startTime) / 60.0, "resolve", "", "project", ""); } return 0; @@ -399,7 +399,7 @@ static int UpdatePCmdLineFromVersion(PCmdLine *given, PCmdLine *target) { *target = *given; if (clState.pluginDebug && version < 0x1002 && !warned) { - CLReportWarning(104, "CmdLine Panel"); + CLReportWarning(CLStr104, "CmdLine Panel"); warned = 1; } @@ -414,7 +414,7 @@ static int UpdatePCmdLineFromVersion(PCmdLine *given, PCmdLine *target) { } if (version < 0x1000 || version > 0x1002) { - CLReportError(104, "CmdLine Panel"); + CLReportError(CLStr104, "CmdLine Panel"); return 0; } else { target->version = 0x1002; @@ -427,7 +427,7 @@ static int UpdatePCmdLineEnvirFromVersion(PCmdLineEnvir *given, PCmdLineEnvir *t *target = *given; if ((clState.pluginDebug && version < 0x1000) || version > 0x1000) { - CLReportError(104, "CmdLine Environment"); + CLReportError(CLStr104, "CmdLine Environment"); return 0; } else { target->version = 0x1000; @@ -441,7 +441,7 @@ static int UpdatePCmdLineCompilerFromVersion(PCmdLineCompiler *given, PCmdLineCo *target = *given; if (clState.pluginDebug && version < 0x1005 && !warned) { - CLReportWarning(104, "CmdLine Compiler Panel"); + CLReportWarning(CLStr104, "CmdLine Compiler Panel"); warned = 1; } @@ -468,7 +468,7 @@ static int UpdatePCmdLineCompilerFromVersion(PCmdLineCompiler *given, PCmdLineCo } if (version <= 0x1000 || version > 0x1005) { - CLReportError(104, "CmdLine Compiler Panel"); + CLReportError(CLStr104, "CmdLine Compiler Panel"); return 0; } else { target->version = 0x1005; @@ -482,7 +482,7 @@ static int UpdatePCmdLineLinkerFromVersion(PCmdLineLinker *given, PCmdLineLinker *target = *given; if (clState.pluginDebug && version < 0x1002 && !warned) { - CLReportWarning(104, "CmdLine Linker Panel"); + CLReportWarning(CLStr104, "CmdLine Linker Panel"); warned = 1; } @@ -499,7 +499,7 @@ static int UpdatePCmdLineLinkerFromVersion(PCmdLineLinker *given, PCmdLineLinker } if (version < 0x1000 || version > 0x1002) { - CLReportError(104, "CmdLine Linker Panel"); + CLReportError(CLStr104, "CmdLine Linker Panel"); return 0; } else { target->version = 0x1002; @@ -518,7 +518,7 @@ static int UpdatePrefPanels(const char *name) { return 0; } } else { - CLReportError(91, "CmdLine Panel"); + CLReportError(CLStr91, "CmdLine Panel"); return 0; } } @@ -530,7 +530,7 @@ static int UpdatePrefPanels(const char *name) { return 0; } } else { - CLReportError(91, "CmdLine Environment"); + CLReportError(CLStr91, "CmdLine Environment"); return 0; } } @@ -542,7 +542,7 @@ static int UpdatePrefPanels(const char *name) { return 0; } } else { - CLReportError(91, "CmdLine Compiler Panel"); + CLReportError(CLStr91, "CmdLine Compiler Panel"); return 0; } } @@ -554,7 +554,7 @@ static int UpdatePrefPanels(const char *name) { return 0; } } else { - CLReportError(91, "CmdLine Linker Panel"); + CLReportError(CLStr91, "CmdLine Linker Panel"); return 0; } } diff --git a/command_line/CmdLine/Src/CLPrefs.c b/command_line/CmdLine/Src/CLPrefs.c index b825c4a..05ca045 100644 --- a/command_line/CmdLine/Src/CLPrefs.c +++ b/command_line/CmdLine/Src/CLPrefs.c @@ -98,7 +98,7 @@ Boolean Prefs_AddPanel(PrefPanel *panel) { for (scan = &panellist; *scan; scan = &(*scan)->next) { if (!strcmp((*scan)->name, panel->name)) { - CLReportError(90, panel->name); + CLReportError(CLStr90, panel->name); return 0; } } diff --git a/command_line/CmdLine/Src/CLToolExec.c b/command_line/CmdLine/Src/CLToolExec.c index cbd1a91..c268a55 100644 --- a/command_line/CmdLine/Src/CLToolExec.c +++ b/command_line/CmdLine/Src/CLToolExec.c @@ -125,7 +125,7 @@ int DeleteTemporaries(void) { if ((file->objectUsage & CmdLineStageMask_Cg) && (file->tempOnDisk & CmdLineStageMask_Cg) && (file->wroteToDisk & CmdLineStageMask_Cg)) { GetOutputFile(file, CmdLineStageMask_Cg); if (optsCmdLine.verbose > 1) - CLReport(19, OS_SpecToString(&file->outfss, STSbuf, sizeof(STSbuf))); + CLReport(CLStr19, OS_SpecToString(&file->outfss, STSbuf, sizeof(STSbuf))); OS_Delete(&file->outfss); file->tempOnDisk &= ~CmdLineStageMask_Cg; file->wroteToDisk &= ~CmdLineStageMask_Cg; @@ -190,13 +190,13 @@ int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *stdoutfi if (!OS_FindProgram(cname, &linkerspec)) { ptr = cname; if (optsCompiler.linkerName[0]) { - CLReportWarning(66, linkertype, optsCompiler.linkerName); - CLReport(65, ptr, clState.programName); + CLReportWarning(CLStr66, linkertype, optsCompiler.linkerName); + CLReport(CLStr65, ptr, clState.programName); } else if (optsCmdLine.verbose) { - CLReport(65, ptr, clState.programName); + CLReport(CLStr65, ptr, clState.programName); } } else { - CLReportError(66, linkertype, linkername); + CLReportError(CLStr66, linkertype, linkername); return 0; } } @@ -221,15 +221,15 @@ int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *stdoutfi fflush(stderr); if (optsCmdLine.verbose) - CLReport(67, linkertype, OS_SpecToString(&linkerspec, STSbuf, sizeof(STSbuf))); + CLReport(CLStr67, linkertype, OS_SpecToString(&linkerspec, STSbuf, sizeof(STSbuf))); if (!optsCmdLine.dryRun) { execerr = OS_Execute(&linkerspec, args.argv, args.envp, stdoutfile, stderrfile, &exitcode); if (execerr) { - CLReportError(68, linkertype, args.argv[0], OS_GetErrText(execerr)); + CLReportError(CLStr68, linkertype, args.argv[0], OS_GetErrText(execerr)); ret = 0; } else if (exitcode) { - CLReportError(69 /*nice*/, linkertype, args.argv[0], exitcode); + CLReportError(CLStr69, linkertype, args.argv[0], exitcode); ret = 0; } } diff --git a/command_line/CmdLine/Src/CLWriteObjectFile.c b/command_line/CmdLine/Src/CLWriteObjectFile.c index 22028dc..7f2cc05 100644 --- a/command_line/CmdLine/Src/CLWriteObjectFile.c +++ b/command_line/CmdLine/Src/CLWriteObjectFile.c @@ -12,7 +12,7 @@ int WriteObjectFile(File *file, OSType maccreator, OSType mactype) { OS_OSSpec_To_FSSpec(&file->srcfss, &srcfss); if (optsCmdLine.verbose) { - CLReport(16, + CLReport(CLStr16, (file->tempOnDisk & CmdLineStageMask_Cg) ? "temporary " : "", OS_SpecToStringRelative(&file->outfss, NULL, STSbuf, sizeof(STSbuf))); } @@ -33,7 +33,7 @@ int WriteBrowseData(File *file, OSType maccreator, OSType mactype) { OS_NameSpecSetExtension(&outfss.name, optsCompiler.brsFileExt[0] ? optsCompiler.brsFileExt : cof->brsFileExt); if (optsCmdLine.verbose) { - CLReport(17, OS_SpecToStringRelative(&outfss, NULL, STSbuf, sizeof(STSbuf))); + CLReport(CLStr17, OS_SpecToStringRelative(&outfss, NULL, STSbuf, sizeof(STSbuf))); } if (!Browser_PackBrowseFile(file->browsedata, &clState.browseTableHandle, &browsehandle)) diff --git a/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp b/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp index 24eaf83..f231060 100644 --- a/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp +++ b/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp @@ -623,11 +623,11 @@ CWResult UCBGetNamedPreferences(CWPluginContext context, const char *prefsname, PrefPanel *pnl = Prefs_FindPanel(prefsname); if (pnl) { if (optsCmdLine.verbose > 2) - CLReport(83, prefsname); + CLReport(CLStr83, prefsname); UCBSecretAttachHandle(context, PrefPanel_GetHandle(pnl), prefsdata); return cwNoErr; } else { - CLReportError(91, prefsname); + CLReportError(CLStr91, prefsname); *prefsdata = NULL; return cwErrRequestFailed; } diff --git a/command_line/CmdLine/Src/Envir/CLErrors.c b/command_line/CmdLine/Src/Envir/CLErrors.c index 591e30d..06d5b29 100644 --- a/command_line/CmdLine/Src/Envir/CLErrors.c +++ b/command_line/CmdLine/Src/Envir/CLErrors.c @@ -59,7 +59,7 @@ void CLReportOSError(SInt16 errid, int err, ...) { va_end(va); oserr = OS_GetErrText(err); - CLReportError(99, txt, oserr, err); + CLReportError(CLStr99, txt, oserr, err); if (txt != mybuf) free(txt); @@ -77,7 +77,7 @@ void CLReportCError(SInt16 errid, int err_no, ...) { va_end(va); serr = strerror(err_no); - CLReportError(100, txt, serr, err_no); + CLReportError(CLStr100, txt, serr, err_no); if (txt != mybuf) free(txt); diff --git a/command_line/CmdLine/Src/Envir/CLIO.c b/command_line/CmdLine/Src/Envir/CLIO.c index 1d6eaad..7be38a0 100644 --- a/command_line/CmdLine/Src/Envir/CLIO.c +++ b/command_line/CmdLine/Src/Envir/CLIO.c @@ -240,7 +240,7 @@ void TermWorking(void) { static void ProgressFunction(const char *functionname) { if (optsCmdLine.verbose) - CLReport(7, functionname); + CLReport(CLStr7, functionname); } Boolean CheckForUserBreak(void) { @@ -881,10 +881,10 @@ SInt16 CLStyledMessageDispatch(Plugin *plugin, MessageRef *ref, SInt32 errorNumb if (++clState.countErrors >= optsCmdLine.maxErrors) { clState.withholdErrors = 1; if (!optsCompiler.noFail) { - CLReport(70); + CLReport(CLStr70); clState.userBreak = 1; } else { - CLReport(71); + CLReport(CLStr71); } } } @@ -892,7 +892,7 @@ SInt16 CLStyledMessageDispatch(Plugin *plugin, MessageRef *ref, SInt32 errorNumb if (msgType == Msg_Warning && optsCmdLine.maxWarnings) { if (++clState.countWarnings >= optsCmdLine.maxWarnings) { clState.withholdWarnings = 1; - CLReport(72); + CLReport(CLStr72); } } diff --git a/command_line/CmdLine/Src/Plugins/CLPlugins.c b/command_line/CmdLine/Src/Plugins/CLPlugins.c index 3342dae..dd9d902 100644 --- a/command_line/CmdLine/Src/Plugins/CLPlugins.c +++ b/command_line/CmdLine/Src/Plugins/CLPlugins.c @@ -400,7 +400,7 @@ static Boolean VerifyPanels(Plugin *pl) { if (pl->cb->GetPanelList && pl->cb->GetPanelList(&pls) == 0) { for (idx = 0; idx < pls->count; idx++) { if (Prefs_FindPanel(pls->names[idx]) == NULL) { - CLReportError(91, pls->names[idx]); + CLReportError(CLStr91, pls->names[idx]); failed = 1; } } @@ -460,7 +460,7 @@ void Plugin_Free(Plugin *pl) { Boolean Plugin_VerifyPanels(Plugin *pl) { if (!VerifyPanels(pl)) { - CLReportError(92, Plugin_GetDropInName(pl)); + CLReportError(CLStr92, Plugin_GetDropInName(pl)); return 0; } else { return 1; @@ -511,14 +511,14 @@ int Plugins_Add(Plugin *pl) { pl->cached_ascii_version = Plugin_GetVersionInfoASCII(pl); if (!SupportedPlugin(pl, &failreason)) { - CLReportError(88, dropinname, pl->cached_ascii_version, failreason); + CLReportError(CLStr88, dropinname, pl->cached_ascii_version, failreason); return 0; } scan = &pluginlist; while (*scan) { if (Plugin_MatchesName(*scan, dropinname)) { - CLReportError(89, dropinname); + CLReportError(CLStr89, dropinname); return 0; } scan = &(*scan)->next; @@ -528,14 +528,14 @@ int Plugins_Add(Plugin *pl) { df = Plugin_GetDropInFlags(pl); if (!(df->dropinflags & dropInExecutableTool) && !SendInitOrTermRequest(pl, 1)) { - CLReportError(3, dropinname); + CLReportError(CLStr3, dropinname); return 0; } if (df->dropintype == CWDROPINCOMPILERTYPE && df->dropinflags & 0x17C000) - CLReportError(4, "compiler", dropinname); + CLReportError(CLStr4, "compiler", dropinname); if (df->dropintype == CWDROPINLINKERTYPE && df->dropinflags & 0x5FE4000) - CLReportError(4, "linker", dropinname); + CLReportError(CLStr4, "linker", dropinname); if (clState.pluginDebug) { vislang = df->edit_language ? df->edit_language : CWFOURCHAR('-','-','-','-'); @@ -816,11 +816,11 @@ Plugin *Plugins_GetParserForPlugin(Plugin *list, OSType style, int numPlugins, C if (pick && !allpanels) { int idx; - CLReport(5); + CLReport(CLStr5); for (idx = 0; idx < numPanels; idx++) { if (!supports[idx]) - CLReport(6, panelNames[idx]); + CLReport(CLStr6, panelNames[idx]); } } diff --git a/command_line/CmdLine/Src/Project/CLAccessPaths.c b/command_line/CmdLine/Src/Project/CLAccessPaths.c index 1b455da..f4c7725 100644 --- a/command_line/CmdLine/Src/Project/CLAccessPaths.c +++ b/command_line/CmdLine/Src/Project/CLAccessPaths.c @@ -463,13 +463,13 @@ void Framework_GetEnvInfo(void) { if (path[0]) { if (strlen(path) >= sizeof(path)) { - CLReportError(64, sizeof(path), path); + CLReportError(CLStr64, sizeof(path), path); } else { err = OS_MakeSpec(path, &spec, &is_file); if (!is_file && !err) { Frameworks_AddPath(&spec.path); } else { - CLReportError(23, path); + CLReportError(CLStr23, path); } } } diff --git a/compiler_and_linker/unsorted/CodeGen.c b/compiler_and_linker/unsorted/CodeGen.c index 4fb0b30..f14aa60 100644 --- a/compiler_and_linker/unsorted/CodeGen.c +++ b/compiler_and_linker/unsorted/CodeGen.c @@ -1294,9 +1294,9 @@ static void CodeGen_EOLCheck(void) { } static void schedule_for(int what) { - CPrep_PushOption(OPT_OFFSET(schedule_cpu), what); + CPrep_PushOption(OPT_OFFSET(scheduling), what); if (copts.schedule_factor == 0) - CPrep_PushOption(OPT_OFFSET(schedule_mode), 2); + CPrep_PushOption(OPT_OFFSET(schedule_factor), 2); } static void pragma_scheduling(void) { @@ -1313,20 +1313,20 @@ static void pragma_scheduling(void) { schedule_for(7); return; } else if (!strcmp(tkidentifier->name, "reset")) { - CPrep_PopOption(OPT_OFFSET(schedule_cpu)); - CPrep_PopOption(OPT_OFFSET(schedule_mode)); + CPrep_PopOption(OPT_OFFSET(scheduling)); + CPrep_PopOption(OPT_OFFSET(schedule_factor)); return; } else if (!strcmp(tkidentifier->name, "off")) { - CPrep_PushOption(OPT_OFFSET(schedule_mode), 0); + CPrep_PushOption(OPT_OFFSET(schedule_factor), 0); return; } else if (!strcmp(tkidentifier->name, "once")) { - CPrep_PushOption(OPT_OFFSET(schedule_mode), 1); + CPrep_PushOption(OPT_OFFSET(schedule_factor), 1); return; } else if (!strcmp(tkidentifier->name, "twice")) { - CPrep_PushOption(OPT_OFFSET(schedule_mode), 2); + CPrep_PushOption(OPT_OFFSET(schedule_factor), 2); return; } else if (!strcmp(tkidentifier->name, "on")) { - CPrep_PushOption(OPT_OFFSET(schedule_mode), 2); + CPrep_PushOption(OPT_OFFSET(schedule_factor), 2); return; } else if (!*flag) { if (!strcmp(tkidentifier->name, "603e")) { @@ -1612,7 +1612,7 @@ void CodeGen_ParsePragma(HashNameNode *name) { case 32: case 64: case 128: - CPrep_PushOption(OPT_OFFSET(code_alignment), value); + CPrep_PushOption(OPT_OFFSET(function_align), value); break; default: PPCError_Warning(161); @@ -1620,7 +1620,7 @@ void CodeGen_ParsePragma(HashNameNode *name) { return; } } else if (t == TK_IDENTIFIER && !strcmp(tkidentifier->name, "reset")) { - CPrep_PopOption(OPT_OFFSET(code_alignment)); + CPrep_PopOption(OPT_OFFSET(function_align)); } else { PPCError_Warning(161); } @@ -1739,7 +1739,7 @@ void CodeGen_ParsePragma(HashNameNode *name) { case 32: case 64: case 128: - CPrep_PushOption(OPT_OFFSET(some_alignment), value); + CPrep_PushOption(OPT_OFFSET(min_struct_alignment), value); break; default: PPCError_Warning(191); @@ -1748,11 +1748,11 @@ void CodeGen_ParsePragma(HashNameNode *name) { } } else if (t == TK_IDENTIFIER) { if (!strcmp(tkidentifier->name, "reset")) - CPrep_PopOption(OPT_OFFSET(some_alignment)); + CPrep_PopOption(OPT_OFFSET(min_struct_alignment)); else if (!strcmp(tkidentifier->name, "on")) - CPrep_PushOption(OPT_OFFSET(some_alignment), 4); + CPrep_PushOption(OPT_OFFSET(min_struct_alignment), 4); else if (!strcmp(tkidentifier->name, "off")) - CPrep_PushOption(OPT_OFFSET(some_alignment), 1); + CPrep_PushOption(OPT_OFFSET(min_struct_alignment), 1); } else { PPCError_Warning(161); } diff --git a/includes/cmdline.h b/includes/cmdline.h index e9d3726..cfa6c3d 100644 --- a/includes/cmdline.h +++ b/includes/cmdline.h @@ -5,118 +5,218 @@ #include "pref_structs.h" enum { + // "Could not get current working directory" CLStr1 = 1, + // "Cannot find my executable '%s'" CLStr2 = 2, + // "Could not initialize plugin '%s'" CLStr3 = 3, + // "The %s '%s' requires functionality not present in the command-line driver." CLStr4 = 4, + // "The command-line parser does not support these panels:" CLStr5 = 5, + // "\t%s\n" CLStr6 = 6, + // "Compiling function: '%s'" CLStr7 = 7, + // "Could not write file '%s'" CLStr8 = 8, + // "Could not write file '%s' in directory '%s'" CLStr9 = 9, + // "Write error on output (errno=%ld)" CLStr10 = 10, + // "Current working directory is too long" CLStr11 = 11, + // "Unknown filetype '%c%c%c%c', defaulting to '%s'" CLStr12 = 12, + // "%s:\ttype %s" CLStr13 = 13, + // "Storing output for '%s' in '%s'" CLStr14 = 14, + // "Writing text file '%s'" CLStr15 = 15, + // "Writing %sobject file '%s'" CLStr16 = 16, + // "Writing browse data '%s'" CLStr17 = 17, + // "Could not write %s '%s' (error %ld)" CLStr18 = 18, + // "Deleting temporary file '%s'" CLStr19 = 19, + // "Could not resolve alias for '%s' (error %ld)" CLStr20 = 20, + // "%s:\t'%s'%s" CLStr21 = 21, + // "File '%s' has browse fileID %d" CLStr22 = 22, + // "Can't locate directory '%s'" CLStr23 = 23, + // " %8.2f seconds to %s %s%s%s" CLStr24 = 24, + // " %8d lines compiled" CLStr25 = 25, + // " %8d %s code\n %8d %s init'd data\n %8d %s uninit'd data" CLStr26 = 26, + // " %8d total %s code\n %8d total %s init'd data\n %8d total %s uninit'd data" CLStr27 = 27, + // "File '%s' is not compilable source, target object data, or command file; ignoring" CLStr28 = 28, + // "All specified files were ignored" CLStr29 = 29, + // "Compiling: '%s'" CLStr30 = 30, + // "Compiling: '%s' with '%s'" CLStr31 = 31, + // "Precompiling: '%s'" CLStr32 = 32, + // "Precompiling: '%s' with '%s'" CLStr33 = 33, + // "Preprocessing: '%s'" CLStr34 = 34, + // "Preprocessing: '%s' with '%s'" CLStr35 = 35, + // "Finding dependencies: '%s'" CLStr36 = 36, + // "Finding dependencies: '%s' with '%s'" CLStr37 = 37, + // "Importing: '%s'" CLStr38 = 38, + // "Importing: '%s' with '%s'" CLStr39 = 39, + // "Linking project" CLStr40 = 40, + // "Linking project with '%s'" CLStr41 = 41, + // "Pre-linking project" CLStr42 = 42, + // "Pre-linking project with '%s'" CLStr43 = 43, + // "Post-linking project" CLStr44 = 44, + // "Post-linking project with '%s'" CLStr45 = 45, + // "Disassembling: '%s'" CLStr46 = 46, + // "Disassembling: '%s' with '%s'" CLStr47 = 47, + // "Syntax checking: '%s'" CLStr48 = 48, + // "Syntax checking: '%s' with '%s'" CLStr49 = 49, + // "Getting target info from '%s'" CLStr50 = 50, + // "Initializing '%s'" CLStr51 = 51, + // "Terminating '%s'" CLStr52 = 52, + // "'%s' cannot preprocess, skipping '%s'" CLStr53 = 53, + // "'%s' cannot precompile, skipping '%s'" CLStr54 = 54, + // "'%s' cannot generate code, skipping '%s'" CLStr55 = 55, + // "'%s' has no object code to disassemble" CLStr56 = 56, + // "'%s' cannot disassemble, skipping '%s'" CLStr57 = 57, + // "Neither '%s' nor '%s' can disassemble, skipping '%s'" CLStr58 = 58, + // "No precompiled header name given, '%s' assumed" CLStr59 = 59, + // "Precompile target '%s' given on command line; source-specified name '%s' ignored" CLStr60 = 60, + // "Writing precompiled %s file '%s'" CLStr61 = 61, + // "Reading precompiled %s file '%s'" CLStr62 = 62, + // "Cannot %s memory for %s" CLStr63 = 63, + // "Files/directories must have length <= %ld characters;\n'%s' not accepted" CLStr64 = 64, + // "Guessed linker name '%s' from compiler name '%s'" CLStr65 = 65, + // "Can't find %s '%s' in path" CLStr66 = 66, + // "Calling %s '%s'" CLStr67 = 67, + // "Can't execute %s '%s' (%s)" CLStr68 = 68, + // "%s '%s' returned with exit code %d" CLStr69 = 69, + // "Too many errors printed, aborting program" CLStr70 = 70, + // "Too many errors printed, suppressing errors for current file" CLStr71 = 71, + // "Too many warnings printed, suppressing warnings for current file" CLStr72 = 72, + // "No %s mapping matches '%s' (unrecognized file contents or filename extension); %s" CLStr73 = 73, + // "No plugin or target matches the file '%s', ignoring" CLStr74 = 74, + // "File '%s' cannot be handled by this tool, ignoring" CLStr75 = 75, + // "File '%s' does not match the active target" CLStr76 = 76, + // "Adding%s:\t'%s'" CLStr77 = 77, + // "Creating new overlay '%s' in group '%s'" CLStr78 = 78, + // "Creating new overlay group '%s' at addr %08X:%08X" CLStr79 = 79, + // "File '%s' cannot be added to overlay group; define an overlay in the group first" CLStr80 = 80, + // "Cannot create virtual export file '%s' (from '-export name,...')" CLStr81 = 81, + // "Too many %s defined; at most %d%s is allowed" CLStr82 = 82, + // "Loading preference panel '%s'" CLStr83 = 83, + // "%s:" CLStr84 = 84, + // "\t%s%s" CLStr85 = 85, + // "Already defined %s search path; '%s' added after other paths" CLStr86 = 86, + // "License check failed: %s" CLStr87 = 87, + // "The plugin '%s' (version '%s') cannot be used:\n%s" CLStr88 = 88, + // "Plugin '%s' has already been registered" CLStr89 = 89, + // "Preferences for '%s' have already been registered" CLStr90 = 90, + // "Preferences for '%s' not found" CLStr91 = 91, + // "Some preferences needed by the plugin '%s' have not been registered" CLStr92 = 92, + // "Could not load file '%s'" CLStr93 = 93, + // "Could not find change current working directory to '%s'" CLStr94 = 94, + // "Out of memory" CLStr95 = 95, + // "The tool did not produce any output while %s the file '%s'" CLStr96 = 96, + // "The filename '%s' is invalid" CLStr97 = 97, + // "The %slinker for this target was not found" CLStr98 = 98, + // "%s\n%s (OS error %d)" CLStr99 = 99, + // "%s\n%s (error %d)" CLStr100 = 100, + // "Note: '%s' did not generate any browse information \nfor '%s'; no browser output generated" CLStr101 = 101, + // "Source and specified output for the file '%s' are identical; no output will be generated" CLStr102 = 102, + // "More than one output filename specified for '%s'; ignoring '%s'" CLStr103 = 103, + // "Pref panel data for '%s' is out-of-date or invalid" CLStr104 = 104, + // "Changing primary user access path to '%s'" CLStr105 = 105, + // "The linker does not expect duplicate files; ignoring repeated '%s'" CLStr106 = 106, - CLStr107 = 107, - CLStr108 = 108, - CLStr109 = 109, - CLStr110 = 110, - CLStr111 = 111, - CLStr112 = 112 }; #define DO_INTERNAL_ERROR(line, ...) CLInternalError(__FILE__, line, __VA_ARGS__) @@ -654,6 +754,13 @@ extern int StoreObjectFile(File *file); extern int CompileFilesInProject(void); extern int LinkProject(void); +/********************************/ +/* CLFileTypes.c */ +extern void AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappingList *entry); +extern void UseFileTypeMappings(OSFileTypeMappings *list); +extern OSErr SetMacFileType(const FSSpec *spec, OSType mactype); +extern OSErr GetMacFileType(const FSSpec *spec, OSType *mactype); + /********************************/ /* CLIncludeFileCache.c */ extern void InitializeIncludeCache(void); @@ -738,13 +845,6 @@ extern int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *s extern int WriteObjectFile(File *file, OSType maccreator, OSType mactype); extern int WriteBrowseData(File *file, OSType maccreator, OSType mactype); -/********************************/ -/* Unknown name - provisionally named uFileTypeMappings.c */ -extern void AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappingList *entry); -extern void UseFileTypeMappings(OSFileTypeMappings *list); -extern OSErr SetMacFileType(const FSSpec *spec, OSType mactype); -extern OSErr GetMacFileType(const FSSpec *spec, OSType *mactype); - #ifdef __cplusplus } #endif diff --git a/includes/compiler.h b/includes/compiler.h deleted file mode 100644 index c811e6a..0000000 --- a/includes/compiler.h +++ /dev/null @@ -1,256 +0,0 @@ -#include "compiler/common.h" - -// THESE TYPES ARE NOT YET SORTED -#include "compiler/tokens.h" -#include "compiler/CompilerTools.h" - -#ifdef __MWERKS__ -#pragma options align=mac68k -#endif - - - - - - - - - - -struct MemInitializer { - MemInitializer *next; - union { - ENodeList *nodes; - ENode *expr; - } e; - union { - ObjMemberVar *ivar; - Type *type; - } u; - Boolean is_ivar; - Boolean is_expr; -}; - - -typedef enum DepNameType { - DNT_NAME, - DNT_CONVERSION, - DNT_DTOR, - DNT_NAMESPACE, - DNT_QUALNAME, - DNT_TEMPLATE, - DNT_TYPENAME -} DepNameType; - -struct DepName { - DepName *next; - union { - HashNameNode *name; - NameSpace *nspace; - struct { - Type *type; - UInt32 qual; - } conv; - struct { - HashNameNode *name; - TemplArg *args; - } templ; - struct { - HashNameNode *name; - Type *type; - } tname; - } u; - DepNameType type; -}; - - - - - -typedef enum SubKind { - SUBKIND_NAMESPACE, - SUBKIND_TYPE, - SUBKIND_OBJECT -} SubKind; - -typedef struct Substitution { - struct Substitution *next; - union { - NameSpace *nspace; - struct { - Type *type; - UInt32 qual; - } type; - Object *obj; - } u; - int id; - SubKind kind; -} Substitution; - -// Registers.c - -// RegisterInfo.c - -// LOOSE DECLS -extern short high_offset; -extern short low_offset; -extern short high_reg; -extern short low_reg; -extern short high_reg2; -extern short low_reg2; -extern void PrecompilerRead(short refnum, void *buffer); -extern void PrecompilerWrite(); -extern void CodeGen_InitCompiler(); -extern void CodeGen_TermCompiler(); -extern void CodeGen_InitBackEndOptions(); -extern void CodeGen_UpdateOptimizerOptions(); -extern void CodeGen_UpdateBackEndOptions(); -extern void MWUnmangle(const char *name, char *buf, int size); -//extern COpts copts; -extern CParams *cparamblkptr; -extern FuncArg elipsis; -extern FuncArg oldstyle; -extern jmp_buf errorreturn; -extern Boolean cprep_nomem_exit; -extern Boolean anyerrors; -extern Boolean fatalerrors; -extern SInt32 lines; -extern char string[256]; -extern TemplStack *ctempl_curinstance; -//extern ParserTryBlock *trychain; -extern Boolean in_assembler; -extern Boolean preprocessing_only; -extern void AssemblerError(); -#include "compiler/types.h" -extern short tk; -extern HashNameNode *tkidentifier; -extern short lex(); -extern short notendofline(); -extern short lookahead(); -extern Object *CClass_Constructor(TypeClass *tclass); -extern Object *CClass_Destructor(TypeClass *tclass); -extern int CClass_CheckPures(TypeClass *tclass); -extern Boolean CClass_IsConstructor(Object *func); -extern short CABI_GetStructResultArgumentIndex(); -extern Boolean CParser_HasInternalLinkage(Object *obj); -extern HashNameNode *CParser_GetUniqueName(); -extern SInt32 CParser_GetUniqueID(); -extern Boolean CParserIsVolatileExpr(ENode *expr); -extern Boolean CParserIsConstExpr(ENode *expr); -extern Boolean CParser_IsPublicRuntimeObject(Object *obj); -extern Boolean CParser_ParseOperatorName(short *token, Boolean flag1, Boolean flag2); -extern Boolean CTemplTool_EqualArgs(TemplArg *a, TemplArg *b); -extern Boolean CTemplTool_IsTemplateArgumentDependentType(Type *type); -extern TypeTemplDep *CDecl_NewTemplDepType(TypeTemplDepType tdtype); -extern Type *CDecl_NewPointerType(Type *type); -extern Type *CDecl_NewStructType(SInt32 size, SInt32 align); -extern Type *CDecl_NewArrayType(Type *type, SInt32 num); -extern GList name_mangle_list; -extern void CPrep_UnLex(); -extern Type *CTempl_ClassGetType(TypeClass *tclass); -//extern short is_typesame(Type *t1, Type *t2); -extern Boolean is_unsigned(Type *type); -extern void CDecl_CompleteType(Type *type); -extern TemplArg *CTempl_ParseUncheckTemplArgs(void *fixmelater, Boolean flag); -extern SInt32 CClass_VirtualBaseOffset(TypeClass *tclass, TypeClass *base); -extern Boolean CClass_IsMoreAccessiblePath(BClassList *a, BClassList *b); -extern Boolean CClass_ClassDominates(TypeClass *a, TypeClass *b); -extern Boolean CParser_CheckTemplateClassUsage(TemplClass *tmclass, Boolean flag); -extern Type *CTempl_ParseTemplTemplParam(Type *t); -extern void CClass_CheckPathAccess(BClassList *bcl, void *unk, AccessType access); -extern BClassList *CClass_GetPathCopy(BClassList *path, Boolean flag); -extern Object *CClass_ThisSelfObject(); -extern AccessType global_access; -extern HashNameNode *this_name_node; -extern void CParser_Setup(); -extern Boolean CParser_IsConst(Type *type, UInt32 qual); -extern void CParser_Cleanup(); -extern void SetupPrecompiler(Boolean flag); -extern void CleanupPrecompiler(); -extern void SetupAssembler(); -extern void CleanupAssembler(); -extern void ObjGen_Setup(); -extern void ObjGen_Finish(); -extern void ObjGen_Cleanup(); -extern void ObjGen_CodeCleanup(); -extern void ObjGen_DeclareFloatConst(Object *obj); -extern void ObjGen_DeclareVectorConst(Object *obj); -extern void ObjGen_DeclareCodeLabel(Object *labelobj, SInt32 offset, Object *funcobj); -extern Boolean ObjGen_IsExported(Object *obj); -extern void PointerAnalysis_Setup(); -extern void PointerAnalysis_Cleanup(); -extern Boolean CPrep_Preprocess(); -extern void cparser(); -extern void CBrowse_Setup(CParams *param); -extern void CBrowse_Finish(CParams *param); -extern void CBrowse_Cleanup(CParams *param); -extern UInt32 CParser_GetTypeQualifiers(Type *type, UInt32 qual); -extern void CTemplClass_RegisterUsingDecl(TemplClass *tclass, Type *target, AccessType access); -extern void CodeGen_InsertSpecialMacros(); -extern void CPrep_PreprocessDumpFileInfo(Boolean flag); -extern void CPrep_PreprocessDumpNewLine(); -extern Boolean gForceSourceLoc; -extern void ObjGen_SegmentName(); // might take an arg, not sure since it's empty -extern void ObjGen_SrcBreakName(HashNameNode *name, SInt32 modDate, Boolean flag); -extern char *precomp_target_str; -extern Object *CParser_ParseObject(); -extern void PointerAnalysis_PragmaMode(); -extern void CExcept_Terminate(); -extern void CExcept_ArrayInit(); -extern void CExcept_Magic(); -extern void CSOM_PragmaReleaseOrder(); -extern void CSOM_PragmaClassVersion(); -extern void CSOM_PragmaMetaClass(); -extern void CSOM_PragmaCallStyle(); -extern short GetPrec(short t); -extern short localcount; -extern Boolean InlineAsm_gccmode; -extern void initialize_aliases(); -extern Statement *current_statement; -extern int pclist_bad_operand; -extern int n_real_registers[]; -extern short pic_base_reg; -extern Object pic_base; -extern ObjectList *exceptionlist; -extern ObjectList *arguments; -extern ObjectList *locals; -extern ObjectList *toclist; -extern Boolean uses_globals; -extern Boolean requires_frame; -extern void assign_locals_to_memory(ObjectList *locals); -extern PCodeLabel *pic_base_pcodelabel; -extern void *make_alias(Object *obj, SInt32 offset, SInt32 size); -extern Boolean is_volatile_object(Object *obj); -extern Boolean is_pascal_object(Object *obj); -extern Boolean local_is_16bit_offset(Object *obj); -extern Boolean can_add_displ_to_local(Object *obj, SInt32 displ); -extern int local_base_register(Object *obj); -extern int disable_optimizer; -extern Boolean IsTempName(HashNameNode *name); -extern void assign_local_memory(Object *obj); -extern void move_varargs_to_memory(); -extern Type stvoid; -extern TypePointer void_ptr; -extern int countexceptionactionregisters(ExceptionAction *exc); -extern void noteexceptionactionregisters(ExceptionAction *exc, PCodeArg *); -extern void recordexceptionactions(PCode *pc, ExceptionAction *exc); -extern SInt32 functionbodyoffset; -extern Object *CParser_NewRTFunc(Type *returntype, HashNameNode *name, Boolean unkflag, int argcount, ...); -extern SInt32 curstmtvalue; -extern Object *__memcpy_object; -extern void CInit_RewriteString(ENode *expr, Boolean flag); -extern int is_intrinsic_function_call(ENode *expr); -extern SInt32 I8_log2n(SInt64 value); -extern void PPCError_Error(int code); - -enum { - INTRINSIC_8 = 8, - INTRINSIC_35 = 35, - INTRINSIC_36 = 36 -}; - -extern char *ScanFloat(char *input, double *output, Boolean *fail); - -#ifdef __MWERKS__ -#pragma options align=reset -#endif diff --git a/includes/parser.h b/includes/parser.h index 92e4504..9ecaa34 100644 --- a/includes/parser.h +++ b/includes/parser.h @@ -23,84 +23,161 @@ typedef struct { } Pragma; // assumed name enum { - CLPStr0 = 0, + // "Option missing" CLPStr1 = 1, + // "Command-line argument '%.15s...%.15s' is much too long, maximum accepted length is %d characters" CLPStr2 = 2, + // "Parameter for '%s' missing" CLPStr3 = 3, + // "Numeric constant '%s' overflowed 32-bit range" CLPStr4 = 4, + // "Invalid %sconstant '%s'" CLPStr5 = 5, + // "Numeric constant %lu is out of the legal range %lu - %lu" CLPStr6 = 6, + // "Numeric constant %lu is out of the legal range %lu - %lu; clipping to %lu" CLPStr7 = 7, + // "Four-char type '%s' is too long, expected maximum four characters" CLPStr8 = 8, + // "String constant '%.16s...%.16s' too long, expected maximum %ld characters" CLPStr9 = 9, + // "Identifier '%s' cannot start with a digit" CLPStr10 = 10, + // "Identifier '%s' cannot contain the character '%c'" CLPStr11 = 11, + // "Expected 'on' or 'off', but got '%s'" CLPStr12 = 12, + // "Filename or directory '...%32s' is too long, expected maximum %ld characters" CLPStr13 = 13, + // "Directory '...%32s' combined with filename '...%32s' is too long, maximum path is %ld characters" CLPStr14 = 14, + // "File '%s' does not exist" CLPStr15 = 15, + // "'%s' is a directory or volume, filename expected" CLPStr16 = 16, + // "'%s' does not refer to a directory" CLPStr17 = 17, + // "File path '%s' not accepted\n(%s)" CLPStr18 = 18, + // "Unknown option '%s'" CLPStr19_UnknownOptionX = 19, + // "Unknown option '%s'; expected one of '%s'" CLPStr20_UnknownOptionX_ExpectedOneOfX = 20, + // "Option is obsolete" CLPStr21_OptionObsolete = 21, + // "Option is obsolete; %s" CLPStr22_OptionObsoleteWithHelp = 22, + // "Option '%s' substituted with %s" CLPStr23_OptionXSubstitutedWithX = 23, + // "Option deprecated; accepted this time" CLPStr24_OptionDeprecated = 24, + // "Option deprecated, accepted this time; use '%s' instead" CLPStr25_OptionDeprecatedWithHelp = 25, + // "Option ignored" CLPStr26_OptionIgnored = 26, + // "Option ignored;\n%s" CLPStr27_OptionIgnoredWithText = 27, + // "%s" CLPStr28_WarningText = 28, + // "Option has no effect on this target" CLPStr29_OptionHasNoEffect = 29, + // "Option should not be specified multiple times" CLPStr30_OptionShouldNotBeSpecifiedMultipleTimes = 30, + // "Option overrides the effect of '%s'; only one of '%s' should be specified" CLPStr31_OptionOverridesEffect = 31, + // "Option overrides the effect of '%s'; only one of '%s' should be specified;\n%s" CLPStr32_OptionOverridesEffectWithHelp = 32, + // "No default handler set up for '%s', ignoring" CLPStr33_NoDefaultHandlerSetUpForX_Ignoring = 33, + // "Argument(s) expected" CLPStr34_ArgumentsExpected = 34, + // "Token '%s' not expected" CLPStr35_TokenXNotExpected = 35, + // "Unexpected additional argument '%s'" CLPStr36_UnexpectedAdditionalArgumentX = 36, + // "Encountered extraneous arguments" CLPStr37 = 37, + // "No help available for option '%s'" CLPStr38_NoHelpAvailableForOptionX = 38, + // "Empty (zero-length) argument not accepted" CLPStr39 = 39, + // "Variable name missing" CLPStr40 = 40, + // "Only one output filename allowed; '%s' not accepted" CLPStr41 = 41, + // "Output filenames found without source; '%s' not accepted" CLPStr42 = 42, + // "Multiple outputs expected, output is ambiguous; '%s' not accepted" CLPStr43 = 43, + // "Specified file '%s' not found" CLPStr44 = 44, + // "Specified directory '%s' not found" CLPStr45 = 45, + // "'%s' is a filename, not a directory; not accepted" CLPStr46 = 46, + // "'%s' is a directory, not a filename; not accepted" CLPStr47 = 47, + // "Library search found shared library '%s' instead of export library '%s.LIB'" CLPStr48 = 48, + // "No library file found matching 'lib%s{%s}' or '%s'" CLPStr49 = 49, + // "Redudant use of '%c%s%s'; linker always searches library paths;\ntypically one finds, e.g., libXXX.a with '%c%sXXX'" CLPStr50 = 50, + // "Empty filename in library list ignored" CLPStr51 = 51, + // "Environment variable '%s' not found" CLPStr52 = 52, + // "In environment variable '%s':" CLPStr53 = 53, + // "Option name expected for 'opt'" CLPStr54 = 54, + // "Token '%s' ignored" CLPStr55 = 55, + // "Token '%s[...%s]' was truncated to %d characters" CLPStr56 = 56, + // "Expected %s, but got %s" CLPStr57 = 57, + // "No output expected from this process, ignoring output name '%s'" CLPStr58 = 58, + // "Only one output directory allowed, '%s' not accepted" CLPStr59 = 59, + // "Storing browse info for '%s' in '%s'" CLPStr60 = 60, + // "All linker output will be created in the same directory; ignoring path for '%s'" CLPStr61 = 61, + // "Option overrides previously specified optimizations" CLPStr62 = 62, + // "Could not initialize command line parser" CLPStr63 = 63, + // "Output filename '%s' is invalid" CLPStr64 = 64, + // "Truncated output filename '%s' to %d characters" CLPStr65 = 65, + // "Output directory '%s' cannot be found" CLPStr66 = 66, + // "Cannot add access path '%s'" CLPStr67 = 67, + // "Cannot set preferences for '%s'" CLPStr68 = 68, + // "Some of the files specified could not be found; build aborted" CLPStr69 = 69, + // "Nothing to do: no source or object files specified" CLPStr70 = 70, + // "Contents of %s:" CLPStr71 = 71, + // "Overlays not supported on this target" CLPStr72 = 72, + // "Segments not supported on this target" CLPStr73 = 73, + // "Cannot open %s file '%s'" CLPStr74 = 74, + // "" CLPStr75 = 75, + // "The file \"%s\" may be ignored unless it has one of the following\nextensions: \"%s\"" CLPStr76 = 76, + // "Not using non-text file '%s' as optional argument" CLPStr77 = 77, + // "Cannot redirect stream to '%s' (%s)" CLPStr78 = 78 }; diff --git a/notes b/notes index b54fd13..73f541b 100644 --- a/notes +++ b/notes @@ -1,5 +1,10 @@ +OS X: ~/bin/mwccppc -c -g -opt l=4,noschedule,speed -enum min -Iincludes -Isdk_hdrs -w all,nounused -wchar_t on -bool off -Cpp_exceptions off +OS 9: +export MWCIncludes="/Users/ash/src/mwcc/native_copy/msl_c_pro7/MSL_Common/Include;/Users/ash/src/mwcc/native_copy/msl_c_pro7/MSL_MacOS/Include" +wine ../reversing/v7_0_mwcppc.exe -g -opt l=4,speed -enum min -Iincludes -Isdk_hdrs -w all,nounused,notinlined -wchar_t on -bool off -Cpp_exceptions off -maxwarnings 10 + TODO: - locate COS stuff based off EPPC 8 debug info - command_line/C++_Parser/Src/Library/OptimizerHelpers.c diff --git a/sdk_hdrs/CWDropInPanel.h b/sdk_hdrs/CWDropInPanel.h deleted file mode 100755 index 4aa7a21..0000000 --- a/sdk_hdrs/CWDropInPanel.h +++ /dev/null @@ -1 +0,0 @@ -/* * CWDropInPanel.h * * Copyright © 1999 Metrowerks inc. All rights reserved. * * DropIn Preferences Panel Interface for UNIX/WIN32 Metrowerks CodeWarriorª */ #ifndef __CWDROPINPANEL_H__ #define __CWDROPINPANEL_H__ #ifdef __MWERKS__ # pragma once #endif #ifndef __CWPlugins_H__ #include "CWPlugins.h" #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif /* * Convenience macros for swapping pref-panel values. Use this macros only if your * system/libraries do not provide their own public swapping functions/macros. * */ /* Swap 16-bit(short) value */ #define CWPREF_BYTESWAP_SHORT(value) value = \ (((((unsigned short)(value))<<8) & 0xFF00) | \ ((((unsigned short)(value))>>8) & 0x00FF)) /* Swap 32-bit(long) value */ #define CWPREF_BYTESWAP_LONG(value) value = \ (((((unsigned long)(value))<<24) & 0xFF000000) | \ ((((unsigned long)(value))<< 8) & 0x00FF0000) | \ ((((unsigned long)(value))>> 8) & 0x0000FF00) | \ ((((unsigned long)(value))>>24) & 0x000000FF)) #ifndef __DROPINPANEL_H__ /* API version numbers */ #define DROPINPANELAPIVERSION_1 1 /* CW7 API version */ #define DROPINPANELAPIVERSION_2 2 /* intermediate version */ #define DROPINPANELAPIVERSION_3 3 /* CW8 API version */ #define DROPINPANELAPIVERSION_4 4 /* CW9 API version */ #define DROPINPANELAPIVERSION_5 5 /* CW Pro 2 API version */ #define DROPINPANELAPIVERSION_7 7 /* CW Pro 3 Mac API version */ #define DROPINPANELAPIVERSION_8 8 /* CW Pro 3 Win32 API version */ #define DROPINPANELAPIVERSION_9 9 /* CW Pro 5 Win32 API version */ #define DROPINPANELAPIVERSION_10 10 /* CW Pro 6 Win32 API version */ #define DROPINPANELAPIVERSION_11 11 /* CW Pro 7 Win32 API version */ #define DROPINPANELAPIVERSION DROPINPANELAPIVERSION_11 /* current API version */ /* Error codes you return to the IDE */ #define kBadPrefVersion 1000 /* panel doesn't know about this version */ #define kMissingPrefErr 1001 #define kSettingNotFoundErr 1002 #define kSettingTypeMismatchErr 1003 #define kInvalidCallbackErr 1004 #define kSettingOutOfRangeErr 1005 /* * Requests codes - sent by the IDE to your panel * Note: Many of these are Mac-specific but are included for compatability reasons. * Future APIs will reimplement many of them is an OS-neutral way. */ enum { reqInitPanel = -2, /* (called when panel is loaded) */ reqTermPanel = -1, /* (called when panel is unloaded) */ reqInitDialog = 0, /* initialize panel's dialog state */ reqTermDialog, /* clean up panel's dialog state */ reqPutData, /* copy options data to dialog items */ reqGetData, /* copy dialog items to options data */ reqFilter, /* filter a dialog event for the panel (Mac only) */ reqItemHit, /* process an itemHit in the panel */ reqAEGetPref, /* get preference setting for AppleEvent request (Mac only) */ reqAESetPref, /* set preference setting from AppleEvent request (Mac only) */ reqValidate, /* tell if current settings force recompile or relink */ reqGetFactory, /* retrieve factory settings */ reqUpdatePref, /* verify and/or modify prefs to fit current version */ reqUpdateProject, /* (only sent to built-in panels) */ reqSetupDebug, /* change settings to reflect debugging status */ reqRenameProject, /* change settings that depend on project name */ reqPrefsLoaded, /* (only sent to built-in panels) */ reqDrawCustomItem, /* draw a custom item (Mac only) */ reqActivateItem, /* activate a custom item (Mac only) */ reqDeactivateItem, /* deactivate a custom item (Mac only) */ reqHandleClick, /* handle mouse down in an active custom item (Mac only) */ reqHandleKey, /* handle key down in an active custom item (Mac only) */ reqFindStatus, /* enable/disable menu items for a custom item (Mac only) */ reqObeyCommand, /* execute a menu command for a custom item (Mac only) */ reqDragEnter, /* the user is dragging into the given item (Mac only) */ reqDragWithin, /* the user is dragging within the given item (Mac only) */ reqDragExit, /* the user is dragging out of the given item (Mac only) */ reqDragDrop, /* the user dropped onto the given item (Mac only) */ reqByteSwapData, /* byte swap the fields in the prefs data */ reqFirstLoad, /* panel has been loaded for the first time */ reqReadSettings, /* read settings from IDE to construct pref data handle */ reqWriteSettings, /* write the individual settings from pref data handle */ reqItemDoubleClick, /* process an double clicked in the panel, currently implemented for listviews */ reqItemIsCellEditable /* currently implemented for listviews, tells whether or not the listview is editable */ }; /* Layout and bit flags for 'Flag' resource for panels */ /* */ /* For the version 3 of these resource, we renamed the 'apiversion' field to */ /* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */ /* This allows plugins to support more than one API version and therefore run */ /* under more than one version of the IDE. */ typedef struct PanelFlags { unsigned short rsrcversion; /* version number of resource */ CWDataType dropintype; /* dropin type ('Comp', 'Link', 'Panl') */ /* earliest API support by this plugin */ unsigned short earliestCompatibleAPIVersion; unsigned long dropinflags; /* capability flags (see enum below) */ CWDataType panelfamily; /* family of panel (linker, codegen, etc) */ unsigned short newestAPIVersion; /* newest API version supported */ unsigned short dataversion; /* version number of prefs data */ unsigned short panelscope; /* scope of panel (see enum below) */ } PanelFlags; /* capability flags, as used in member dropinflags of PanelFlags struct */ enum { usesStrictAPI = 1 << 31, /* this panel is built with the strict API */ supportsByteSwapping = 1 << 30, /* this panel support the byte-swapping request */ supportsTextSettings = 1 << 29, /* this panel supports the read & write settings requests */ usesCrossPlatformAPI = 1 << 28 /* uses the cross-platform API rather than Mac API */ /* remaining flags are reserved for future use and should be zero-initialized */ }; /* panel scopes, as used in member panelscope of PanelFlags struct */ /* */ /* The scope of a panel tells the IDE which settings window to display the panel. */ /* Currently, only panels for debugger plug-ins use panelScopeGlobal and only */ /* panels for VCS plug-ins use panelScopeProject. A panel for a compiler or linker */ /* must use panelScopeTarget. */ enum { panelScopeGlobal, /* this panel is scoped to the global preferences window */ panelScopeProject, /* this panel is scoped to the VCS settings window */ panelScopeTarget /* this panel is scoped to the target settings window */ }; /* pre-defined panel families, used in panelfamily field of PanelFlags struct */ enum { panelFamilyProject = CWFOURCHAR('p', 'r', 'o', 'j'), panelFamilyFrontEnd = CWFOURCHAR('f', 'e', 'n', 'd'), panelFamilyBackEnd = CWFOURCHAR('b', 'e', 'n', 'd'), panelFamilyBrowser = CWFOURCHAR('b', 'r', 'o', 'w'), panelFamilyEditor = CWFOURCHAR('e', 'd', 'i', 't'), panelFamilyDebugger = CWFOURCHAR('d', 'b', 'u', 'g'), panelFamilyLinker = CWFOURCHAR('l', 'i', 'n', 'k'), panelFamilyMisc = CWFOURCHAR('*', '*', '*', '*') }; typedef struct MWSetting* CWSettingID; #define kNoSettingID 0 #endif /* not defined __DROPINPANEL_H__ */ /*------------------------------------------------------------------------------------- Callbacks to the IDE, in addition to those in CWPlugins.h -----------------------------------------------------------------------------------*/ /* Dialog related */ CW_CALLBACK CWPanelAppendItems (CWPluginContext context, short ditlID); CW_CALLBACK CWPanelShowItem (CWPluginContext context, long whichItem, Boolean showIt); CW_CALLBACK CWPanelEnableItem (CWPluginContext context, long whichItem, Boolean enableIt); CW_CALLBACK CWPanelActivateItem (CWPluginContext context, long whichItem); CW_CALLBACK CWPanelGetItemValue (CWPluginContext context, long whichItem, long* value); CW_CALLBACK CWPanelSetItemValue (CWPluginContext context, long whichItem, long value); CW_CALLBACK CWPanelGetItemText (CWPluginContext context, long whichItem, char* str, short maxLen); CW_CALLBACK CWPanelSetItemText (CWPluginContext context, long whichItem, char* str); CW_CALLBACK CWPanelInsertListItem (CWPluginContext context, long dlgItemID, long index, char* str); CW_CALLBACK CWPanelDeleteListItem (CWPluginContext context, long dlgItemID, long index); CW_CALLBACK CWPanelGetListItemSize (CWPluginContext context, long dlgItemID, long* listSize); CW_CALLBACK CWPanelGetListItemText (CWPluginContext context, long dlgItemID, long index, char* str, short maxLen); CW_CALLBACK CWPanelSetListItemText (CWPluginContext context, long dlgItemID, long index, char* str); CW_CALLBACK CWPanelGetPopupItemChecked (CWPluginContext context, long dlgItemID, long index, Boolean* checked); CW_CALLBACK CWPanelSetPopupItemChecked (CWPluginContext context, long dlgItemID, long index, Boolean checked); CW_CALLBACK CWPanelSetPopupItemEnabled (CWPluginContext context, long dlgItemID, long index, Boolean enabled); CW_CALLBACK CWPanelInvalItem (CWPluginContext context, long whichItem); CW_CALLBACK CWPanelValidItem (CWPluginContext context, long whichItem); CW_CALLBACK CWPanelGetNumBaseDialogItems(CWPluginContext context, short* baseItems); CW_CALLBACK CWPanelGetDialogItemHit (CWPluginContext context, short* itemHit); CW_CALLBACK CWPanelGetItemTextHandle (CWPluginContext context, long whichItem, CWMemHandle* text); CW_CALLBACK CWPanelSetItemTextHandle (CWPluginContext context, long whichItem, CWMemHandle text); CW_CALLBACK CWPanelGetItemData (CWPluginContext context, long dlgItemID, void *outData, long *outDataLength); CW_CALLBACK CWPanelSetItemData (CWPluginContext context, long dlgItemID, void *inData, long inDataLength); CW_CALLBACK CWPanelGetItemMaxLength (CWPluginContext context, long dlgItemID, short *outLength); CW_CALLBACK CWPanelSetItemMaxLength (CWPluginContext context, long dlgItemID, short inLength); CW_CALLBACK CWPanelChooseRelativePath (CWPluginContext context, CWRelativePath *ioPath, Boolean isFolder, short filterCount, void *filterList, char *prompt); CW_CALLBACK CWPanelGetRelativePathString(CWPluginContext context, CWRelativePath *inPath, char *pathString, long* maxLength); /* CellView related, with string elements */ // selection CW_CALLBACK CWPanelListViewSelectCell (CWPluginContext context,long dlgItemID,long col,long row,Boolean addToSelection); CW_CALLBACK CWPanelListViewUnselectCell (CWPluginContext context,long dlgItemID,long col,long row,Boolean *result); CW_CALLBACK CWPanelListViewSelectNothing (CWPluginContext context,long dlgItemID); CW_CALLBACK CWPanelListViewGetSelectionCount (CWPluginContext context,long dlgItemID,long *count); CW_CALLBACK CWPanelListViewGetSelection (CWPluginContext context,long dlgItemID,long *col,long *row); // rows CW_CALLBACK CWPanelListViewAddRows (CWPluginContext context,long dlgItemID,long afterRow,long count); CW_CALLBACK CWPanelListViewDeleteRows (CWPluginContext context,long dlgItemID,long firstRow,long count); CW_CALLBACK CWPanelListViewGetRowCount (CWPluginContext context,long dlgItemID,long *count); // refresh CW_CALLBACK CWPanelListViewRefreshRow (CWPluginContext context,long dlgItemID,long row); // columns CW_CALLBACK CWPanelListViewAddCols (CWPluginContext context,long dlgItemID,long afterCol,long count); CW_CALLBACK CWPanelListViewDeleteCols (CWPluginContext context,long dlgItemID,long firstCol,long count); CW_CALLBACK CWPanelListViewGetColCount (CWPluginContext context,long dlgItemID,long *count); CW_CALLBACK CWPanelListViewGetColWidth (CWPluginContext context,long dlgItemID,long col,short *colWidth); CW_CALLBACK CWPanelListViewSetColWidth (CWPluginContext context,long dlgItemID,long col,short colWidth); CW_CALLBACK CWPanelListViewNextCell (CWPluginContext context,long dlgItemID,long *col,long *row,Boolean hNext,Boolean vNext,Boolean selectableOnly,Boolean *result); // col and row is in-> and <-out CW_CALLBACK CWPanelListViewRefreshCell (CWPluginContext context,long dlgItemID,long col,long row); CW_CALLBACK CWPanelListViewScrollToCell (CWPluginContext context,long dlgItemID,long col,long row,Boolean inRefresh); CW_CALLBACK CWPanelListViewGetCellTextValue (CWPluginContext context,long dlgItemID,long col,long row,char* str, short maxLen); CW_CALLBACK CWPanelListViewSetCellTextValue (CWPluginContext context,long dlgItemID,long col,long row,char* str); // utilities for giving a answer to a request CW_CALLBACK CWPanelListViewSetDoubleClickHandled(CWPluginContext context, Boolean value); CW_CALLBACK CWPanelListViewSetEditable (CWPluginContext context, Boolean value); CW_CALLBACK CWPanelListViewGetCell (CWPluginContext context, long *col,long *row); /* Preference data related */ CW_CALLBACK CWPanelGetOriginalPrefs (CWPluginContext context, CWMemHandle* originalPrefs); CW_CALLBACK CWPanelGetCurrentPrefs (CWPluginContext context, CWMemHandle* currentPrefs); CW_CALLBACK CWPanelGetFactoryPrefs (CWPluginContext context, CWMemHandle* factoryPrefs); CW_CALLBACK CWPanelGetDebugFlag (CWPluginContext context, Boolean* debugOn); CW_CALLBACK CWPanelSetRevertFlag (CWPluginContext context, Boolean canRevert); CW_CALLBACK CWPanelSetFactoryFlag (CWPluginContext context, Boolean canFactory); CW_CALLBACK CWPanelSetResetPathsFlag (CWPluginContext context, Boolean resetPaths); CW_CALLBACK CWPanelSetRecompileFlag (CWPluginContext context, Boolean recompile); CW_CALLBACK CWPanelSetRelinkFlag (CWPluginContext context, Boolean relink); CW_CALLBACK CWPanelSetReparseFlag (CWPluginContext context, Boolean reparse); CW_CALLBACK CWPanelGetPanelPrefs (CWPluginContext context, const char* panelName, CWMemHandle *prefs, Boolean* requiresByteSwap); CW_CALLBACK CWPanelGetOldProjectFile (CWPluginContext context, CWFileSpec* projectSpec); CW_CALLBACK CWPanelGetToEndian (CWPluginContext context, short* toEndian); #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS CW_CALLBACK CWPanelGetAEKeyword (CWPluginContext context, AEKeyword* keyword); CW_CALLBACK CWPanelGetAEDesc (CWPluginContext context, AEDesc* desc); CW_CALLBACK CWPanelSetAEDesc (CWPluginContext context, const AEDesc* desc); CW_CALLBACK CWPanelReadRelativePathAEDesc (CWPluginContext context, CWRelativePath* path, const AEDesc* desc); CW_CALLBACK CWPanelWriteRelativePathAEDesc (CWPluginContext context, const CWRelativePath* path, AEDesc* desc); #endif /* Reading and writing scalar settings */ CW_CALLBACK CWReadBooleanSetting (CWPluginContext context, const char* name, Boolean* value); CW_CALLBACK CWReadIntegerSetting (CWPluginContext context, const char* name, long* value); CW_CALLBACK CWReadFloatingPointSetting (CWPluginContext context, const char* name, double* value); CW_CALLBACK CWReadStringSetting (CWPluginContext context, const char* name, const char** value); CW_CALLBACK CWReadRelativePathSetting (CWPluginContext context, const char* name, CWRelativePath* value); CW_CALLBACK CWWriteBooleanSetting (CWPluginContext context, const char* name, Boolean value); CW_CALLBACK CWWriteIntegerSetting (CWPluginContext context, const char* name, long value); CW_CALLBACK CWWriteFloatingPointSetting (CWPluginContext context, const char* name, double value); CW_CALLBACK CWWriteStringSetting (CWPluginContext context, const char* name, const char* value); CW_CALLBACK CWWriteRelativePathSetting (CWPluginContext context, const char* name, const CWRelativePath* value); /* Reading and writing array and structure settings */ CW_CALLBACK CWGetNamedSetting (CWPluginContext context, const char* name, CWSettingID* settingID); CW_CALLBACK CWGetStructureSettingField (CWPluginContext context, CWSettingID settingID, const char* name, CWSettingID* fieldSettingID); CW_CALLBACK CWGetArraySettingSize (CWPluginContext context, CWSettingID settingID, long* size); CW_CALLBACK CWGetArraySettingElement (CWPluginContext context, CWSettingID settingID, long index, CWSettingID* elementSettingID); CW_CALLBACK CWGetBooleanValue (CWPluginContext context, CWSettingID settingID, Boolean* value); CW_CALLBACK CWGetIntegerValue (CWPluginContext context, CWSettingID settingID, long* value); CW_CALLBACK CWGetFloatingPointValue (CWPluginContext context, CWSettingID settingID, double* value); CW_CALLBACK CWGetStringValue (CWPluginContext context, CWSettingID settingID, const char** value); CW_CALLBACK CWGetRelativePathValue (CWPluginContext context, CWSettingID settingID, CWRelativePath* value); CW_CALLBACK CWSetBooleanValue (CWPluginContext context, CWSettingID settingID, Boolean value); CW_CALLBACK CWSetIntegerValue (CWPluginContext context, CWSettingID settingID, long value); CW_CALLBACK CWSetFloatingPointValue (CWPluginContext context, CWSettingID settingID, double value); CW_CALLBACK CWSetStringValue (CWPluginContext context, CWSettingID settingID, const char* value); CW_CALLBACK CWSetRelativePathValue (CWPluginContext context, CWSettingID settingID, const CWRelativePath* value); #ifdef __cplusplus } #endif #ifdef __MWERKS__ #pragma options align=reset #endif #ifdef _MSC_VER #pragma pack(pop) #endif #endif /* __CWDROPINPANEL_H__ */ \ No newline at end of file diff --git a/sdk_hdrs/CWPluginErrors.h b/sdk_hdrs/CWPluginErrors.h index 74f93c7..58eb24d 100755 --- a/sdk_hdrs/CWPluginErrors.h +++ b/sdk_hdrs/CWPluginErrors.h @@ -1 +1,50 @@ -/* * CWPluginErrors.h - CW_Result constants for plugin errors * * Copyright © 1995-1997 Metrowerks, Inc. All rights reserved. * */ #ifndef __CWPluginErrors_H__ #define __CWPluginErrors_H__ #ifdef __MWERKS__ # pragma once #endif enum { // common errors for all plugins cwNoErr, /* successful return */ cwErrUserCanceled, /* operation canceled by user */ cwErrRequestFailed, /* generic failure when plugin fails */ cwErrInvalidParameter, /* one or more callback parameters invalid */ cwErrInvalidCallback, /* invalid given current request and plugin type*/ cwErrInvalidMPCallback, /* this request is not support from MP threads */ cwErrOSError, /* OS-specific, call CWGetCallbackOSError() */ cwErrOutOfMemory, /* not enough memory */ cwErrFileNotFound, /* file not found on disk */ cwErrUnknownFile, /* bad file number, doesn't exist */ cwErrSilent, /* request failed but plugin didn't report any */ /* errors and doesn't want IDE to report that */ /* an unknown error occurred */ cwErrCantSetAttribute, /* plugin requested inapplicable file flags in */ /* CWAddProjectEntry */ cwErrStringBufferOverflow, /* an output string buffer was too small */ cwErrDirectoryNotFound, /* unable to find a directory being sought */ cwErrLastCommonError = 512, // compiler/linker errors cwErrUnknownSegment, /* bad segment number, doesn't exist */ cwErrSBMNotFound, /* */ cwErrObjectFileNotStored, /* No external object file has been stored */ cwErrLicenseCheckFailed,/* license check failed, error reported by IDE */ cwErrFileSpecNotSpecified, /* a file spec was unspecified */ cwErrFileSpecInvalid, /* a file spec was invalid */ cwErrLastCompilerLinkerError = 1024 }; #endif // __CWPluginErrors_H__ \ No newline at end of file +/* + * CWPluginErrors.h - CW_Result constants for plugin errors + * + * Copyright � 1995-1997 Metrowerks, Inc. All rights reserved. + * + */ + +#ifndef __CWPluginErrors_H__ +#define __CWPluginErrors_H__ + +#ifdef __MWERKS__ +# pragma once +#endif + +enum +{ + // common errors for all plugins + + cwNoErr, /* successful return */ + cwErrUserCanceled, /* operation canceled by user */ + cwErrRequestFailed, /* generic failure when plugin fails */ + cwErrInvalidParameter, /* one or more callback parameters invalid */ + cwErrInvalidCallback, /* invalid given current request and plugin type*/ + cwErrInvalidMPCallback, /* this request is not support from MP threads */ + cwErrOSError, /* OS-specific, call CWGetCallbackOSError() */ + cwErrOutOfMemory, /* not enough memory */ + cwErrFileNotFound, /* file not found on disk */ + cwErrUnknownFile, /* bad file number, doesn't exist */ + cwErrSilent, /* request failed but plugin didn't report any */ + /* errors and doesn't want IDE to report that */ + /* an unknown error occurred */ + cwErrCantSetAttribute, /* plugin requested inapplicable file flags in */ + /* CWAddProjectEntry */ + cwErrStringBufferOverflow, /* an output string buffer was too small */ + cwErrDirectoryNotFound, /* unable to find a directory being sought */ + cwErrLastCommonError = 512, + + // compiler/linker errors + + cwErrUnknownSegment, /* bad segment number, doesn't exist */ + cwErrSBMNotFound, /* */ + cwErrObjectFileNotStored, /* No external object file has been stored */ + cwErrLicenseCheckFailed,/* license check failed, error reported by IDE */ + cwErrFileSpecNotSpecified, /* a file spec was unspecified */ + cwErrFileSpecInvalid, /* a file spec was invalid */ + cwErrLastCompilerLinkerError = 1024 + +}; + +#endif // __CWPluginErrors_H__ diff --git a/sdk_hdrs/CWPlugins.h b/sdk_hdrs/CWPlugins.h index c959b9f..a427853 100755 --- a/sdk_hdrs/CWPlugins.h +++ b/sdk_hdrs/CWPlugins.h @@ -1 +1,814 @@ -/* * CWPlugins.h - Common declarations for Metrowerks CodeWarrior� plugins * * Copyright � 1995-1997 Metrowerks, Inc. All rights reserved. * */ #include "common.h" #ifndef __CWPlugins_H__ #define __CWPlugins_H__ #ifdef __MWERKS__ # pragma once #endif #define CWPLUGIN_HOST_MACOS 1 #define CWPLUGIN_HOST_WIN32 2 #define CWPLUGIN_HOST_SOLARIS 3 #define CWPLUGIN_HOST_LINUX 4 #ifndef CWPLUGIN_HOST # ifdef WIN32 # define CWPLUGIN_HOST CWPLUGIN_HOST_WIN32 # elif defined(macintosh) || defined(__MACH__) # define CWPLUGIN_HOST CWPLUGIN_HOST_MACOS # elif defined(__sun__) # define CWPLUGIN_HOST CWPLUGIN_HOST_SOLARIS # elif defined(__linux__) # define CWPLUGIN_HOST CWPLUGIN_HOST_LINUX # else # error # endif #endif #define CWPLUGIN_API_MACOS 1 #define CWPLUGIN_API_WIN32 2 #define CWPLUGIN_API_UNIX 3 #ifndef CWPLUGIN_API # ifdef WIN32 # define CWPLUGIN_API CWPLUGIN_API_WIN32 # elif defined(macintosh) || defined(__MACH__) # define CWPLUGIN_API CWPLUGIN_API_MACOS # elif defined(__sun__) || defined(__linux__) # define CWPLUGIN_API CWPLUGIN_API_UNIX # else # error # endif #endif /* ** Radix 256 notation where a 32-bit integer is created from four ** ASCII characters. A four-character constant of this form, say ** 'ABCD', must always be represented with the same pattern, 0x41424344 ** in this case, regardless of big/little endian issues. */ typedef SInt32 CWFourCharType; #define CWFOURCHAR(a, b, c, d) \ (((CWFourCharType) ((a) & 0xff) << 24) \ | ((CWFourCharType) ((b) & 0xff) << 16) \ | ((CWFourCharType) ((c) & 0xff) << 8) \ | ((CWFourCharType) ((d) & 0xff))) #if CWPLUGIN_API == CWPLUGIN_API_UNIX #include #endif #ifndef CW_USE_PRAGMA_EXPORT #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS #define CW_USE_PRAGMA_EXPORT 1 #else #define CW_USE_PRAGMA_EXPORT 0 #endif #endif #ifndef CW_USE_PRAGMA_IMPORT #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS #define CW_USE_PRAGMA_IMPORT 1 #else #define CW_USE_PRAGMA_IMPORT 0 #endif #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif #if CW_USE_PRAGMA_IMPORT #pragma import on #endif /* These constants specify the action the IDE is asking the plugin to execute */ enum { reqInitialize = -2, /* called when the plugin is loaded */ reqTerminate = -1, /* called when the plugin is unloaded */ reqIdle = -100, /* called periodically to allow for plugin tasks EP 6/24/98 */ reqAbout = -101, /* called to ask plugin to display about dialog EP 6/24/98 */ reqPrefsChange = -102 /* called when an associated pref panel changes EP 6/24/98 */ }; /* Used in CWFileInfo.dependencyType to indicate what type of make */ /* dependency to establish between files */ typedef enum CWDependencyType { cwNoDependency, /* do not establish a dependency */ cwNormalDependency, /* recompile dependent whenever prereq changes */ cwInterfaceDependency /* recompile only if interface to file changes */ } CWDependencyType; /* Used in CWFileInfo.filedatatype to indicate the type of data in a loaded file */ enum { cwFileTypeUnknown, /* unknown binary data */ cwFileTypeText, /* normal text file */ cwFileTypePrecompiledHeader /* cached precompiled header */ }; /* constant for CWFileInfo.isdependentoffile */ #define kCurrentCompiledFile -1L /* constant for CWStorePluginData/CWGetPluginData */ #define kTargetGlobalPluginData -1L /* constant for CWNewProjectEntryInfo link order, segment, and overlay values */ #define kDefaultLinkPosition -1L /* Selectors for CWFindLogicalDirectory */ enum { kIDEDirectorySelector = 1, /* parent directory of IDE application; "bin" folder on Win32 */ kCodeWarriorDirectorySelector, /* root CodeWarrior directory */ kSystemDirectorySelector, /* system directory */ kProjectDirectorySelector, /* parent directory of current project */ kProjectDataDirectorySelector, /* project data directory */ kTargetDataDirectorySelector, /* target data directory (within project data directory) */ kTargetObjectCodeDirectorySelector, /* object code directory (within target data directory) */ kDebuggerCacheDirectorySelector, /* "CW Debugging Cache" directory */ kHelperAppsDirectorySelector, /* "(Helper Apps)" directory */ kPluginsDirectorySelector, /* "CodeWarrior Plugins" (Mac) or "plugins" (Win32) directory */ kPluginParentDirectorySelector, /* parent directory of current plugin */ kStationeryDirectorySelector, /* "(Project Stationery)" directory */ kRADStationeryDirectorySelector, /* "RAD Stationery" directory */ kLocalizedResourcesDirectorySelector /* "resources" directory */ }; /* CWPluginContext is a magic cookie passed to all plugins. It must */ /* be passed back to all IDE callbacks */ typedef struct CWPluginPrivateContext* CWPluginContext; /* CWResult is the error/status result returned by all IDE API routine. */ /* The most common errors are returned directly. For OS-specific errors, the */ /* CWResult is cwErrOSError, and the OS-specific error can be obtained by */ /* calling CWGetOSError() */ typedef SInt32 CWResult; /* CWMemHandle is an abstraction for memory used in some parts */ /* of the plugin API. API routines must be used to allocate */ /* and free CWMemHandles, or to convert them to pointers. */ typedef struct CWMemHandlePrivateStruct* CWMemHandle; /* Used to identify custom data associated by a plugin with */ /* a project file or a target as a whole. Must be a four character */ /* constant. All lower case constants are reserved by the IDE */ typedef UInt32 CWDataType; /* Some information used in the compiler/linker API is platform-dependent */ /* We use some typedefs to isolate the differences */ /* CWFileSpec contains the native platform file specifier. */ /* CWFileName contains the string type for a native file name */ /* CWFileTime contains the native platform file timestamp */ /* CWOSResult contains the native platform error return value */ /* CWResult contains an API routine error/status result */ /* CW_CALLBACK is a macro defining the calling convention and return type for */ /* IDE callback routines. */ /* CW_PLUGINENTRY is a macro defining the calling convention and return type for */ /* plugin entry points. */ /* CWSUCCESS is a macro that evaluates to true when given a CWResult indicating an */ /* routine succeeded */ #if CWPLUGIN_API == CWPLUGIN_API_MACOS typedef FSSpec CWFileSpec; typedef char CWFileName[32]; typedef UInt32 CWFileTime; typedef OSErr CWOSResult; #elif CWPLUGIN_API == CWPLUGIN_API_WIN32 typedef unsigned char Boolean; typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec; typedef char CWFileName[65]; typedef FILETIME CWFileTime; typedef DWORD CWOSResult; #elif CWPLUGIN_API == CWPLUGIN_API_UNIX #define MAX_PATH MAXPATHLEN #ifndef __MACTYPES__ typedef unsigned char Boolean; #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec; typedef char CWFileName[65]; typedef time_t CWFileTime; typedef int CWOSResult; #else #error Unknown plugin API! #endif #define CWSUCCESS(result) ((result) == 0) #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS && !defined(__MACH__) #define CW_CALLBACK pascal CWResult #define CW_CALLBACK_PTR(function_name) pascal CWResult (function_name) #define CWPLUGIN_ENTRY(function_name) pascal short (function_name) #elif CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32 #define CW_CALLBACK CWResult __stdcall #define CW_CALLBACK_PTR(function_name) CWResult (__stdcall function_name) #define CWPLUGIN_ENTRY(function_name) short (__stdcall function_name) #elif CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX || defined(__MACH__) #define CW_CALLBACK CWResult #define CW_CALLBACK_PTR(function_name) CWResult (function_name) #define CWPLUGIN_ENTRY(function_name) short (function_name) #else #error Unknown plugin host! #endif /* information returned by CWFindAndLoadFile */ typedef struct CWFileInfo { Boolean fullsearch; /* [<-] do we do a full search of paths for file */ char dependencyType; /* [<-] type CWDependencyType */ SInt32 isdependentoffile; /* [<-] this file is a dependent of file id */ /* (zero based) or -1L if of current file */ Boolean suppressload; /* [<-] find but don't load the file */ Boolean padding; /* [**] structure padding */ const char* filedata; /* [->] point to the file text/data, or NULL */ SInt32 filedatalength; /* [->] length of filedata */ short filedatatype; /* [->] type of data pointed to by filedata */ /* the remaining members are valid only when called by compilers */ short fileID; /* [->] use in browse records and dependencies */ CWFileSpec filespec; /* [->] specifies the file on disk */ Boolean alreadyincluded; /* [->] TRUE if already included in current compile */ Boolean recordbrowseinfo; /* [->] record browse info for this file? */ } CWFileInfo; /* information maintained by the IDE for each segment in the project */ typedef struct CWProjectSegmentInfo { char name[32]; /* segment name */ short attributes; /* segment attributes */ } CWProjectSegmentInfo; /* 64 bit address */ typedef struct CWAddr64 { SInt32 lo; /* low order longword of address */ SInt32 hi; /* high order longword of address */ } CWAddr64; /* describes an overlay group, Use CWGetOverlayGroup1Info to iterate over overlay groups */ typedef struct CWOverlay1GroupInfo { char name[256]; /* overlay group name */ CWAddr64 address; /* load address */ SInt32 numoverlays; /* number of overlays in this group */ } CWOverlay1GroupInfo; /* describes an overlay, use CWGetOverlay1Info to iterate over overlays */ typedef struct CWOverlay1Info { char name[256]; /* name of this overlay */ SInt32 numfiles; /* number of files in the overlay */ } CWOverlay1Info; /* describes a file in an overlay, use CWGetOverlayFile1Info to iterate over files. Use */ /* whichfile in calls taking a file number, e.g. CWLoadObjectData or CWGetFileInfo */ typedef struct CWOverlay1FileInfo { SInt32 whichfile; /* flat file number */ } CWOverlay1FileInfo; /* * All compiler errors or warnings which occur at some specific location in some * source file are identified by a CWMessageRef structure. This structure * provides sufficient information for the development environment to locate * and display the exact position associated with a message. For each message, * the compiler provides: * * errorstring: contains a description of the error, e.g. "syntax error" * errorline: contains a subset of the text containing the error * errorlevel: indicates if the "error" is an error, warning, or informational message * CWMessageRef: further info so the IDE can perform two tasks: * - Display a summary of each message, with the "error token" * underlined within the compiler-provided errorline. This * information is provided by the tokenoffset and tokenlength * fields. If tokenLength is zero then no underlining is performed. * * - Open the file containing the error and select the full * text of the error. This information is provided by the * selectionoffset and selectionlength fields. */ typedef struct CWMessageRef { CWFileSpec sourcefile; /* file containing error */ SInt32 linenumber; /* error linenumber in file */ short tokenoffset; /* offset into errorline of token underline */ short tokenlength; /* length of error token to be underlined */ SInt32 selectionoffset; /* start of error for text selection */ SInt32 selectionlength; /* length of error for text selection */ } CWMessageRef; /* message types, used for errorlevel parameter to message routines */ enum { messagetypeInfo, /* informational only */ messagetypeWarning, /* warning message */ messagetypeError /* error message */ }; /* information maintained by the IDE for each file in the project */ typedef struct CWProjectFileInfo { CWFileSpec filespec; /* CW_FileSpec of file in project */ CWFileTime moddate; /* date source file was last modified */ short segment; /* segment number of file */ Boolean hasobjectcode; /* file has object code to be linked */ Boolean hasresources; /* file has resources to be linked */ Boolean isresourcefile; /* file -is- a resource file to be linked */ Boolean weakimport; /* file has "Import Weak" flag set */ Boolean initbefore; /* file has "Init Before" flag set */ Boolean gendebug; /* file has generate debug info on */ CWFileTime objmoddate; /* date object code was last modified */ CWFileName dropinname; /* name of dropin used to process this file */ short fileID; /* fileID to use in browse records */ Boolean recordbrowseinfo; /* record browse info for this file? */ Boolean reserved; /* reserved and used internally */ #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS /* some Macintosh-specific information */ OSType filetype; /* MacOS file type */ OSType filecreator; /* MacOS file creator */ #endif Boolean hasunitdata; /* file has associated unit data (Pascal) */ Boolean mergeintooutput; /* file has "Merge Into Output" flag set */ UInt32 unitdatadependencytag; /* dependency tag (i.e. checksum) of unit data (Pascal) */ } CWProjectFileInfo; typedef struct CWNewTextDocumentInfo { const char* documentname; /* name for new document, can be NULL */ CWMemHandle text; /* initial text for document */ Boolean markDirty; /* mark doc as needing to be saved? */ } CWNewTextDocumentInfo; typedef struct CWNewProjectEntryInfo { /* use kDefaultLinkPosition to get default link order, overlay, or segment */ SInt32 position; /* optional link order position */ SInt32 segment; /* optional segment number */ SInt32 overlayGroup; /* optional overlay group number */ SInt32 overlay; /* optional overlay number */ const char* groupPath; /* optional fully qualified path to file group */ Boolean mergeintooutput; /* set merge into output flag? */ Boolean weakimport; /* set weak import flag? */ Boolean initbefore; /* set initbefore flag? */ } CWNewProjectEntryInfo; typedef struct CWIDEInfo { unsigned short majorVersion; unsigned short minorVersion; unsigned short bugFixVersion; unsigned short buildVersion; unsigned short dropinAPIVersion; } CWIDEInfo; /* Structures for getting the list of access paths. */ /* The callback does the filtering on the host flags, so the list returned */ /* will only contain the paths that are enabled for the host platform. */ /* There are separate APIs to get the Mac OS X framework style access paths. */ typedef enum CWAccessPathType { cwSystemPath, cwUserPath } CWAccessPathType; typedef struct CWAccessPathInfo { CWFileSpec pathSpec; Boolean recursive; SInt32 subdirectoryCount; } CWAccessPathInfo; typedef struct CWAccessPathListInfo { SInt32 systemPathCount; SInt32 userPathCount; Boolean alwaysSearchUserPaths; Boolean convertPaths; } CWAccessPathListInfo; /* Structures for getting the list of Mac OS X framework access paths. */ /* The callback does the filtering on the host flags, so the list returned */ /* will only contain the Mac OS X framework style paths that are enabled for */ /* the host platform. */ /* There are separate APIs to get the traditional style access paths. */ typedef struct CWFrameworkAccessPathInfo { CWFileSpec pathSpec; Boolean framework; } CWFrameworkAccessPathInfo; typedef struct CWFrameworkAccessPathListInfo { SInt32 systemPathCount; SInt32 userPathCount; Boolean alwaysSearchUserPaths; Boolean convertPaths; Boolean requireFrameworkIncludes; } CWFrameworkAccessPathListInfo; /* constants for different types of plugins */ /* Used in the dropintype in the DropInFlags, as well as for the MacOS file type */ enum { CWDROPINLINKERTYPE = CWFOURCHAR('L','i','n','k'), /* type for DropIn linkers */ CWDROPINCOMPILERTYPE= CWFOURCHAR('C','o','m','p'), /* type for DropIn compilers */ CWDROPINPREFSTYPE = CWFOURCHAR('P','a','n','L'), /* type for DropIn panels */ CWDROPINPREFSTYPE_1 = CWFOURCHAR('P','a','n','l'), /* type for 1.x IDE DropIn panels */ CWDROPINVCSTYPE = CWFOURCHAR('V','C','S',' '), /* type for DropIn version control */ CWDROPINCOMTYPE = CWFOURCHAR('C','O','M',' ') /* type for COM-only plugins */ }; typedef SInt32 CWPluginType; // one of the above types /* Format of 'Flag' resources, or data returned by dropin's GetDropinFlags entry */ /* point. */ /* */ /* For the version 2 of these resource, we renamed the 'apiversion' field to */ /* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */ /* This allows plugins to support more than one API version and therefore run */ /* under more than one version of the IDE. The CWGetAPIVersion call should be used */ /* to determine what API version the IDE is using to talk to a plugin. */ #define kCurrentDropInFlagsVersion 2 typedef struct DropInFlagsV1 { short rsrcversion; /* version number of resource */ CWDataType dropintype; /* dropin type (compiler, panel, etc) */ /* earliest API support by this plugin */ unsigned short earliestCompatibleAPIVersion; UInt32 dropinflags; /* capability flags */ CWDataType edit_language; /* language */ } DropInFlagsV1, **DropInFlagsHandleV1; typedef struct DropInFlags { short rsrcversion; /* version number of resource */ CWDataType dropintype; /* dropin type (compiler, panel, etc) */ /* earliest API support by this plugin */ unsigned short earliestCompatibleAPIVersion; UInt32 dropinflags; /* capability flags */ CWDataType edit_language; /* language */ unsigned short newestAPIVersion; /* newest API version supported */ } DropInFlags, **DropInFlagsHandle; #define kCurrentCWPanelListVersion 1 typedef struct CWPanelList { short version; short count; const char** names; } CWPanelList; #define kCurrentCWFamilyListVersion 1 #define kCurrentCWFamilyResourceVersion 1 typedef struct CWFamily { CWDataType type; const char* name; } CWFamily; typedef struct CWFamilyList { short version; short count; CWFamily* families; } CWFamilyList; typedef struct CWFamilyResource { short version; CWDataType type; unsigned char name[64]; } CWFamilyResource; #define kCurrentCWHelpInfoVersion 1 typedef struct CWHelpInfo { short version; const char* helpFileName; } CWHelpInfo; #define kCurrentCWRelativePathVersion 1 typedef enum CWRelativePathFormat { format_Generic = 0, // Simple name, not platform-specific format_Mac, // Uses : as separator :: for parent directory format_Win, // Uses \ as separator .. for parent directory format_Unix // Uses / as separator .. for parent directory } CWRelativePathFormat; typedef enum CWRelativePathTypes { type_Absolute = 0, type_Project, type_Compiler, type_System, type_UserDefined } CWRelativePathTypes; typedef struct CWRelativePath { short version; // version number unsigned char pathType; // use CWRelativePathTypes unsigned char pathFormat; // use CWRelativePathFormat char userDefinedTree[256]; // user-defined tree name char pathString[512]; // actual path string } CWRelativePath; /* * */ #define kCurrentCWPluginInfoVersion 1 typedef struct CWPluginInfo { short version; // struct version number const char* companyName; // i.e. Metrowerks const char* pluginName; // Defaults to Dropin->GetName() const char* pluginDisplayName; const char* familyName; // i.e. Java unsigned short majorIDEVersion; // Version of IDE Required unsigned short minorIDEVersion; } CWPluginInfo; /* Declaration of plugin entry points that must be implemented by non-MacOS plugins */ /* It can also be implemented for MacOS plugins instead of having a 'Flag' resource */ CWPLUGIN_ENTRY (CWPlugin_GetDropInFlags)(const DropInFlags**, SInt32* flagsSize); /* Declaration of plugin entry points that may optionally be implemented by plugins */ /* These entry points override the corresponding resources on MacOS */ CWPLUGIN_ENTRY (CWPlugin_GetDropInName)(const char** dropInName); CWPLUGIN_ENTRY (CWPlugin_GetDisplayName)(const char** displayName); CWPLUGIN_ENTRY (CWPlugin_GetPanelList)(const CWPanelList** panelList); CWPLUGIN_ENTRY (CWPlugin_GetFamilyList)(const CWFamilyList** familyList); CWPLUGIN_ENTRY (CWPlugin_GetHelpInfo)(const CWHelpInfo** helpInfo); /* Declaration of info plugin entry point that must be implemented by all COM plugins */ CWPLUGIN_ENTRY (CWPlugin_GetPluginInfo)(const CWPluginInfo** pluginInfo); /* Callback declarations: these callbacks are supported for all CodeWarrior plugins */ /* Get the action the IDE is requesting of the plugin */ CW_CALLBACK CWGetPluginRequest(CWPluginContext context, SInt32* request); /* Call when finished handling a request, just before returning to the shell */ CW_CALLBACK CWDonePluginRequest(CWPluginContext, CWResult resultCode); /* Get the version number of API used by the IDE to talk to the plugin */ CW_CALLBACK CWGetAPIVersion(CWPluginContext context, SInt32* version); /* Get information about the IDE being used */ CW_CALLBACK CWGetIDEInfo(CWPluginContext context, CWIDEInfo* info); /* Get the OS error associated with the last callback */ CW_CALLBACK CWGetCallbackOSError(CWPluginContext context, CWOSResult* error); /* Set the OS error associated with a failed plugin request */ CW_CALLBACK CWSetPluginOSError(CWPluginContext context, CWOSResult); /* Get the file specifier for the current project */ CW_CALLBACK CWGetProjectFile(CWPluginContext context, CWFileSpec* projectSpec); /* Get the directory where the IDE stores target-specific generated data */ CW_CALLBACK CWGetTargetDataDirectory(CWPluginContext context, CWFileSpec* targetDataDirectorySpec); /* Get the name of the current target in the current project */ CW_CALLBACK CWGetTargetName(CWPluginContext context, char* name, short maxLength); /* Get the directory where output files should be stored */ CW_CALLBACK CWGetOutputFileDirectory(CWPluginContext context, CWFileSpec* outputFileDirectory); /* Get the number of files in the current project */ CW_CALLBACK CWGetProjectFileCount(CWPluginContext context, SInt32* count); /* Get information about a particular file in the project */ CW_CALLBACK CWGetFileInfo(CWPluginContext context, SInt32 whichfile, Boolean checkFileLocation, CWProjectFileInfo* fileinfo); /* Search for a file by name on the current file's access paths. */ CW_CALLBACK CWFindAndLoadFile(CWPluginContext context, const char* filename, CWFileInfo *fileinfo); /* Get the access paths for the current target */ CW_CALLBACK CWGetAccessPathListInfo(CWPluginContext context, CWAccessPathListInfo* pathListInfo); CW_CALLBACK CWGetAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWAccessPathInfo* pathInfo); CW_CALLBACK CWGetAccessPathSubdirectory(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, SInt32 whichSubdirectory, CWFileSpec* subdirectory); CW_CALLBACK CWGetFrameworkAccessPathListInfo(CWPluginContext context, CWFrameworkAccessPathListInfo* pathListInfo); CW_CALLBACK CWGetFrameworkAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWFrameworkAccessPathInfo* pathInfo); /* Get file text, from the editor, include file cache, or by reading the file */ CW_CALLBACK CWGetFileText(CWPluginContext context, const CWFileSpec* filespec, const char** text, SInt32* textLength, short* filedatatype); /* Release file text returned by CWFindAndLoadFile and CWGetFileText */ CW_CALLBACK CWReleaseFileText(CWPluginContext context, const char* text); /* Get information about a project segment */ CW_CALLBACK CWGetSegmentInfo(CWPluginContext context, SInt32 whichsegment, CWProjectSegmentInfo* segmentinfo); /* Get the number of overlay groups in the target */ CW_CALLBACK CWGetOverlay1GroupsCount(CWPluginContext context, SInt32* count); /* Get information about a project overlay group */ CW_CALLBACK CWGetOverlay1GroupInfo(CWPluginContext context, SInt32 whichgroup, CWOverlay1GroupInfo* groupinfo); /* Get information about an overlay within a group */ CW_CALLBACK CWGetOverlay1Info(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, CWOverlay1Info* overlayinfo); /* Get information about a file in an overlay */ CW_CALLBACK CWGetOverlay1FileInfo(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, SInt32 whichoverlayfile, CWOverlay1FileInfo* fileinfo); /* Report a error, warning, or informational message */ CW_CALLBACK CWReportMessage(CWPluginContext context, const CWMessageRef* msgRef, const char *line1, const char *line2, short errorlevel, SInt32 errorNumber); /* Display an alert. May actually be put in a message, depending on the plugin request */ CW_CALLBACK CWAlert(CWPluginContext context, const char* msg1, const char* msg2, const char* msg3, const char* msg4); /* Display one or two status messages to the user */ CW_CALLBACK CWShowStatus(CWPluginContext context, const char *line1, const char *line2); /* Give to the IDE to handle events and check if user has canceled this operation */ CW_CALLBACK CWUserBreak(CWPluginContext context); /* Return stored preference data, referenced by name. Typically used for preference */ /* panel settings. */ CW_CALLBACK CWGetNamedPreferences(CWPluginContext context, const char* prefsname, CWMemHandle* prefsdata); /* Store data referenced by a data type and file number */ CW_CALLBACK CWStorePluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle prefsdata); /* Return stored data referenced by a data type and file number */ CW_CALLBACK CWGetPluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle* prefsdata); /* Inform the IDE that a file modification date has changed. isGenerated is for use */ /* by compiler and linker plugins only */ CW_CALLBACK CWSetModDate(CWPluginContext context, const CWFileSpec* filespec, CWFileTime* moddate, Boolean isGenerated); /* Ask the IDE to add a file to the current target in the current project. isGenerated */ /* is for use by compiler plugins only. */ CW_CALLBACK CWAddProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec, Boolean isGenerated, const CWNewProjectEntryInfo* projectEntryInfo, SInt32* whichfile); /* Ask the IDE to remove a file from the current target (link-order/segment/overlay) in the current project. */ /* If it's the last target that contains the file, it would be removed from the file list. */ CW_CALLBACK CWRemoveProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec); /* Create a new editor window, supplying initial text and an optional document name */ CW_CALLBACK CWCreateNewTextDocument(CWPluginContext, const CWNewTextDocumentInfo* docinfo); /* Allocate memory. Permanent memory is not freed until the plugin is unloaded. */ /* Temporary memory is freed after each plugin request completes. */ CW_CALLBACK CWAllocateMemory(CWPluginContext context, SInt32 size, Boolean isPermanent, void** ptr); /* Free memory allocated via CWAllocateMemory */ CW_CALLBACK CWFreeMemory(CWPluginContext context, void* ptr, Boolean isPermanent); /* Allocate a memory handle of the requested size. All handles are automatically */ /* freed at the end of each compiler/linker request. useTempMemory is MacOS-specific*/ CW_CALLBACK CWAllocMemHandle(CWPluginContext context, SInt32 size, Boolean useTempMemory, CWMemHandle* handle); /* Free a memory handle */ CW_CALLBACK CWFreeMemHandle(CWPluginContext context, CWMemHandle handle); /* Return the current size of a memory handle */ CW_CALLBACK CWGetMemHandleSize(CWPluginContext context, CWMemHandle handle, SInt32* size); /* Resize an existing memory handle */ CW_CALLBACK CWResizeMemHandle(CWPluginContext context, CWMemHandle handle, SInt32 newSize); /* To obtain a pointer to the block, you must lock the handle */ /* moveHi is MacOS-specific */ CW_CALLBACK CWLockMemHandle(CWPluginContext context, CWMemHandle handle, Boolean moveHi, void** ptr); /* Unlock a memory handle, the pointer returned by locking the handle may no */ /* longer be valid */ CW_CALLBACK CWUnlockMemHandle(CWPluginContext context, CWMemHandle handle); #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS /* Utility function to map MacOS error codes to a CWResult code. Plugins */ /* may internally generate OSErrs, but need to return CWResult to the */ /* CodeWarrior IDE */ CW_CALLBACK CWMacOSErrToCWResult(CWPluginContext context, OSErr err); #endif /* Turn off the built in PP window manager while the plugin displays a dialog */ CW_CALLBACK CWPreDialog(CWPluginContext context); /* Turn on the built in PP window manager after the plugin is through with its */ /* dialog */ CW_CALLBACK CWPostDialog(CWPluginContext context); /* Notify the IDE that the plugin will be performing actions on a file */ CW_CALLBACK CWPreFileAction(CWPluginContext context, const CWFileSpec *theFile); /* Notify the IDE that the plugin is finished performing actions on a file */ CW_CALLBACK CWPostFileAction(CWPluginContext context, const CWFileSpec *theFile); CW_CALLBACK CWResolveRelativePath(CWPluginContext context, const CWRelativePath* relativePath, CWFileSpec* fileSpec, Boolean create); CW_CALLBACK CWFindLogicalDirectory(CWPluginContext context, SInt32 selector, CWFileSpec *dirSpec); CW_CALLBACK CWOpenFileInEditor(CWPluginContext context, const CWFileSpec *fileSpec); #if CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX /* Forward declarations */ struct ICodeWarriorApp; struct ICodeWarriorProject; struct ICodeWarriorDesign; struct ICodeWarriorTarget; #endif /* CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX */ /* Get the IDE application COM interface. Fails if called from any thread */ /* other than the main IDE thread, e.g. a build thread. */ CW_CALLBACK CWGetCOMApplicationInterface(CWPluginContext context, struct ICodeWarriorApp **app); /* Get the current project COM interface. Adds a reference upon return. */ /* Only succeeds if the plugin is being called in the context of a */ /* particular project. Fails if called from any thread */ /* other than the main IDE thread, e.g. a build thread. */ CW_CALLBACK CWGetCOMProjectInterface(CWPluginContext context, struct ICodeWarriorProject **project); /* Get the current design COM interface. Adds a reference upon return. */ /* Only succeeds if the plugin is being called in the context of a */ /* particular target that is associated with a design. */ /* Fails if called from any thread other than the main IDE thread, */ /* e.g. a build thread. */ CW_CALLBACK CWGetCOMDesignInterface(CWPluginContext context, struct ICodeWarriorDesign **design); /* Get the current target COM interface. Adds a reference upon return. */ /* Only succeeds if the plugin is being called in the context of a */ /* particular target. Fails if called from any thread */ /* other than the main IDE thread, e.g. a build thread. */ CW_CALLBACK CWGetCOMTargetInterface(CWPluginContext context, struct ICodeWarriorTarget **target); #if CW_USE_PRAGMA_IMPORT #pragma import reset #endif #ifdef __cplusplus } #endif #ifdef _MSC_VER #pragma pack(pop) #endif #ifdef __MWERKS__ #pragma options align=reset #endif #endif /* __CWPlugins_H__ */ \ No newline at end of file +/* + * CWPlugins.h - Common declarations for Metrowerks CodeWarrior� plugins + * + * Copyright � 1995-1997 Metrowerks, Inc. All rights reserved. + * + */ + +#include "common.h" + +#ifndef __CWPlugins_H__ +#define __CWPlugins_H__ + +#ifdef __MWERKS__ +# pragma once +#endif + +#define CWPLUGIN_HOST_MACOS 1 +#define CWPLUGIN_HOST_WIN32 2 +#define CWPLUGIN_HOST_SOLARIS 3 +#define CWPLUGIN_HOST_LINUX 4 + +// This seems to always be true for command-line tools +#define CWPLUGIN_HOST CWPLUGIN_HOST_MACOS + +//#ifndef CWPLUGIN_HOST +//# ifdef WIN32 +//# define CWPLUGIN_HOST CWPLUGIN_HOST_WIN32 +//# elif defined(macintosh) +//# define CWPLUGIN_HOST CWPLUGIN_HOST_MACOS +//# elif defined(__sun__) +//# define CWPLUGIN_HOST CWPLUGIN_HOST_SOLARIS +//# elif defined(__linux__) +//# define CWPLUGIN_HOST CWPLUGIN_HOST_LINUX +//# else +//# error +//# endif +//#endif + +#define CWPLUGIN_API_MACOS 1 +#define CWPLUGIN_API_WIN32 2 +#define CWPLUGIN_API_UNIX 3 + +//#ifndef CWPLUGIN_API +//# ifdef WIN32 +//# define CWPLUGIN_API CWPLUGIN_API_WIN32 +//# elif defined(macintosh) +//# define CWPLUGIN_API CWPLUGIN_API_MACOS +//# elif defined(__sun__) || defined(__linux__) +//# define CWPLUGIN_API CWPLUGIN_API_UNIX +//# else +//# error +//# endif +//#endif + +// This seems to always be true for command-line tools +#define CWPLUGIN_API CWPLUGIN_API_MACOS + +/* +** Radix 256 notation where a 32-bit integer is created from four +** ASCII characters. A four-character constant of this form, say +** 'ABCD', must always be represented with the same pattern, 0x41424344 +** in this case, regardless of big/little endian issues. +*/ +typedef SInt32 CWFourCharType; +#define CWFOURCHAR(a, b, c, d) \ + (((CWFourCharType) ((a) & 0xff) << 24) \ + | ((CWFourCharType) ((b) & 0xff) << 16) \ + | ((CWFourCharType) ((c) & 0xff) << 8) \ + | ((CWFourCharType) ((d) & 0xff))) + + +#if CWPLUGIN_API == CWPLUGIN_API_UNIX +#include +#endif + +#ifndef CW_USE_PRAGMA_EXPORT +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS +#define CW_USE_PRAGMA_EXPORT 1 +#else +#define CW_USE_PRAGMA_EXPORT 0 +#endif +#endif + +#ifndef CW_USE_PRAGMA_IMPORT +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS +#define CW_USE_PRAGMA_IMPORT 1 +#else +#define CW_USE_PRAGMA_IMPORT 0 +#endif +#endif + +#ifdef __MWERKS__ + #pragma options align=mac68k +#endif + +#ifdef _MSC_VER + #pragma pack(push,2) +#endif + + +#ifdef __cplusplus + extern "C" { +#endif + +#if CW_USE_PRAGMA_IMPORT +#pragma import on +#endif + + /* These constants specify the action the IDE is asking the plugin to execute */ +enum { + reqInitialize = -2, /* called when the plugin is loaded */ + reqTerminate = -1, /* called when the plugin is unloaded */ + reqIdle = -100, /* called periodically to allow for plugin tasks EP 6/24/98 */ + reqAbout = -101, /* called to ask plugin to display about dialog EP 6/24/98 */ + reqPrefsChange = -102 /* called when an associated pref panel changes EP 6/24/98 */ +}; + + /* Used in CWFileInfo.dependencyType to indicate what type of make */ + /* dependency to establish between files */ +typedef enum CWDependencyType { + cwNoDependency, /* do not establish a dependency */ + cwNormalDependency, /* recompile dependent whenever prereq changes */ + cwInterfaceDependency /* recompile only if interface to file changes */ +} CWDependencyType; + + /* Used in CWFileInfo.filedatatype to indicate the type of data in a loaded file */ +enum { + cwFileTypeUnknown, /* unknown binary data */ + cwFileTypeText, /* normal text file */ + cwFileTypePrecompiledHeader /* cached precompiled header */ +}; + + /* constant for CWFileInfo.isdependentoffile */ +#define kCurrentCompiledFile -1L + + /* constant for CWStorePluginData/CWGetPluginData */ +#define kTargetGlobalPluginData -1L + + /* constant for CWNewProjectEntryInfo link order, segment, and overlay values */ +#define kDefaultLinkPosition -1L + + /* Selectors for CWFindLogicalDirectory */ +enum { + kIDEDirectorySelector = 1, /* parent directory of IDE application; "bin" folder on Win32 */ + kCodeWarriorDirectorySelector, /* root CodeWarrior directory */ + kSystemDirectorySelector, /* system directory */ + kProjectDirectorySelector, /* parent directory of current project */ + kProjectDataDirectorySelector, /* project data directory */ + kTargetDataDirectorySelector, /* target data directory (within project data directory) */ + kTargetObjectCodeDirectorySelector, /* object code directory (within target data directory) */ + kDebuggerCacheDirectorySelector, /* "CW Debugging Cache" directory */ + kHelperAppsDirectorySelector, /* "(Helper Apps)" directory */ + kPluginsDirectorySelector, /* "CodeWarrior Plugins" (Mac) or "plugins" (Win32) directory */ + kPluginParentDirectorySelector, /* parent directory of current plugin */ + kStationeryDirectorySelector, /* "(Project Stationery)" directory */ + kRADStationeryDirectorySelector, /* "RAD Stationery" directory */ + kLocalizedResourcesDirectorySelector /* "resources" directory */ +}; + + + /* CWPluginContext is a magic cookie passed to all plugins. It must */ + /* be passed back to all IDE callbacks */ + +typedef struct CWPluginPrivateContext* CWPluginContext; + + /* CWResult is the error/status result returned by all IDE API routine. */ + /* The most common errors are returned directly. For OS-specific errors, the */ + /* CWResult is cwErrOSError, and the OS-specific error can be obtained by */ + /* calling CWGetOSError() */ +typedef SInt32 CWResult; + + /* CWMemHandle is an abstraction for memory used in some parts */ + /* of the plugin API. API routines must be used to allocate */ + /* and free CWMemHandles, or to convert them to pointers. */ + +typedef struct CWMemHandlePrivateStruct* CWMemHandle; + + /* Used to identify custom data associated by a plugin with */ + /* a project file or a target as a whole. Must be a four character */ + /* constant. All lower case constants are reserved by the IDE */ +typedef UInt32 CWDataType; + + /* Some information used in the compiler/linker API is platform-dependent */ + /* We use some typedefs to isolate the differences */ + /* CWFileSpec contains the native platform file specifier. */ + /* CWFileName contains the string type for a native file name */ + /* CWFileTime contains the native platform file timestamp */ + /* CWOSResult contains the native platform error return value */ + /* CWResult contains an API routine error/status result */ + /* CW_CALLBACK is a macro defining the calling convention and return type for */ + /* IDE callback routines. */ + /* CW_PLUGINENTRY is a macro defining the calling convention and return type for */ + /* plugin entry points. */ + /* CWSUCCESS is a macro that evaluates to true when given a CWResult indicating an */ + /* routine succeeded */ + +#if CWPLUGIN_API == CWPLUGIN_API_MACOS + +typedef FSSpec CWFileSpec; +typedef char CWFileName[32]; +typedef UInt32 CWFileTime; +typedef OSErr CWOSResult; + +#elif CWPLUGIN_API == CWPLUGIN_API_WIN32 + +typedef unsigned char Boolean; +typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec; +typedef char CWFileName[65]; +typedef FILETIME CWFileTime; +typedef DWORD CWOSResult; + +#elif CWPLUGIN_API == CWPLUGIN_API_UNIX + +#define MAX_PATH MAXPATHLEN + +#ifndef __MACTYPES__ +typedef unsigned char Boolean; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +typedef struct CWFileSpec { char path[MAX_PATH]; } CWFileSpec; +typedef char CWFileName[65]; +typedef time_t CWFileTime; +typedef int CWOSResult; + +#else + +#error Unknown plugin API! + +#endif + +#define CWSUCCESS(result) ((result) == 0) + +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS + +#define CW_CALLBACK CW_PASCAL CWResult +#define CW_CALLBACK_PTR(function_name) CW_PASCAL CWResult (function_name) +#define CWPLUGIN_ENTRY(function_name) CW_PASCAL short (function_name) + +#elif CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32 + +#define CW_CALLBACK CWResult __stdcall +#define CW_CALLBACK_PTR(function_name) CWResult (__stdcall function_name) +#define CWPLUGIN_ENTRY(function_name) short (__stdcall function_name) + +#elif CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX + +#define CW_CALLBACK CWResult +#define CW_CALLBACK_PTR(function_name) CWResult (function_name) +#define CWPLUGIN_ENTRY(function_name) short (function_name) + +#else + +#error Unknown plugin host! + +#endif + +/* information returned by CWFindAndLoadFile */ +typedef struct CWFileInfo { + Boolean fullsearch; /* [<-] do we do a full search of paths for file */ + char dependencyType; /* [<-] type CWDependencyType */ + SInt32 isdependentoffile; /* [<-] this file is a dependent of file id */ + /* (zero based) or -1L if of current file */ + Boolean suppressload; /* [<-] find but don't load the file */ + Boolean padding; /* [**] structure padding */ + const char* filedata; /* [->] point to the file text/data, or NULL */ + SInt32 filedatalength; /* [->] length of filedata */ + short filedatatype; /* [->] type of data pointed to by filedata */ + + /* the remaining members are valid only when called by compilers */ + short fileID; /* [->] use in browse records and dependencies */ + CWFileSpec filespec; /* [->] specifies the file on disk */ + Boolean alreadyincluded; /* [->] TRUE if already included in current compile */ + Boolean recordbrowseinfo; /* [->] record browse info for this file? */ +} CWFileInfo; + +/* information maintained by the IDE for each segment in the project */ +typedef struct CWProjectSegmentInfo { + char name[32]; /* segment name */ + short attributes; /* segment attributes */ +} CWProjectSegmentInfo; + +/* 64 bit address */ +typedef struct CWAddr64 { + SInt32 lo; /* low order longword of address */ + SInt32 hi; /* high order longword of address */ +} CWAddr64; + +/* describes an overlay group, Use CWGetOverlayGroup1Info to iterate over overlay groups */ +typedef struct CWOverlay1GroupInfo { + char name[256]; /* overlay group name */ + CWAddr64 address; /* load address */ + SInt32 numoverlays; /* number of overlays in this group */ + +} CWOverlay1GroupInfo; + +/* describes an overlay, use CWGetOverlay1Info to iterate over overlays */ +typedef struct CWOverlay1Info { + char name[256]; /* name of this overlay */ + SInt32 numfiles; /* number of files in the overlay */ +} CWOverlay1Info; + +/* describes a file in an overlay, use CWGetOverlayFile1Info to iterate over files. Use */ +/* whichfile in calls taking a file number, e.g. CWLoadObjectData or CWGetFileInfo */ +typedef struct CWOverlay1FileInfo { + SInt32 whichfile; /* flat file number */ +} CWOverlay1FileInfo; + +/* + * All compiler errors or warnings which occur at some specific location in some + * source file are identified by a CWMessageRef structure. This structure + * provides sufficient information for the development environment to locate + * and display the exact position associated with a message. For each message, + * the compiler provides: + * + * errorstring: contains a description of the error, e.g. "syntax error" + * errorline: contains a subset of the text containing the error + * errorlevel: indicates if the "error" is an error, warning, or informational message + * CWMessageRef: further info so the IDE can perform two tasks: + + * - Display a summary of each message, with the "error token" + * underlined within the compiler-provided errorline. This + * information is provided by the tokenoffset and tokenlength + * fields. If tokenLength is zero then no underlining is performed. + * + * - Open the file containing the error and select the full + * text of the error. This information is provided by the + * selectionoffset and selectionlength fields. + */ + +typedef struct CWMessageRef +{ + CWFileSpec sourcefile; /* file containing error */ + SInt32 linenumber; /* error linenumber in file */ + short tokenoffset; /* offset into errorline of token underline */ + short tokenlength; /* length of error token to be underlined */ + SInt32 selectionoffset; /* start of error for text selection */ + SInt32 selectionlength; /* length of error for text selection */ +} CWMessageRef; + +/* message types, used for errorlevel parameter to message routines */ +enum { + messagetypeInfo, /* informational only */ + messagetypeWarning, /* warning message */ + messagetypeError /* error message */ +}; + + +/* information maintained by the IDE for each file in the project */ +typedef struct CWProjectFileInfo +{ + CWFileSpec filespec; /* CW_FileSpec of file in project */ + CWFileTime moddate; /* date source file was last modified */ + short segment; /* segment number of file */ + Boolean hasobjectcode; /* file has object code to be linked */ + Boolean hasresources; /* file has resources to be linked */ + Boolean isresourcefile; /* file -is- a resource file to be linked */ + Boolean weakimport; /* file has "Import Weak" flag set */ + Boolean initbefore; /* file has "Init Before" flag set */ + Boolean gendebug; /* file has generate debug info on */ + CWFileTime objmoddate; /* date object code was last modified */ + CWFileName dropinname; /* name of dropin used to process this file */ + short fileID; /* fileID to use in browse records */ + Boolean recordbrowseinfo; /* record browse info for this file? */ + Boolean reserved; /* reserved and used internally */ +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS + /* some Macintosh-specific information */ + OSType filetype; /* MacOS file type */ + OSType filecreator; /* MacOS file creator */ +#endif + Boolean hasunitdata; /* file has associated unit data (Pascal) */ + Boolean mergeintooutput; /* file has "Merge Into Output" flag set */ + UInt32 unitdatadependencytag; /* dependency tag (i.e. checksum) of unit data (Pascal) */ +} CWProjectFileInfo; + +typedef struct CWNewTextDocumentInfo +{ + const char* documentname; /* name for new document, can be NULL */ + CWMemHandle text; /* initial text for document */ + Boolean markDirty; /* mark doc as needing to be saved? */ +} CWNewTextDocumentInfo; + +typedef struct CWNewProjectEntryInfo +{ /* use kDefaultLinkPosition to get default link order, overlay, or segment */ + SInt32 position; /* optional link order position */ + SInt32 segment; /* optional segment number */ + SInt32 overlayGroup; /* optional overlay group number */ + SInt32 overlay; /* optional overlay number */ + const char* groupPath; /* optional fully qualified path to file group */ + Boolean mergeintooutput; /* set merge into output flag? */ + Boolean weakimport; /* set weak import flag? */ + Boolean initbefore; /* set initbefore flag? */ +} CWNewProjectEntryInfo; + +typedef struct CWIDEInfo +{ + unsigned short majorVersion; + unsigned short minorVersion; + unsigned short bugFixVersion; + unsigned short buildVersion; + unsigned short dropinAPIVersion; +} CWIDEInfo; + +/* Structures for getting the list of access paths. */ +/* The callback does the filtering on the host flags, so the list returned */ +/* will only contain the paths that are enabled for the host platform. */ +/* There are separate APIs to get the Mac OS X framework style access paths. */ + +typedef enum CWAccessPathType { + cwSystemPath, + cwUserPath +} CWAccessPathType; + +typedef struct CWAccessPathInfo +{ + CWFileSpec pathSpec; + Boolean recursive; + SInt32 subdirectoryCount; +} CWAccessPathInfo; + +typedef struct CWAccessPathListInfo +{ + SInt32 systemPathCount; + SInt32 userPathCount; + Boolean alwaysSearchUserPaths; + Boolean convertPaths; +} CWAccessPathListInfo; + +/* Structures for getting the list of Mac OS X framework access paths. */ +/* The callback does the filtering on the host flags, so the list returned */ +/* will only contain the Mac OS X framework style paths that are enabled for */ +/* the host platform. */ +/* There are separate APIs to get the traditional style access paths. */ + +typedef struct CWFrameworkAccessPathInfo +{ + CWFileSpec pathSpec; + Boolean framework; +} CWFrameworkAccessPathInfo; + +typedef struct CWFrameworkAccessPathListInfo +{ + SInt32 systemPathCount; + SInt32 userPathCount; + Boolean alwaysSearchUserPaths; + Boolean convertPaths; + Boolean requireFrameworkIncludes; +} CWFrameworkAccessPathListInfo; + +/* constants for different types of plugins */ +/* Used in the dropintype in the DropInFlags, as well as for the MacOS file type */ +enum +{ + CWDROPINLINKERTYPE = CWFOURCHAR('L','i','n','k'), /* type for DropIn linkers */ + CWDROPINCOMPILERTYPE= CWFOURCHAR('C','o','m','p'), /* type for DropIn compilers */ + CWDROPINPREFSTYPE = CWFOURCHAR('P','a','n','L'), /* type for DropIn panels */ + CWDROPINPREFSTYPE_1 = CWFOURCHAR('P','a','n','l'), /* type for 1.x IDE DropIn panels */ + CWDROPINVCSTYPE = CWFOURCHAR('V','C','S',' '), /* type for DropIn version control */ + CWDROPINCOMTYPE = CWFOURCHAR('C','O','M',' ') /* type for COM-only plugins */ +}; +typedef SInt32 CWPluginType; // one of the above types + +/* Format of 'Flag' resources, or data returned by dropin's GetDropinFlags entry */ +/* point. */ +/* */ +/* For the version 2 of these resource, we renamed the 'apiversion' field to */ +/* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */ +/* This allows plugins to support more than one API version and therefore run */ +/* under more than one version of the IDE. The CWGetAPIVersion call should be used */ +/* to determine what API version the IDE is using to talk to a plugin. */ + +#define kCurrentDropInFlagsVersion 2 + +typedef struct DropInFlagsV1 { + short rsrcversion; /* version number of resource */ + CWDataType dropintype; /* dropin type (compiler, panel, etc) */ + /* earliest API support by this plugin */ + unsigned short earliestCompatibleAPIVersion; + UInt32 dropinflags; /* capability flags */ + CWDataType edit_language; /* language */ + +} DropInFlagsV1, **DropInFlagsHandleV1; + +typedef struct DropInFlags { + short rsrcversion; /* version number of resource */ + CWDataType dropintype; /* dropin type (compiler, panel, etc) */ + /* earliest API support by this plugin */ + unsigned short earliestCompatibleAPIVersion; + UInt32 dropinflags; /* capability flags */ + CWDataType edit_language; /* language */ + unsigned short newestAPIVersion; /* newest API version supported */ + +} DropInFlags, **DropInFlagsHandle; + +#define kCurrentCWPanelListVersion 1 + +typedef struct CWPanelList { + short version; + short count; + const char** names; +} CWPanelList; + +#define kCurrentCWFamilyListVersion 1 +#define kCurrentCWFamilyResourceVersion 1 + +typedef struct CWFamily { + CWDataType type; + const char* name; +} CWFamily; + +typedef struct CWFamilyList { + short version; + short count; + CWFamily* families; +} CWFamilyList; + +typedef struct CWFamilyResource { + short version; + CWDataType type; + unsigned char name[64]; +} CWFamilyResource; + +#define kCurrentCWHelpInfoVersion 1 + +typedef struct CWHelpInfo { + short version; + const char* helpFileName; +} CWHelpInfo; + + +#define kCurrentCWRelativePathVersion 1 + +typedef enum CWRelativePathFormat +{ + format_Generic = 0, // Simple name, not platform-specific + format_Mac, // Uses : as separator :: for parent directory + format_Win, // Uses \ as separator .. for parent directory + format_Unix // Uses / as separator .. for parent directory + +} CWRelativePathFormat; + +typedef enum CWRelativePathTypes +{ + type_Absolute = 0, + type_Project, + type_Compiler, + type_System, + type_UserDefined +} CWRelativePathTypes; + +typedef struct CWRelativePath +{ + short version; // version number + unsigned char pathType; // use CWRelativePathTypes + unsigned char pathFormat; // use CWRelativePathFormat + char userDefinedTree[256]; // user-defined tree name + char pathString[512]; // actual path string +} CWRelativePath; + +/* + * + */ + +#define kCurrentCWPluginInfoVersion 1 + +typedef struct CWPluginInfo +{ + short version; // struct version number + const char* companyName; // i.e. Metrowerks + const char* pluginName; // Defaults to Dropin->GetName() + const char* pluginDisplayName; + const char* familyName; // i.e. Java + unsigned short majorIDEVersion; // Version of IDE Required + unsigned short minorIDEVersion; + +} CWPluginInfo; + + +/* Declaration of plugin entry points that must be implemented by non-MacOS plugins */ +/* It can also be implemented for MacOS plugins instead of having a 'Flag' resource */ + +CWPLUGIN_ENTRY (CWPlugin_GetDropInFlags)(const DropInFlags**, SInt32* flagsSize); + +/* Declaration of plugin entry points that may optionally be implemented by plugins */ +/* These entry points override the corresponding resources on MacOS */ + +CWPLUGIN_ENTRY (CWPlugin_GetDropInName)(const char** dropInName); +CWPLUGIN_ENTRY (CWPlugin_GetDisplayName)(const char** displayName); +CWPLUGIN_ENTRY (CWPlugin_GetPanelList)(const CWPanelList** panelList); +CWPLUGIN_ENTRY (CWPlugin_GetFamilyList)(const CWFamilyList** familyList); +CWPLUGIN_ENTRY (CWPlugin_GetHelpInfo)(const CWHelpInfo** helpInfo); + +/* Declaration of info plugin entry point that must be implemented by all COM plugins */ + +CWPLUGIN_ENTRY (CWPlugin_GetPluginInfo)(const CWPluginInfo** pluginInfo); + + +/* Callback declarations: these callbacks are supported for all CodeWarrior plugins */ + + /* Get the action the IDE is requesting of the plugin */ +CW_CALLBACK CWGetPluginRequest(CWPluginContext context, SInt32* request); + + /* Call when finished handling a request, just before returning to the shell */ +CW_CALLBACK CWDonePluginRequest(CWPluginContext, CWResult resultCode); + + /* Get the version number of API used by the IDE to talk to the plugin */ +CW_CALLBACK CWGetAPIVersion(CWPluginContext context, SInt32* version); + + /* Get information about the IDE being used */ +CW_CALLBACK CWGetIDEInfo(CWPluginContext context, CWIDEInfo* info); + + /* Get the OS error associated with the last callback */ +CW_CALLBACK CWGetCallbackOSError(CWPluginContext context, CWOSResult* error); + + /* Set the OS error associated with a failed plugin request */ +CW_CALLBACK CWSetPluginOSError(CWPluginContext context, CWOSResult); + + /* Get the file specifier for the current project */ +CW_CALLBACK CWGetProjectFile(CWPluginContext context, CWFileSpec* projectSpec); + + /* Get the directory where the IDE stores target-specific generated data */ +CW_CALLBACK CWGetTargetDataDirectory(CWPluginContext context, CWFileSpec* targetDataDirectorySpec); + + /* Get the name of the current target in the current project */ +CW_CALLBACK CWGetTargetName(CWPluginContext context, char* name, short maxLength); + + /* Get the directory where output files should be stored */ +CW_CALLBACK CWGetOutputFileDirectory(CWPluginContext context, CWFileSpec* outputFileDirectory); + + /* Get the number of files in the current project */ +CW_CALLBACK CWGetProjectFileCount(CWPluginContext context, SInt32* count); + + /* Get information about a particular file in the project */ +CW_CALLBACK CWGetFileInfo(CWPluginContext context, SInt32 whichfile, Boolean checkFileLocation, CWProjectFileInfo* fileinfo); + + /* Search for a file by name on the current file's access paths. */ +CW_CALLBACK CWFindAndLoadFile(CWPluginContext context, const char* filename, CWFileInfo *fileinfo); + + /* Get the access paths for the current target */ +CW_CALLBACK CWGetAccessPathListInfo(CWPluginContext context, CWAccessPathListInfo* pathListInfo); +CW_CALLBACK CWGetAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWAccessPathInfo* pathInfo); +CW_CALLBACK CWGetAccessPathSubdirectory(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, SInt32 whichSubdirectory, CWFileSpec* subdirectory); +CW_CALLBACK CWGetFrameworkAccessPathListInfo(CWPluginContext context, CWFrameworkAccessPathListInfo* pathListInfo); +CW_CALLBACK CWGetFrameworkAccessPathInfo(CWPluginContext context, CWAccessPathType pathType, SInt32 whichPath, CWFrameworkAccessPathInfo* pathInfo); + + /* Get file text, from the editor, include file cache, or by reading the file */ +CW_CALLBACK CWGetFileText(CWPluginContext context, const CWFileSpec* filespec, const char** text, SInt32* textLength, short* filedatatype); + + /* Release file text returned by CWFindAndLoadFile and CWGetFileText */ +CW_CALLBACK CWReleaseFileText(CWPluginContext context, const char* text); + + /* Get information about a project segment */ +CW_CALLBACK CWGetSegmentInfo(CWPluginContext context, SInt32 whichsegment, CWProjectSegmentInfo* segmentinfo); + + /* Get the number of overlay groups in the target */ +CW_CALLBACK CWGetOverlay1GroupsCount(CWPluginContext context, SInt32* count); + + /* Get information about a project overlay group */ +CW_CALLBACK CWGetOverlay1GroupInfo(CWPluginContext context, SInt32 whichgroup, CWOverlay1GroupInfo* groupinfo); + + /* Get information about an overlay within a group */ +CW_CALLBACK CWGetOverlay1Info(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, CWOverlay1Info* overlayinfo); + + /* Get information about a file in an overlay */ +CW_CALLBACK CWGetOverlay1FileInfo(CWPluginContext context, SInt32 whichgroup, SInt32 whichoverlay, SInt32 whichoverlayfile, CWOverlay1FileInfo* fileinfo); + + /* Report a error, warning, or informational message */ +CW_CALLBACK CWReportMessage(CWPluginContext context, const CWMessageRef* msgRef, const char *line1, const char *line2, short errorlevel, SInt32 errorNumber); + + /* Display an alert. May actually be put in a message, depending on the plugin request */ +CW_CALLBACK CWAlert(CWPluginContext context, const char* msg1, const char* msg2, const char* msg3, const char* msg4); + + /* Display one or two status messages to the user */ +CW_CALLBACK CWShowStatus(CWPluginContext context, const char *line1, const char *line2); + + /* Give to the IDE to handle events and check if user has canceled this operation */ +CW_CALLBACK CWUserBreak(CWPluginContext context); + + /* Return stored preference data, referenced by name. Typically used for preference */ + /* panel settings. */ +CW_CALLBACK CWGetNamedPreferences(CWPluginContext context, const char* prefsname, CWMemHandle* prefsdata); + + /* Store data referenced by a data type and file number */ +CW_CALLBACK CWStorePluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle prefsdata); + + /* Return stored data referenced by a data type and file number */ +CW_CALLBACK CWGetPluginData(CWPluginContext context, SInt32 whichfile, CWDataType type, CWMemHandle* prefsdata); + + /* Inform the IDE that a file modification date has changed. isGenerated is for use */ + /* by compiler and linker plugins only */ +CW_CALLBACK CWSetModDate(CWPluginContext context, const CWFileSpec* filespec, CWFileTime* moddate, Boolean isGenerated); + + /* Ask the IDE to add a file to the current target in the current project. isGenerated */ + /* is for use by compiler plugins only. */ +CW_CALLBACK CWAddProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec, Boolean isGenerated, const CWNewProjectEntryInfo* projectEntryInfo, SInt32* whichfile); + + /* Ask the IDE to remove a file from the current target (link-order/segment/overlay) in the current project. */ + /* If it's the last target that contains the file, it would be removed from the file list. */ +CW_CALLBACK CWRemoveProjectEntry(CWPluginContext context, const CWFileSpec* fileSpec); + + /* Create a new editor window, supplying initial text and an optional document name */ +CW_CALLBACK CWCreateNewTextDocument(CWPluginContext, const CWNewTextDocumentInfo* docinfo); + + /* Allocate memory. Permanent memory is not freed until the plugin is unloaded. */ + /* Temporary memory is freed after each plugin request completes. */ +CW_CALLBACK CWAllocateMemory(CWPluginContext context, SInt32 size, Boolean isPermanent, void** ptr); + + /* Free memory allocated via CWAllocateMemory */ +CW_CALLBACK CWFreeMemory(CWPluginContext context, void* ptr, Boolean isPermanent); + + /* Allocate a memory handle of the requested size. All handles are automatically */ + /* freed at the end of each compiler/linker request. useTempMemory is MacOS-specific*/ +CW_CALLBACK CWAllocMemHandle(CWPluginContext context, SInt32 size, Boolean useTempMemory, CWMemHandle* handle); + + /* Free a memory handle */ +CW_CALLBACK CWFreeMemHandle(CWPluginContext context, CWMemHandle handle); + + /* Return the current size of a memory handle */ +CW_CALLBACK CWGetMemHandleSize(CWPluginContext context, CWMemHandle handle, SInt32* size); + + /* Resize an existing memory handle */ +CW_CALLBACK CWResizeMemHandle(CWPluginContext context, CWMemHandle handle, SInt32 newSize); + + /* To obtain a pointer to the block, you must lock the handle */ + /* moveHi is MacOS-specific */ +CW_CALLBACK CWLockMemHandle(CWPluginContext context, CWMemHandle handle, Boolean moveHi, void** ptr); + + /* Unlock a memory handle, the pointer returned by locking the handle may no */ + /* longer be valid */ +CW_CALLBACK CWUnlockMemHandle(CWPluginContext context, CWMemHandle handle); + +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS + /* Utility function to map MacOS error codes to a CWResult code. Plugins */ + /* may internally generate OSErrs, but need to return CWResult to the */ + /* CodeWarrior IDE */ +CW_CALLBACK CWMacOSErrToCWResult(CWPluginContext context, OSErr err); +#endif + + /* Turn off the built in PP window manager while the plugin displays a dialog */ +CW_CALLBACK CWPreDialog(CWPluginContext context); + + /* Turn on the built in PP window manager after the plugin is through with its */ + /* dialog */ +CW_CALLBACK CWPostDialog(CWPluginContext context); + + /* Notify the IDE that the plugin will be performing actions on a file */ +CW_CALLBACK CWPreFileAction(CWPluginContext context, const CWFileSpec *theFile); + + /* Notify the IDE that the plugin is finished performing actions on a file */ +CW_CALLBACK CWPostFileAction(CWPluginContext context, const CWFileSpec *theFile); + +CW_CALLBACK CWResolveRelativePath(CWPluginContext context, const CWRelativePath* relativePath, CWFileSpec* fileSpec, Boolean create); + +CW_CALLBACK CWFindLogicalDirectory(CWPluginContext context, SInt32 selector, CWFileSpec *dirSpec); + +CW_CALLBACK CWOpenFileInEditor(CWPluginContext context, const CWFileSpec *fileSpec); + + +#if CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX +/* Forward declarations */ +struct ICodeWarriorApp; +struct ICodeWarriorProject; +struct ICodeWarriorDesign; +struct ICodeWarriorTarget; +#endif /* CWPLUGIN_HOST==CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST==CWPLUGIN_HOST_LINUX */ + + + /* Get the IDE application COM interface. Fails if called from any thread */ + /* other than the main IDE thread, e.g. a build thread. */ +CW_CALLBACK CWGetCOMApplicationInterface(CWPluginContext context, struct ICodeWarriorApp **app); + + /* Get the current project COM interface. Adds a reference upon return. */ + /* Only succeeds if the plugin is being called in the context of a */ + /* particular project. Fails if called from any thread */ + /* other than the main IDE thread, e.g. a build thread. */ +CW_CALLBACK CWGetCOMProjectInterface(CWPluginContext context, struct ICodeWarriorProject **project); + + /* Get the current design COM interface. Adds a reference upon return. */ + /* Only succeeds if the plugin is being called in the context of a */ + /* particular target that is associated with a design. */ + /* Fails if called from any thread other than the main IDE thread, */ + /* e.g. a build thread. */ +CW_CALLBACK CWGetCOMDesignInterface(CWPluginContext context, struct ICodeWarriorDesign **design); + + /* Get the current target COM interface. Adds a reference upon return. */ + /* Only succeeds if the plugin is being called in the context of a */ + /* particular target. Fails if called from any thread */ + /* other than the main IDE thread, e.g. a build thread. */ +CW_CALLBACK CWGetCOMTargetInterface(CWPluginContext context, struct ICodeWarriorTarget **target); + +#if CW_USE_PRAGMA_IMPORT +#pragma import reset +#endif + +#ifdef __cplusplus + } +#endif + +#ifdef _MSC_VER +#pragma pack(pop) +#endif + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif /* __CWPlugins_H__ */ diff --git a/sdk_hdrs/CWRuntimeFeatures.h b/sdk_hdrs/CWRuntimeFeatures.h index 003020c..85c4b4a 100755 --- a/sdk_hdrs/CWRuntimeFeatures.h +++ b/sdk_hdrs/CWRuntimeFeatures.h @@ -1 +1,206 @@ -/*****************************************************************************/ /* Name......: CWRuntimeFeatures.h */ /* Purpose...: Macros to parameterize your runtime environment based on */ /* platform-specific compiler macros. Target/host */ /* configurations to set host/target values as well as */ /* CW_HOST, CW_HOSTOS, CW_HOST_ENDIAN, CW_LINE_ENDING, */ /* and CW_UNIX_TYPE, which is used to discriminate among */ /* the various UNIX versions. */ /* Info......: These settings are common enough to factor into a location */ /* that can be shared by all components, including those */ /* used internally and those shared externally. */ /* Copyright.: ©Copyright 2000 by metrowerks inc. All rights reserved. */ /*****************************************************************************/ #ifndef CW_RuntimeFeatures_H #define CW_RuntimeFeatures_H /************************* * Runtime Definitions * *************************/ /* host / target processors values used to set HOST macro. */ #define CW_MC68K 1 #define CW_POWERPC 2 #define CW_INTEL 3 #define CW_MIPS 4 #define CW_SPARC 5 #define CW_PA_RISC 6 /* host / target operating systems values used to set CW_HOSTOS macro. */ #define CW_MACOS 1 #define CW_BEWORKS 2 #define CW_UNIX 3 #define CW_MSWIN 4 #define CW_MAGIC 5 #define CW_QNX 11 /* UNIX specialization values used to set the CW_UNIX_TYPE macro. */ #define CW_SOLARIS 32 /* Base value to support bit manipulation */ #define CW_LINUX 33 #define CW_RHAPSODY 34 #define CW_HPUX 35 #define CW_IRIX 36 #define CW_AIX 37 #define CW_FREEBSD 38 /* big/little endian values used to set CW_HOST_ENDIAN macro. */ #define CW_ENDIAN_NEUTRAL 0x7fffffff #define CW_BIG_ENDIAN 1 #define CW_LITTLE_ENDIAN 2 #define CW_EITHER_ENDIAN 3 /* ** Detemine run-time environment settings based on clues from the ** compile time settings given by specific compilers. */ #if defined(__MWERKS__) /* Metrowerks Compiler */ #if macintosh && __MC68K__ /* 68K MacOS */ #define CW_HOST CW_MC68K #define CW_HOSTOS CW_MACOS #define CW_HOST_ENDIAN CW_BIG_ENDIAN #define CW_LINE_ENDING "\r" #elif macintosh && __POWERPC__ /* PPC MacOS */ #define CW_HOST CW_POWERPC #define CW_HOSTOS CW_MACOS #define CW_HOST_ENDIAN CW_BIG_ENDIAN #define CW_LINE_ENDING "\r" #elif __INTEL__ && defined(__BEOS__) /* x86 BeOS */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_BEWORKS #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __INTEL__ && defined(__QNX__) /* x86 QNX */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_QNX #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __INTEL__ && __linux__ /* x86 Linux */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_LINUX #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __INTEL__ /* default to Win32 */ /* x86 Assuming Windows */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_MSWIN #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\r\n" #else #error "UNKNOWN CW COMPILER USE" #endif #elif defined(__GNUC__) /* GCC/EGCS Compiler */ #if __i386__ && __linux__ /* x86 Linux */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_LINUX #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __i386__ && __sun__ /* x86 Solaris */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_SOLARIS #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __sparc__ && __linux__ /* SPARC Linux */ #define CW_HOST CW_SPARC #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_LINUX #define CW_HOST_ENDIAN CW_BIG_ENDIAN #define CW_LINE_ENDING "\n" #elif __sparc__ && __sun__ /* SPARC Solaris */ #define CW_HOST CW_SPARC #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_SOLARIS #define CW_HOST_ENDIAN CW_BIG_ENDIAN #define CW_LINE_ENDING "\n" #elif __i386__ && __BEOS__ /* x86 BeOS */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_BEWORKS #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\n" #elif __powerpc__ && __linux__ /* PPC Linux */ #define CW_HOST CW_POWERPC #define CW_HOSTOS CW_UNIX #define CW_UNIX_TYPE CW_LINUX #define CW_HOST_ENDIAN CW_BIG_ENDIAN #define CW_LINE_ENDING "\n" #else #error "UNKNOWN GNU COMPILER USE" #endif #elif defined(_MSC_VER) /* Microsoft VC Compiler */ #if defined(_M_IX86) /* x86 Windows */ #define CW_HOST CW_INTEL #define CW_HOSTOS CW_MSWIN #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN #define CW_LINE_ENDING "\r\n" #else #error "UNKNOWN MSC COMPILER USE" #endif #else #error "UNKNOWN COMPILER" #endif #endif /* CW_RuntimeFeatures_H */ \ No newline at end of file +/*****************************************************************************/ +/* Name......: CWRuntimeFeatures.h */ +/* Purpose...: Macros to parameterize your runtime environment based on */ +/* platform-specific compiler macros. Target/host */ +/* configurations to set host/target values as well as */ +/* CW_HOST, CW_HOSTOS, CW_HOST_ENDIAN, CW_LINE_ENDING, */ +/* and CW_UNIX_TYPE, which is used to discriminate among */ +/* the various UNIX versions. */ +/* Info......: These settings are common enough to factor into a location */ +/* that can be shared by all components, including those */ +/* used internally and those shared externally. */ +/* Copyright.: �Copyright 2000 by metrowerks inc. All rights reserved. */ +/*****************************************************************************/ + +#ifndef CW_RuntimeFeatures_H +#define CW_RuntimeFeatures_H + + +/************************* + * Runtime Definitions * + *************************/ + + /* host / target processors values used to set HOST macro. */ + +#define CW_MC68K 1 +#define CW_POWERPC 2 +#define CW_INTEL 3 +#define CW_MIPS 4 +#define CW_SPARC 5 +#define CW_PA_RISC 6 + + /* host / target operating systems values used to set CW_HOSTOS macro. */ + +#define CW_MACOS 1 +#define CW_BEWORKS 2 +#define CW_UNIX 3 +#define CW_MSWIN 4 +#define CW_MAGIC 5 +#define CW_QNX 11 + + /* UNIX specialization values used to set the CW_UNIX_TYPE macro. */ + +#define CW_SOLARIS 32 /* Base value to support bit manipulation */ +#define CW_LINUX 33 +#define CW_RHAPSODY 34 +#define CW_HPUX 35 +#define CW_IRIX 36 +#define CW_AIX 37 +#define CW_FREEBSD 38 + + /* big/little endian values used to set CW_HOST_ENDIAN macro. */ + +#define CW_ENDIAN_NEUTRAL 0x7fffffff +#define CW_BIG_ENDIAN 1 +#define CW_LITTLE_ENDIAN 2 +#define CW_EITHER_ENDIAN 3 + +/* +** Detemine run-time environment settings based on clues from the +** compile time settings given by specific compilers. +*/ +#if defined(__MWERKS__) + /* Metrowerks Compiler */ + + #if macintosh && __MC68K__ + + /* 68K MacOS */ + #define CW_HOST CW_MC68K + #define CW_HOSTOS CW_MACOS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\r" + + #elif macintosh && __POWERPC__ + + /* PPC MacOS */ + #define CW_HOST CW_POWERPC + #define CW_HOSTOS CW_MACOS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\r" + + #elif __INTEL__ && defined(__BEOS__) + + /* x86 BeOS */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_BEWORKS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ && defined(__QNX__) + + /* x86 QNX */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_QNX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ && __linux__ + + /* x86 Linux */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __INTEL__ /* default to Win32 */ + + /* x86 Assuming Windows */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_MSWIN + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\r\n" + + #else + + #error "UNKNOWN CW COMPILER USE" + + #endif + +#elif defined(__GNUC__) + /* GCC/EGCS Compiler */ + + #if __i386__ && __linux__ + + /* x86 Linux */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __i386__ && __sun__ + + /* x86 Solaris */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_SOLARIS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __sparc__ && __linux__ + + /* SPARC Linux */ + #define CW_HOST CW_SPARC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __sparc__ && __sun__ + + /* SPARC Solaris */ + #define CW_HOST CW_SPARC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_SOLARIS + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __i386__ && __BEOS__ + + /* x86 BeOS */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_BEWORKS + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\n" + + #elif __powerpc__ && __linux__ + + /* PPC Linux */ + #define CW_HOST CW_POWERPC + #define CW_HOSTOS CW_UNIX + #define CW_UNIX_TYPE CW_LINUX + #define CW_HOST_ENDIAN CW_BIG_ENDIAN + #define CW_LINE_ENDING "\n" + + #else + + #error "UNKNOWN GNU COMPILER USE" + + #endif + +#elif defined(_MSC_VER) + /* Microsoft VC Compiler */ + + #if defined(_M_IX86) + + /* x86 Windows */ + #define CW_HOST CW_INTEL + #define CW_HOSTOS CW_MSWIN + #define CW_HOST_ENDIAN CW_LITTLE_ENDIAN + #define CW_LINE_ENDING "\r\n" + + #else + + #error "UNKNOWN MSC COMPILER USE" + + #endif + +#else + + #error "UNKNOWN COMPILER" + +#endif + + +#endif /* CW_RuntimeFeatures_H */ diff --git a/sdk_hdrs/CWUnixPluginPrefix.h b/sdk_hdrs/CWUnixPluginPrefix.h deleted file mode 100755 index a261ea3..0000000 --- a/sdk_hdrs/CWUnixPluginPrefix.h +++ /dev/null @@ -1 +0,0 @@ -/* * CWUnixPluginPrefix.h * * Copyright © 1999 Metrowerks, Inc. All rights reserved. * */ #ifndef MW_CWUnixPluginPrefix_H #define MW_CWUnixPluginPrefix_H #define CW_USE_PRAGMA_EXPORT 0 #include "CWRuntimeFeatures.h" #ifdef __MWERKS__ #if !__option(bool) #ifndef true #define true 1 #endif #ifndef false #define false 0 #endif #endif #endif #endif /* MW_CWUnixPluginPrefix_H */ \ No newline at end of file diff --git a/sdk_hdrs/CWWinPluginPrefix.h b/sdk_hdrs/CWWinPluginPrefix.h deleted file mode 100755 index 4ad49af..0000000 --- a/sdk_hdrs/CWWinPluginPrefix.h +++ /dev/null @@ -1 +0,0 @@ -#include #ifndef WIN32 #define WIN32 1 #endif #define CW_USE_PRAGMA_EXPORT 0 #ifdef __MWERKS__ #if !__option(bool) #ifndef true #define true 1 #endif #ifndef false #define false 0 #endif #endif #endif \ No newline at end of file diff --git a/sdk_hdrs/CatTypes.h b/sdk_hdrs/CatTypes.h deleted file mode 100755 index 421622b..0000000 --- a/sdk_hdrs/CatTypes.h +++ /dev/null @@ -1 +0,0 @@ -#ifndef __CATTYPES_H__ #define __CATTYPES_H__ typedef int CatNodeID; #define NODE_NULL -1 #define NODE_ROOT 0 #define kCatalogClass "CodeWarrior.CatalogModelObject" #define kFolderClass "CodeWarrior.FolderModelObject" #define kTrashNodeClass "CodeWarrior.TrashNode" // internal properties used in the catalog #define kContentsFolder "ContentsFolder" #define kClass "Class" #define kComments "Comments" #define kFile "File" #define kNodeLocked "Locked" #define kModDate "Modified" #define kName "Name" #define kID "ID" #define kFolderSuffix "_Contents" #define kDefCatalogExt "ctlg" #define kDefCatalogFolderExt "ctlgf" // Command group ID for commands in the catalog menu... const long cmdGroup_CatalogMenu = 10000; // catalog-specific menu commands to go with those defined by the IDE; // such as cmd_Cut, cmd_Copy, etc. const long cmd_CatalogRename = 10000; // plugin commands in the range 10000-10999 const long cmd_CatalogProperties = 10001; const long cmd_ShowCatalogBrowser = 10002; const long cmd_ShowCatalogPalette = 10003; const long cmd_NewCatalog = 10004; const long cmd_NewFolder = 10005; const long cmd_OpenCatalog = 10006; const long cmd_CloseCatalog = 10007; const long cmd_ImportControls = 10008; const long cmd_ShowPrevious = 10009; const long cmd_ShowNext = 10010; const long cmd_ExpandIndexView = 10011; const long cmd_CollapseIndexView = 10012; const long cmd_ToggleIndexView = 10013; const long cmd_CloseCatalogPalette = 10014; enum UPDATE_TYPE { UPDATE_NONE = 0, UPDATE_CHILDREN, UPDATE_DESCENDANTS }; enum CatTransType { CATTRANS_TYPE_UNKNOWN, CATTRANS_TYPE_ALIAS, CATTRANS_TYPE_COPY, CATTRANS_TYPE_DELETE, CATTRANS_TYPE_DROP, CATTRANS_TYPE_EDITPROPERTIES, CATTRANS_TYPE_LOCK, CATTRANS_TYPE_MOVE, CATTRANS_TYPE_PASTE, CATTRANS_TYPE_RENAME, CATTRANS_TYPE_UNLOCK }; struct CatWindowData { bool fUseDefSize; bool fUseDefPos; SIZE size; POINT pos; CatWindowData() : fUseDefSize(true), fUseDefPos(true) { pos.x = pos.y = 0; size.cx = size.cy = 0; } }; #endif // __CATTYPES_H__ \ No newline at end of file diff --git a/sdk_hdrs/CompilerMapping.h b/sdk_hdrs/CompilerMapping.h index c929a74..8337613 100755 --- a/sdk_hdrs/CompilerMapping.h +++ b/sdk_hdrs/CompilerMapping.h @@ -1 +1,138 @@ -/* * CompilerMapping.h - File Type & Extension => Compiler Mapping for Metrowerks CodeWarrior� * * Copyright � 1995 Metrowerks, Inc. All rights reserved. * */ #ifndef __COMPILERMAPPING_H__ #define __COMPILERMAPPING_H__ #ifdef __MWERKS__ # pragma once #endif #ifndef __CWPLUGINS_H__ #include "CWPlugins.h" #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus const CWDataType Lang_C_CPP = CWFOURCHAR('c','+','+',' '); const CWDataType Lang_Pascal = CWFOURCHAR('p','a','s','c'); const CWDataType Lang_Rez = CWFOURCHAR('r','e','z',' '); const CWDataType Lang_Java = CWFOURCHAR('j','a','v','a'); const CWDataType Lang_MISC = CWFOURCHAR('\?','\?','\?','\?'); #else #define Lang_C_CPP CWFOURCHAR('c','+','+',' ') #define Lang_Pascal CWFOURCHAR('p','a','s','c') #define Lang_Rez CWFOURCHAR('r','e','z',' ') #define Lang_Java CWFOURCHAR('j','a','v','a') #define Lang_MISC CWFOURCHAR('\?','\?','\?','\?') #endif /* Compiler flags, as used in member dropinflags of struct DropInFlags returned by compilers */ enum { kGeneratescode = 1L << 31, /* this compiler generates code */ kGeneratesrsrcs = 1L << 30, /* this compiler generates resources */ kCanpreprocess = 1L << 29, /* this compiler can accept a Preprocess request */ kCanprecompile = 1L << 28, /* this compiler can accept a Precompile request */ kIspascal = 1L << 27, /* this is the pascal compiler */ kCanimport = 1L << 26, /* this compiler needs the "Import Weak" popup */ kCandisassemble = 1L << 25, /* this compiler can disassemble */ kPersistent = 1L << 24, /* keep the compiler resident except on context switches*/ kCompAllowDupFileNames = 1L << 23, /* allow multiple project files with the same name */ kCompMultiTargAware = 1L << 22, /* the compiler can be used with multiple targets */ kIsMPAware = 1L << 21, /* the compiler can be run in an MP thread */ kCompUsesTargetStorage = 1L << 20, /* the compiler keeps storage per target */ kCompEmitsOwnBrSymbols = 1L << 19, /* browser info includes compiler-specific symbols */ kCompAlwaysReload = 1L << 18, /* always reload the compiler before request */ kCompRequiresProjectBuildStartedMsg = 1L << 17, /* Compiler listens for project build started messages */ kCompRequiresTargetBuildStartedMsg = 1L << 16, /* Compiler listens for target build started messages */ kCompRequiresSubProjectBuildStartedMsg = 1L << 15, /* Compiler listens for Sub project build started messages */ kCompRequiresFileListBuildStartedMsg = 1L << 14, /* Compiler listens for filelist build started messages */ kCompReentrant = 1L << 13, /* Compiler can use re-entrant DropIn and is re-entry safe */ kCompSavesDbgPreprocess = 1 << 12, /* Compiler will save preprocessed files for debugging needs */ kCompRequiresTargetCompileStartedMsg = 1 << 11 /* Compiler listens for target compile started/ended messages */ /* remaining flags are reserved for future use and should be zero-initialized */ }; /* Compiler mapping flags, used in CompilerMapping.flags & CWExtensionMapping.flags */ typedef unsigned long CompilerMappingFlags; enum { kPrecompile = 1L << 31, /* should this file type be Precompiled? */ kLaunchable = 1L << 30, /* can this file type be double-clicked on? */ kRsrcfile = 1L << 29, /* does this file type contain resources for linking? */ kIgnored = 1L << 28 /* should files of this type be ignored during Make? */ /* remaining flags are reserved for future use and should be zero-initialized */ }; /* Format of data in 'EMap' resource, or as returned by a compiler's */ /* GetExtensionMapping entry point */ typedef struct CWExtensionMapping { CWDataType type; /* MacOS file type, e.g. 'TEXT' or 0 */ char extension[32]; /* file extension, e.g. .c/.cp/.pch or "" */ CompilerMappingFlags flags; /* see above */ } CWExtensionMapping; #define kCurrentCWExtMapListVersion 1 #define kCurrentCWExtMapListResourceVersion 1 typedef struct CWExtMapList { short version; short nMappings; CWExtensionMapping* mappings; } CWExtMapList; /* Format of data returned by GetTargetList entry point */ #define kCurrentCWTargetListVersion 1 #define kCurrentCWTargetListResourceVersion 1 typedef struct CWTypeList { short count; CWDataType items[1]; } CW_CPUList, CW_OSList; typedef struct CWTargetList { short version; short cpuCount; CWDataType* cpus; short osCount; CWDataType* oss; } CWTargetList; typedef struct CWTargetListResource { short version; CW_CPUList cpus; CW_OSList oss; } CWTargetListResource; #ifdef __cplusplus } #endif #ifdef _MSC_VER #pragma pack(pop,2) #endif #ifdef __MWERKS__ #pragma options align=reset #endif #endif /* __COMPILERMAPPING_H__ */ \ No newline at end of file +/* + * CompilerMapping.h - File Type & Extension => Compiler Mapping for Metrowerks CodeWarrior� + * + * Copyright � 1995 Metrowerks, Inc. All rights reserved. + * + */ + +#ifndef __COMPILERMAPPING_H__ +#define __COMPILERMAPPING_H__ + +#ifdef __MWERKS__ +# pragma once +#endif + +#ifndef __CWPLUGINS_H__ +#include "CWPlugins.h" +#endif + +#ifdef __MWERKS__ +#pragma options align=mac68k +#endif + +#ifdef _MSC_VER +#pragma pack(push,2) +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +#ifdef __cplusplus + const CWDataType Lang_C_CPP = CWFOURCHAR('c','+','+',' '); + const CWDataType Lang_Pascal = CWFOURCHAR('p','a','s','c'); + const CWDataType Lang_Rez = CWFOURCHAR('r','e','z',' '); + const CWDataType Lang_Java = CWFOURCHAR('j','a','v','a'); + const CWDataType Lang_MISC = CWFOURCHAR('\?','\?','\?','\?'); +#else + #define Lang_C_CPP CWFOURCHAR('c','+','+',' ') + #define Lang_Pascal CWFOURCHAR('p','a','s','c') + #define Lang_Rez CWFOURCHAR('r','e','z',' ') + #define Lang_Java CWFOURCHAR('j','a','v','a') + #define Lang_MISC CWFOURCHAR('\?','\?','\?','\?') +#endif + +/* Compiler flags, as used in member dropinflags of struct DropInFlags returned by compilers */ +enum +{ + kGeneratescode = 1L << 31, /* this compiler generates code */ + kGeneratesrsrcs = 1L << 30, /* this compiler generates resources */ + kCanpreprocess = 1L << 29, /* this compiler can accept a Preprocess request */ + kCanprecompile = 1L << 28, /* this compiler can accept a Precompile request */ + kIspascal = 1L << 27, /* this is the pascal compiler */ + kCanimport = 1L << 26, /* this compiler needs the "Import Weak" popup */ + kCandisassemble = 1L << 25, /* this compiler can disassemble */ + kPersistent = 1L << 24, /* keep the compiler resident except on context switches*/ + kCompAllowDupFileNames = 1L << 23, /* allow multiple project files with the same name */ + kCompMultiTargAware = 1L << 22, /* the compiler can be used with multiple targets */ + kIsMPAware = 1L << 21, /* the compiler can be run in an MP thread */ + kCompUsesTargetStorage = 1L << 20, /* the compiler keeps storage per target */ + kCompEmitsOwnBrSymbols = 1L << 19, /* browser info includes compiler-specific symbols */ + kCompAlwaysReload = 1L << 18, /* always reload the compiler before request */ + kCompRequiresProjectBuildStartedMsg = 1L << 17, /* Compiler listens for project build started messages */ + kCompRequiresTargetBuildStartedMsg = 1L << 16, /* Compiler listens for target build started messages */ + kCompRequiresSubProjectBuildStartedMsg = 1L << 15, /* Compiler listens for Sub project build started messages */ + kCompRequiresFileListBuildStartedMsg = 1L << 14, /* Compiler listens for filelist build started messages */ + kCompReentrant = 1L << 13, /* Compiler can use re-entrant DropIn and is re-entry safe */ + kCompSavesDbgPreprocess = 1 << 12, /* Compiler will save preprocessed files for debugging needs */ + kCompRequiresTargetCompileStartedMsg = 1 << 11 /* Compiler listens for target compile started/ended messages */ + /* remaining flags are reserved for future use and should be zero-initialized */ +}; + +/* Compiler mapping flags, used in CompilerMapping.flags & CWExtensionMapping.flags */ +typedef unsigned long CompilerMappingFlags; +enum +{ + kPrecompile = 1L << 31, /* should this file type be Precompiled? */ + kLaunchable = 1L << 30, /* can this file type be double-clicked on? */ + kRsrcfile = 1L << 29, /* does this file type contain resources for linking? */ + kIgnored = 1L << 28 /* should files of this type be ignored during Make? */ + /* remaining flags are reserved for future use and should be zero-initialized */ +}; + +/* Format of data in 'EMap' resource, or as returned by a compiler's */ +/* GetExtensionMapping entry point */ + +typedef struct CWExtensionMapping { + CWDataType type; /* MacOS file type, e.g. 'TEXT' or 0 */ + char extension[32]; /* file extension, e.g. .c/.cp/.pch or "" */ + CompilerMappingFlags flags; /* see above */ +} CWExtensionMapping; + +#define kCurrentCWExtMapListVersion 1 +#define kCurrentCWExtMapListResourceVersion 1 + +typedef struct CWExtMapList { + short version; + short nMappings; + CWExtensionMapping* mappings; +} CWExtMapList; + +/* Format of data returned by GetTargetList entry point */ + +#define kCurrentCWTargetListVersion 1 +#define kCurrentCWTargetListResourceVersion 1 + +typedef struct CWTypeList { + short count; + CWDataType items[1]; +} CW_CPUList, CW_OSList; + +typedef struct CWTargetList { + short version; + short cpuCount; + CWDataType* cpus; + short osCount; + CWDataType* oss; +} CWTargetList; + +typedef struct CWTargetListResource { + short version; + CW_CPUList cpus; + CW_OSList oss; +} CWTargetListResource; + + +#ifdef __cplusplus + } +#endif + +#ifdef _MSC_VER +#pragma pack(pop,2) +#endif + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif /* __COMPILERMAPPING_H__ */ diff --git a/sdk_hdrs/DropInCompilerLinker.h b/sdk_hdrs/DropInCompilerLinker.h index 4dd87f6..439619b 100755 --- a/sdk_hdrs/DropInCompilerLinker.h +++ b/sdk_hdrs/DropInCompilerLinker.h @@ -1 +1,406 @@ -/* * DropInCompilerLinker.h - Drop-In Interface for Metrowerks CodeWarrior� Compilers and Linkers * * Copyright � 1996 Metrowerks, Inc. All rights reserved. * */ #ifndef __DROPINCOMPILERLINKER_H__ #define __DROPINCOMPILERLINKER_H__ #ifdef __MWERKS__ # pragma once #endif #ifndef __CWPlugins_H__ #include "CWPlugins.h" #endif #ifndef __COMPILERMAPPING_H__ #include "CompilerMapping.h" #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif #if CW_USE_PRAGMA_IMPORT #pragma import on #endif /* this is the current version number of the API documented herein */ #define DROPINCOMPILERLINKERAPIVERSION_4 4 #define DROPINCOMPILERLINKERAPIVERSION_5 5 #define DROPINCOMPILERLINKERAPIVERSION_6 6 #define DROPINCOMPILERLINKERAPIVERSION_7 7 #define DROPINCOMPILERLINKERAPIVERSION_8 8 #define DROPINCOMPILERLINKERAPIVERSION_9 9 #define DROPINCOMPILERLINKERAPIVERSION_10 10 #define DROPINCOMPILERLINKERAPIVERSION_11 11 #define DROPINCOMPILERLINKERAPIVERSION_12 12 #define DROPINCOMPILERLINKERAPIVERSION_13 13 #define DROPINCOMPILERLINKERAPIVERSION DROPINCOMPILERLINKERAPIVERSION_13 /* deprecated request codes */ enum { reqInitCompiler = reqInitialize, /* (called when compiler is loaded) */ reqTermCompiler = reqTerminate, /* (called when compiler is unloaded) */ reqInitLinker = reqInitialize, /* (called when linker is loaded) */ reqTermLinker = reqTerminate /* (called when linker is unloaded) */ }; /* request codes (common) */ enum { reqTargetCompileEnded = -17, /* Sent when target's compile phase ends */ reqTargetCompileStarted = -16, /* Sent when target's compile phase starts */ reqTargetLinkEnded = -15, /* Sent when the link has ended */ reqTargetLinkStarted = -14, /* Sent when the link starts */ reqFileListBuildEnded = -13, /* Sent when the group file build ends */ reqFileListBuildStarted = -12, /* Sent when the group file build starts */ reqSubProjectBuildEnded = -11, /* Sent when subproject's build ends */ reqSubProjectBuildStarted = -10, /* Sent when subproject's build starts */ reqTargetBuildEnded = -9, /* Sent when target's build ends */ reqTargetBuildStarted = -8, /* Sent when target's build starts */ reqProjectBuildEnded = -7, /* Sent when project build ends */ reqProjectBuildStarted = -6, /* Sent when project build starts */ reqTargetLoaded = -5, /* called when the "keeps target info" flag is set */ reqTargetPrefsChanged = -4, /* called when the "keeps target info" flag is set */ reqTargetUnloaded = -3 /* called when the "keeps target info" flag is set */ }; /* requests codes (compilers) */ enum { reqCompile = 0, /* compile/precompile/preprocess source file */ /* and return results */ reqMakeParse, /* used internally by Metrowerks */ reqCompDisassemble, /* disassemble a specific file in the project */ reqCheckSyntax, /* check syntax, but don't generate code */ reqPreprocessForDebugger /* when preprocess, don't open window w/results */ }; /* requests codes (linkers) */ enum { reqLink = 0, /* link project and generate executable or library */ reqDisassemble, /* disassemble a specific file in the project */ reqTargetInfo, /* get info about the generated executable */ reqPreRun /* give linker a last chance to modify target info */ }; /* Returned as part of CWFileInfo to indicate the */ /* type of data pointed to by the filedata pointer */ enum { filetypeText, /* data is text */ filetypeUnknown /* unknown type, could be precompiled header */ }; /* executable linkage types, used in CWTargetInfo.linkType */ enum { exelinkageFlat, /* flat executable */ exelinkageSegmented, /* uses 68K code segments */ exelinkageOverlay1 /* uses overlay groups and overlays */ }; /* output file type, used in CWTargetInfo.outputType */ enum { linkOutputNone, /* linker produces no output */ linkOutputFile, /* linker produces a file */ linkOutputDirectory /* linker produces a directory */ }; /* Constants for the targetCPU field of the CWTargetInfo struct */ enum { targetCPU68K = CWFOURCHAR('6','8','k',' '), targetCPUPowerPC = CWFOURCHAR('p','p','c',' '), targetCPUi80x86 = CWFOURCHAR('8','0','8','6'), targetCPUMips = CWFOURCHAR('m','i','p','s'), targetCPUNECv800 = CWFOURCHAR('v','8','0','0'), targetCPUEmbeddedPowerPC = CWFOURCHAR('e','P','P','C'), targetCPUARM = CWFOURCHAR('a','r','m',' '), targetCPUSparc = CWFOURCHAR('s','p','r','c'), targetCPUIA64 = CWFOURCHAR('I','A','6','4'), targetCPUAny = CWFOURCHAR('*','*','*','*'), targetCPUMCORE = CWFOURCHAR('m','c','o','r'), targetCPU_Intent = CWFOURCHAR('n','t','n','t') }; /* Constants for the targetOS field of the CWTargetInfo struct */ enum { targetOSMacintosh = CWFOURCHAR('m','a','c',' '), targetOSWindows = CWFOURCHAR('w','i','n','t'), targetOSNetware = CWFOURCHAR('n','l','m',' '), targetOSMagicCap = CWFOURCHAR('m','c','a','p'), targetOSOS9 = CWFOURCHAR('o','s','9',' '), targetOSEmbeddedABI = CWFOURCHAR('E','A','B','I'), targetOSJava = CWFOURCHAR('j','a','v','a'), /* java (no VM specification) */ targetOSJavaMS = CWFOURCHAR('j','v','m','s'), /* Microsoft VM */ targetOSJavaSun = CWFOURCHAR('j','v','s','n'), /* Sun VM */ targetOSJavaMRJ = CWFOURCHAR('j','v','m','r'), /* MRJ VM */ targetOSJavaMW = CWFOURCHAR('j','v','m','w'), /* Metrowerks VM */ targetOSPalm = CWFOURCHAR('p','a','l','m'), targetOSGTD5 = CWFOURCHAR('g','t','d','5'), targetOSSolaris = CWFOURCHAR('s','l','r','s'), targetOSLinux = CWFOURCHAR('l','n','u','x'), targetOSAny = CWFOURCHAR('*','*','*','*'), targetOS_Intent = CWFOURCHAR('n','t','n','t') }; /* linker flags, as used in member dropinflags of DropInFlags struct returned by linkers */ enum { cantDisassemble = 1L << 31, /* this linker doesn't support 'Disassemble' */ isPostLinker = 1L << 30, /* this is a post linker */ linkAllowDupFileNames = 1L << 29, /* allow multiple project files with the same name */ linkMultiTargAware = 1L << 28, /* the linker can be used with multiple targets */ isPreLinker = 1L << 27, /* this is a pre linker */ linkerUsesTargetStorage = 1L << 26, /* the linker keeps storage per target */ linkerUnmangles = 1L << 25, /* The linker supports unmangling. */ magicCapLinker = 1L << 24, /* Pre- or post-linker is used for MagicCap */ linkAlwaysReload = 1L << 23, /* Always reload the linker before request */ linkRequiresProjectBuildStartedMsg = 1L << 22, /* Linker listens for a Project Build Started/Ended message */ linkRequiresTargetBuildStartedMsg = 1L << 21, /* Linker listens for a Target Build Started/Ended message */ linkRequiresSubProjectBuildStartedMsg = 1L << 20, /* Linker listens for a Sub Project Build Started/Ended message */ linkRequiresFileListBuildStartedMsg = 1L << 19, /* Linker listens for a File List Build Started/Ended message */ linkRequiresTargetLinkStartedMsg = 1L << 18, /* Linker listens for a Target Link Started/Ended message */ linkerWantsPreRunRequest = 1L << 17, /* Linker wants to be sent the pre-run request */ linkerGetTargetInfoThreadSafe = 1L << 16, /* GetTargetInfo call doesn't use any globals, etc. */ linkerUsesCaseInsensitiveSymbols = 1L << 15, /* All languages used by linker contain case insensitive browser symbols */ linkerDisasmRequiresPreprocess = 1L << 14, /* (obsolete) file must be preprocesed before being passed to linker for disasm */ linkerUsesFrameworks = 1L << 13, /* target uses frameworks; enables framework-style file searching */ linkerInitializeOnMainThread = 1L << 12 /* The Linker needs to be intialized on the main thread. */ /* remaining flags are reserved for future use and should be zero-initialized */ }; /* ways to store dependency returned as CWFileSpec in StoreObjectData */ enum { cwAccessAbsolute, cwAccessPathRelative, cwAccessFileName, cwAccessFileRelative }; /* specifies what browser information compilers should generate */ /* they should always generate records for globals and functions */ typedef struct CWBrowseOptions { Boolean recordClasses; /* [<-] do we record info for classes */ Boolean recordEnums; /* [<-] do we record info for enums */ Boolean recordMacros; /* [<-] do we record info for macros */ Boolean recordTypedefs; /* [<-] do we record info for typedefs */ Boolean recordConstants; /* [<-] do we record info for constants */ Boolean recordTemplates; /* [<-] do we record info for templates */ Boolean recordUndefinedFunctions; /* [<-] do we record info for undefined functions */ SInt32 reserved1; /* reserved space */ SInt32 reserved2; /* reserved space */ } CWBrowseOptions; /* A dependency tag is associated with unit data in the StoreUnitData callback. It should */ /* change whenever unit data has changed in a way that forces its dependents to be rebuilt. */ /* Typically, it is just a checksum on the unit data. */ typedef UInt32 CWDependencyTag; /* dependency information passed back in StoreObjectData */ typedef struct CWDependencyInfo { SInt32 fileIndex; /* Another project entry. -1 => use fileSpec */ CWFileSpec fileSpec; /* location of file. Only used if fileIndex < 0 */ short fileSpecAccessType; /* One of cwAccessAbsolute, etc. above. Only */ /* used is specifying via fileSpec. */ short dependencyType; /* cwNormalDependency or cwInterfaceDependency. */ /* Values defined in CWPlugins.h */ } CWDependencyInfo; /* information used when calling StoreObjectData */ typedef struct CWObjectData { CWMemHandle objectdata; /* Handle to generated object code, */ /* resource data, or preprocessed text */ CWMemHandle browsedata; /* Handle to generated browse data */ SInt32 reserved1; /* reserved for future use, set to zero */ SInt32 codesize; /* size of generated code */ SInt32 udatasize; /* size of uninitialized data */ SInt32 idatasize; /* size of initialized data */ SInt32 compiledlines; /* number of lines of source compiled */ Boolean interfaceChanged; /* recompile interface dependents? */ SInt32 reserved2; /* reserved for future use, set to zero */ void* compilecontext; /* used internally by Metrowerks */ CWDependencyInfo* dependencies; /* optional array of dependencies */ short dependencyCount; /* overrides those collected by IDE */ CWFileSpec* objectfile; /* external object code file (i.e. .o file) */ } CWObjectData; /* characteristics of a link target */ typedef struct CWTargetInfo { short outputType; /* outputs file, directory, or nothing */ CWFileSpec outfile; /* generated executable file/folder spec */ CWFileSpec symfile; /* generated debug file spec */ CWFileSpec runfile; /* file to run, can be same or different from outfile */ short linkType; /* flat, segmented, or overlays */ Boolean canRun; /* "Run" can be performed on this target */ Boolean canDebug; /* "Run with Debugger" can be performed on this target */ CWDataType targetCPU; /* target CPU architecture (e.g. 68K, PowerPC, x86, MIPS)*/ CWDataType targetOS; /* target OS (e.g. MacOS, Windows, Unix) */ #if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS OSType outfileCreator; /* file creator, if outputType == linkOutputFile */ OSType outfileType; /* file type, if outputType == linkOutputFile */ OSType debuggerCreator; /* file creator of debugger for this target */ OSType runHelperCreator; /* creator of helper app to use when running this file. */ #endif #if CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32 Boolean runHelperIsRegKey; /* true if runHelperName is a registry key */ Boolean debugHelperIsRegKey;/* true if debugHelperName is a registry key */ char args[512]; /* command line arguments */ char runHelperName[512]; /* full path to the run helper executable or a reg key */ Boolean runHelperRequiresURL;/* Indicates whether the outfile must be converted to */ /* a file scheme URL before being passed to the run */ /* helper app */ char reserved2; char debugHelperName[512];/* full path to the debug helper executable or a reg key*/ #endif // We need the args for Solaris #if (CWPLUGIN_HOST == CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST == CWPLUGIN_HOST_LINUX) char args[512]; /* command line arguments */ char runHelperName[512]; /* Relative path name from (Helper Apps) to run helper program */ Boolean runHelperRequiresURL; /* Indicates whether the outfile must be converted to */ /* a file scheme URL before being passed to the run */ /* helper app */ char reserved2[3]; char debugHelperName[512]; /* Relative path name from (Helper Apps) to debug helper */ #endif CWFileSpec linkAgainstFile; /* file parent targets link against (e.g. lib file) */ } CWTargetInfo; typedef struct CWUnmangleInfo { void* targetStorage; const char* mangledName; char* unmangleBuff; SInt32 unmangleBuffSize; unsigned short browserClassID; unsigned char browserLang; unsigned char filler1; } CWUnmangleInfo; /* Types used to get compiler-specific browser symbol information. */ typedef struct CWCompilerBrSymbol { char symName[32]; char symUIName[32]; } CWCompilerBrSymbol; typedef struct CWCompilerBrSymbolList { short count; CWCompilerBrSymbol items[1]; } CWCompilerBrSymbolList; typedef struct CWCompilerBrSymbolInfo { void* targetStorage; CWCompilerBrSymbolList* symList; /* [<-] Compiler should put a pointer to the read-only list here.*/ } CWCompilerBrSymbolInfo; typedef struct CWFrameworkInfo { CWFileSpec fileSpec; /* location of ".framework" directory */ char version[256]; /* which version directory to use; if empty use "Current" sym link */ } CWFrameworkInfo; /*** Declaration of plugin entry points that must be implemented by non-MacOS plugins ***/ /*** It can also be implemented by a MacOS plugin to override the 'Targ' resource ***/ CWPLUGIN_ENTRY (CWPlugin_GetTargetList)(const struct CWTargetList**); /*** Optional entry points ***/ CWPLUGIN_ENTRY (CWPlugin_GetDefaultMappingList)(const struct CWExtMapList**); CWPLUGIN_ENTRY (Helper_Unmangle)(CWUnmangleInfo*); CWPLUGIN_ENTRY (Helper_GetCompilerBrSymbols)(CWCompilerBrSymbolInfo*); /*** callbacks to the IDE, in addition to those in CWPlugins.h ***/ CW_CALLBACK CWIsPrecompiling(CWPluginContext context, Boolean* isPrecompiling); CW_CALLBACK CWIsAutoPrecompiling(CWPluginContext context, Boolean* isAutoPrecompiling); CW_CALLBACK CWIsPreprocessing(CWPluginContext context, Boolean* isPreprocessing); CW_CALLBACK CWIsGeneratingDebugInfo(CWPluginContext context, Boolean* isGenerating); CW_CALLBACK CWIsCachingPrecompiledHeaders(CWPluginContext context, Boolean* isCaching); CW_CALLBACK CWGetBrowseOptions(CWPluginContext context, CWBrowseOptions* browseOptions); CW_CALLBACK CWGetBuildSequenceNumber(CWPluginContext context, SInt32* sequenceNumber); CW_CALLBACK CWGetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo); CW_CALLBACK CWSetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo); CW_CALLBACK CWGetTargetStorage(CWPluginContext context, void** storage); CW_CALLBACK CWSetTargetStorage(CWPluginContext context, void* storage); CW_CALLBACK CWGetMainFileNumber(CWPluginContext context, SInt32* fileNumber); CW_CALLBACK CWGetMainFileID(CWPluginContext context, short* fileID); CW_CALLBACK CWGetMainFileSpec(CWPluginContext context, CWFileSpec* fileSpec); CW_CALLBACK CWGetMainFileText(CWPluginContext context, const char** text, SInt32* textLength); CW_CALLBACK CWCachePrecompiledHeader(CWPluginContext context, const CWFileSpec* filespec, CWMemHandle pchhandle); CW_CALLBACK CWLoadObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle* objectdata); CW_CALLBACK CWFreeObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle objectdata); CW_CALLBACK CWStoreObjectData(CWPluginContext context, SInt32 whichfile, CWObjectData* object); CW_CALLBACK CWGetSuggestedObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec); CW_CALLBACK CWGetStoredObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec); CW_CALLBACK CWDisplayLines(CWPluginContext context, SInt32 nlines); CW_CALLBACK CWBeginSubCompile(CWPluginContext context, SInt32 whichfile, CWPluginContext* subContext); CW_CALLBACK CWEndSubCompile(CWPluginContext subContext); CW_CALLBACK CWGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspec, const char *target); CW_CALLBACK CWGetResourceFile(CWPluginContext context, CWFileSpec* filespec); CW_CALLBACK CWPutResourceFile(CWPluginContext context, const char* prompt, const char* name, CWFileSpec* filespec); /* Metrowerks Pascal support */ CW_CALLBACK CWLookUpUnit(CWPluginContext context, const char* name, Boolean isdependency, const void** unitdata, SInt32* unitdatalength); CW_CALLBACK CWSBMfiles(CWPluginContext context, short libref); CW_CALLBACK CWStoreUnit(CWPluginContext context, const char* unitname, CWMemHandle unitdata, CWDependencyTag dependencytag); CW_CALLBACK CWReleaseUnit(CWPluginContext context, void* unitdata); CW_CALLBACK CWUnitNameToFileName(CWPluginContext context, const char* unitname, char* filename); /* obsolete, for MacOS backward compatibility only */ #if CWPLUGIN_API == CWPLUGIN_API_MACOS CW_CALLBACK CWOSAlert(CWPluginContext context, const char* message, OSErr errorcode); CW_CALLBACK CWOSErrorMessage(CWPluginContext context, const char *msg, OSErr errorcode); #endif CW_CALLBACK CWGetModifiedFiles(CWPluginContext context, SInt32* modifiedFileCount, const SInt32** modifiedFiles); /* Get information from the "Runtime Settings" panel */ CW_CALLBACK CWGetCommandLineArgs(CWPluginContext context, const char** commandLineArgs); CW_CALLBACK CWGetWorkingDirectory(CWPluginContext context, CWFileSpec* workingDirectorySpec); CW_CALLBACK CWGetEnvironmentVariableCount(CWPluginContext context, SInt32* count); CW_CALLBACK CWGetEnvironmentVariable(CWPluginContext context, SInt32 index, const char** name, const char** value); CW_CALLBACK CWGetFrameworkCount(CWPluginContext context, SInt32* frameworkCount); CW_CALLBACK CWGetFrameworkInfo(CWPluginContext context, SInt32 whichFramework, CWFrameworkInfo* frameworkInfo); CW_CALLBACK CWGetFrameworkSharedLibrary(CWPluginContext context, SInt32 whichFramework, CWFileSpec* frameworkSharedLibrary); #if CW_USE_PRAGMA_IMPORT #pragma import reset #endif #ifdef __cplusplus } #endif #ifdef _MSC_VER #pragma pack(pop,2) #endif #ifdef __MWERKS__ #pragma options align=reset #endif #endif /* __DROPINCOMPILERLINKER_H__ */ \ No newline at end of file +/* + * DropInCompilerLinker.h - Drop-In Interface for Metrowerks CodeWarrior� Compilers and Linkers + * + * Copyright � 1996 Metrowerks, Inc. All rights reserved. + * + */ + +#ifndef __DROPINCOMPILERLINKER_H__ +#define __DROPINCOMPILERLINKER_H__ + +#ifdef __MWERKS__ +# pragma once +#endif + +#ifndef __CWPlugins_H__ +#include "CWPlugins.h" +#endif + +#ifndef __COMPILERMAPPING_H__ +#include "CompilerMapping.h" +#endif + +#ifdef __MWERKS__ +#pragma options align=mac68k +#endif + +#ifdef _MSC_VER +#pragma pack(push,2) +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +#if CW_USE_PRAGMA_IMPORT +#pragma import on +#endif + + +/* this is the current version number of the API documented herein */ +#define DROPINCOMPILERLINKERAPIVERSION_4 4 +#define DROPINCOMPILERLINKERAPIVERSION_5 5 +#define DROPINCOMPILERLINKERAPIVERSION_6 6 +#define DROPINCOMPILERLINKERAPIVERSION_7 7 +#define DROPINCOMPILERLINKERAPIVERSION_8 8 +#define DROPINCOMPILERLINKERAPIVERSION_9 9 +#define DROPINCOMPILERLINKERAPIVERSION_10 10 +#define DROPINCOMPILERLINKERAPIVERSION_11 11 +#define DROPINCOMPILERLINKERAPIVERSION_12 12 +#define DROPINCOMPILERLINKERAPIVERSION_13 13 +#define DROPINCOMPILERLINKERAPIVERSION DROPINCOMPILERLINKERAPIVERSION_13 + + +/* deprecated request codes */ +enum { + reqInitCompiler = reqInitialize, /* (called when compiler is loaded) */ + reqTermCompiler = reqTerminate, /* (called when compiler is unloaded) */ + reqInitLinker = reqInitialize, /* (called when linker is loaded) */ + reqTermLinker = reqTerminate /* (called when linker is unloaded) */ +}; + +/* request codes (common) */ +enum { + reqTargetCompileEnded = -17, /* Sent when target's compile phase ends */ + reqTargetCompileStarted = -16, /* Sent when target's compile phase starts */ + reqTargetLinkEnded = -15, /* Sent when the link has ended */ + reqTargetLinkStarted = -14, /* Sent when the link starts */ + reqFileListBuildEnded = -13, /* Sent when the group file build ends */ + reqFileListBuildStarted = -12, /* Sent when the group file build starts */ + reqSubProjectBuildEnded = -11, /* Sent when subproject's build ends */ + reqSubProjectBuildStarted = -10, /* Sent when subproject's build starts */ + reqTargetBuildEnded = -9, /* Sent when target's build ends */ + reqTargetBuildStarted = -8, /* Sent when target's build starts */ + reqProjectBuildEnded = -7, /* Sent when project build ends */ + reqProjectBuildStarted = -6, /* Sent when project build starts */ + reqTargetLoaded = -5, /* called when the "keeps target info" flag is set */ + reqTargetPrefsChanged = -4, /* called when the "keeps target info" flag is set */ + reqTargetUnloaded = -3 /* called when the "keeps target info" flag is set */ +}; + +/* requests codes (compilers) */ +enum { + reqCompile = 0, /* compile/precompile/preprocess source file */ + /* and return results */ + reqMakeParse, /* used internally by Metrowerks */ + reqCompDisassemble, /* disassemble a specific file in the project */ + reqCheckSyntax, /* check syntax, but don't generate code */ + reqPreprocessForDebugger /* when preprocess, don't open window w/results */ +}; + +/* requests codes (linkers) */ +enum { + reqLink = 0, /* link project and generate executable or library */ + reqDisassemble, /* disassemble a specific file in the project */ + reqTargetInfo, /* get info about the generated executable */ + reqPreRun /* give linker a last chance to modify target info */ +}; + +/* Returned as part of CWFileInfo to indicate the */ +/* type of data pointed to by the filedata pointer */ +enum { + filetypeText, /* data is text */ + filetypeUnknown /* unknown type, could be precompiled header */ +}; + +/* executable linkage types, used in CWTargetInfo.linkType */ +enum { + exelinkageFlat, /* flat executable */ + exelinkageSegmented, /* uses 68K code segments */ + exelinkageOverlay1 /* uses overlay groups and overlays */ +}; + +/* output file type, used in CWTargetInfo.outputType */ +enum { + linkOutputNone, /* linker produces no output */ + linkOutputFile, /* linker produces a file */ + linkOutputDirectory /* linker produces a directory */ +}; + +/* Constants for the targetCPU field of the CWTargetInfo struct */ +enum { + targetCPU68K = CWFOURCHAR('6','8','k',' '), + targetCPUPowerPC = CWFOURCHAR('p','p','c',' '), + targetCPUi80x86 = CWFOURCHAR('8','0','8','6'), + targetCPUMips = CWFOURCHAR('m','i','p','s'), + targetCPUNECv800 = CWFOURCHAR('v','8','0','0'), + targetCPUEmbeddedPowerPC = CWFOURCHAR('e','P','P','C'), + targetCPUARM = CWFOURCHAR('a','r','m',' '), + targetCPUSparc = CWFOURCHAR('s','p','r','c'), + targetCPUIA64 = CWFOURCHAR('I','A','6','4'), + targetCPUAny = CWFOURCHAR('*','*','*','*'), + targetCPUMCORE = CWFOURCHAR('m','c','o','r'), + targetCPU_Intent = CWFOURCHAR('n','t','n','t') +}; + +/* Constants for the targetOS field of the CWTargetInfo struct */ +enum { + targetOSMacintosh = CWFOURCHAR('m','a','c',' '), + targetOSWindows = CWFOURCHAR('w','i','n','t'), + targetOSNetware = CWFOURCHAR('n','l','m',' '), + targetOSMagicCap = CWFOURCHAR('m','c','a','p'), + targetOSOS9 = CWFOURCHAR('o','s','9',' '), + targetOSEmbeddedABI = CWFOURCHAR('E','A','B','I'), + targetOSJava = CWFOURCHAR('j','a','v','a'), /* java (no VM specification) */ + targetOSJavaMS = CWFOURCHAR('j','v','m','s'), /* Microsoft VM */ + targetOSJavaSun = CWFOURCHAR('j','v','s','n'), /* Sun VM */ + targetOSJavaMRJ = CWFOURCHAR('j','v','m','r'), /* MRJ VM */ + targetOSJavaMW = CWFOURCHAR('j','v','m','w'), /* Metrowerks VM */ + targetOSPalm = CWFOURCHAR('p','a','l','m'), + targetOSGTD5 = CWFOURCHAR('g','t','d','5'), + targetOSSolaris = CWFOURCHAR('s','l','r','s'), + targetOSLinux = CWFOURCHAR('l','n','u','x'), + targetOSAny = CWFOURCHAR('*','*','*','*'), + targetOS_Intent = CWFOURCHAR('n','t','n','t') +}; + +/* linker flags, as used in member dropinflags of DropInFlags struct returned by linkers */ +enum { + cantDisassemble = 1L << 31, /* this linker doesn't support 'Disassemble' */ + isPostLinker = 1L << 30, /* this is a post linker */ + linkAllowDupFileNames = 1L << 29, /* allow multiple project files with the same name */ + linkMultiTargAware = 1L << 28, /* the linker can be used with multiple targets */ + isPreLinker = 1L << 27, /* this is a pre linker */ + linkerUsesTargetStorage = 1L << 26, /* the linker keeps storage per target */ + linkerUnmangles = 1L << 25, /* The linker supports unmangling. */ + magicCapLinker = 1L << 24, /* Pre- or post-linker is used for MagicCap */ + linkAlwaysReload = 1L << 23, /* Always reload the linker before request */ + linkRequiresProjectBuildStartedMsg = 1L << 22, /* Linker listens for a Project Build Started/Ended message */ + linkRequiresTargetBuildStartedMsg = 1L << 21, /* Linker listens for a Target Build Started/Ended message */ + linkRequiresSubProjectBuildStartedMsg = 1L << 20, /* Linker listens for a Sub Project Build Started/Ended message */ + linkRequiresFileListBuildStartedMsg = 1L << 19, /* Linker listens for a File List Build Started/Ended message */ + linkRequiresTargetLinkStartedMsg = 1L << 18, /* Linker listens for a Target Link Started/Ended message */ + linkerWantsPreRunRequest = 1L << 17, /* Linker wants to be sent the pre-run request */ + linkerGetTargetInfoThreadSafe = 1L << 16, /* GetTargetInfo call doesn't use any globals, etc. */ + linkerUsesCaseInsensitiveSymbols = 1L << 15, /* All languages used by linker contain case insensitive browser symbols */ + linkerDisasmRequiresPreprocess = 1L << 14, /* (obsolete) file must be preprocesed before being passed to linker for disasm */ + linkerUsesFrameworks = 1L << 13, /* target uses frameworks; enables framework-style file searching */ + linkerInitializeOnMainThread = 1L << 12 /* The Linker needs to be intialized on the main thread. */ + /* remaining flags are reserved for future use and should be zero-initialized */ +}; + +/* ways to store dependency returned as CWFileSpec in StoreObjectData */ +enum { + cwAccessAbsolute, + cwAccessPathRelative, + cwAccessFileName, + cwAccessFileRelative +}; + +/* specifies what browser information compilers should generate */ +/* they should always generate records for globals and functions */ +typedef struct CWBrowseOptions { + Boolean recordClasses; /* [<-] do we record info for classes */ + Boolean recordEnums; /* [<-] do we record info for enums */ + Boolean recordMacros; /* [<-] do we record info for macros */ + Boolean recordTypedefs; /* [<-] do we record info for typedefs */ + Boolean recordConstants; /* [<-] do we record info for constants */ + Boolean recordTemplates; /* [<-] do we record info for templates */ + Boolean recordUndefinedFunctions; /* [<-] do we record info for undefined functions */ + SInt32 reserved1; /* reserved space */ + SInt32 reserved2; /* reserved space */ +} CWBrowseOptions; + +/* A dependency tag is associated with unit data in the StoreUnitData callback. It should */ +/* change whenever unit data has changed in a way that forces its dependents to be rebuilt. */ +/* Typically, it is just a checksum on the unit data. */ +typedef UInt32 CWDependencyTag; + +/* dependency information passed back in StoreObjectData */ +typedef struct CWDependencyInfo { + SInt32 fileIndex; /* Another project entry. -1 => use fileSpec */ + CWFileSpec fileSpec; /* location of file. Only used if fileIndex < 0 */ + short fileSpecAccessType; /* One of cwAccessAbsolute, etc. above. Only */ + /* used is specifying via fileSpec. */ + short dependencyType; /* cwNormalDependency or cwInterfaceDependency. */ + /* Values defined in CWPlugins.h */ +} CWDependencyInfo; + +/* information used when calling StoreObjectData */ +typedef struct CWObjectData { + CWMemHandle objectdata; /* Handle to generated object code, */ + /* resource data, or preprocessed text */ + CWMemHandle browsedata; /* Handle to generated browse data */ + SInt32 reserved1; /* reserved for future use, set to zero */ + SInt32 codesize; /* size of generated code */ + SInt32 udatasize; /* size of uninitialized data */ + SInt32 idatasize; /* size of initialized data */ + SInt32 compiledlines; /* number of lines of source compiled */ + Boolean interfaceChanged; /* recompile interface dependents? */ + SInt32 reserved2; /* reserved for future use, set to zero */ + void* compilecontext; /* used internally by Metrowerks */ + CWDependencyInfo* dependencies; /* optional array of dependencies */ + short dependencyCount; /* overrides those collected by IDE */ + CWFileSpec* objectfile; /* external object code file (i.e. .o file) */ +} CWObjectData; + + +/* characteristics of a link target */ +typedef struct CWTargetInfo { + short outputType; /* outputs file, directory, or nothing */ + CWFileSpec outfile; /* generated executable file/folder spec */ + CWFileSpec symfile; /* generated debug file spec */ + CWFileSpec runfile; /* file to run, can be same or different from outfile */ + short linkType; /* flat, segmented, or overlays */ + Boolean canRun; /* "Run" can be performed on this target */ + Boolean canDebug; /* "Run with Debugger" can be performed on this target */ + CWDataType targetCPU; /* target CPU architecture (e.g. 68K, PowerPC, x86, MIPS)*/ + CWDataType targetOS; /* target OS (e.g. MacOS, Windows, Unix) */ + +#if CWPLUGIN_HOST == CWPLUGIN_HOST_MACOS + OSType outfileCreator; /* file creator, if outputType == linkOutputFile */ + OSType outfileType; /* file type, if outputType == linkOutputFile */ + OSType debuggerCreator; /* file creator of debugger for this target */ + OSType runHelperCreator; /* creator of helper app to use when running this file. */ +#endif +#if CWPLUGIN_HOST == CWPLUGIN_HOST_WIN32 + Boolean runHelperIsRegKey; /* true if runHelperName is a registry key */ + Boolean debugHelperIsRegKey;/* true if debugHelperName is a registry key */ + char args[512]; /* command line arguments */ + char runHelperName[512]; /* full path to the run helper executable or a reg key */ + Boolean runHelperRequiresURL;/* Indicates whether the outfile must be converted to */ + /* a file scheme URL before being passed to the run */ + /* helper app */ + char reserved2; + char debugHelperName[512];/* full path to the debug helper executable or a reg key*/ +#endif + +// We need the args for Solaris +#if (CWPLUGIN_HOST == CWPLUGIN_HOST_SOLARIS || CWPLUGIN_HOST == CWPLUGIN_HOST_LINUX) + char args[512]; /* command line arguments */ + char runHelperName[512]; /* Relative path name from (Helper Apps) to run helper program */ + Boolean runHelperRequiresURL; /* Indicates whether the outfile must be converted to */ + /* a file scheme URL before being passed to the run */ + /* helper app */ + char reserved2[3]; + char debugHelperName[512]; /* Relative path name from (Helper Apps) to debug helper */ + + +#endif + + CWFileSpec linkAgainstFile; /* file parent targets link against (e.g. lib file) */ +} CWTargetInfo; + +typedef struct CWUnmangleInfo { + void* targetStorage; + const char* mangledName; + char* unmangleBuff; + SInt32 unmangleBuffSize; + unsigned short browserClassID; + unsigned char browserLang; + unsigned char filler1; +} CWUnmangleInfo; + + +/* Types used to get compiler-specific browser symbol information. */ +typedef struct CWCompilerBrSymbol { + char symName[32]; + char symUIName[32]; +} CWCompilerBrSymbol; + + +typedef struct CWCompilerBrSymbolList { + short count; + CWCompilerBrSymbol items[1]; +} CWCompilerBrSymbolList; + +typedef struct CWCompilerBrSymbolInfo { + void* targetStorage; + CWCompilerBrSymbolList* symList; /* [<-] Compiler should put a pointer to the read-only list here.*/ +} CWCompilerBrSymbolInfo; + +typedef struct CWFrameworkInfo { + CWFileSpec fileSpec; /* location of ".framework" directory */ + char version[256]; /* which version directory to use; if empty use "Current" sym link */ +} CWFrameworkInfo; + +/*** Declaration of plugin entry points that must be implemented by non-MacOS plugins ***/ +/*** It can also be implemented by a MacOS plugin to override the 'Targ' resource ***/ + +CWPLUGIN_ENTRY (CWPlugin_GetTargetList)(const struct CWTargetList**); + +/*** Optional entry points ***/ + +CWPLUGIN_ENTRY (CWPlugin_GetDefaultMappingList)(const struct CWExtMapList**); +CWPLUGIN_ENTRY (Helper_Unmangle)(CWUnmangleInfo*); +CWPLUGIN_ENTRY (Helper_GetCompilerBrSymbols)(CWCompilerBrSymbolInfo*); + +/*** callbacks to the IDE, in addition to those in CWPlugins.h ***/ + +CW_CALLBACK CWIsPrecompiling(CWPluginContext context, Boolean* isPrecompiling); +CW_CALLBACK CWIsAutoPrecompiling(CWPluginContext context, Boolean* isAutoPrecompiling); +CW_CALLBACK CWIsPreprocessing(CWPluginContext context, Boolean* isPreprocessing); +CW_CALLBACK CWIsGeneratingDebugInfo(CWPluginContext context, Boolean* isGenerating); +CW_CALLBACK CWIsCachingPrecompiledHeaders(CWPluginContext context, Boolean* isCaching); +CW_CALLBACK CWGetBrowseOptions(CWPluginContext context, CWBrowseOptions* browseOptions); +CW_CALLBACK CWGetBuildSequenceNumber(CWPluginContext context, SInt32* sequenceNumber); +CW_CALLBACK CWGetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo); +CW_CALLBACK CWSetTargetInfo(CWPluginContext context, CWTargetInfo* targetInfo); + +CW_CALLBACK CWGetTargetStorage(CWPluginContext context, void** storage); +CW_CALLBACK CWSetTargetStorage(CWPluginContext context, void* storage); + +CW_CALLBACK CWGetMainFileNumber(CWPluginContext context, SInt32* fileNumber); +CW_CALLBACK CWGetMainFileID(CWPluginContext context, short* fileID); +CW_CALLBACK CWGetMainFileSpec(CWPluginContext context, CWFileSpec* fileSpec); +CW_CALLBACK CWGetMainFileText(CWPluginContext context, const char** text, SInt32* textLength); + +CW_CALLBACK CWCachePrecompiledHeader(CWPluginContext context, const CWFileSpec* filespec, CWMemHandle pchhandle); + +CW_CALLBACK CWLoadObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle* objectdata); +CW_CALLBACK CWFreeObjectData(CWPluginContext context, SInt32 whichfile, CWMemHandle objectdata); +CW_CALLBACK CWStoreObjectData(CWPluginContext context, SInt32 whichfile, CWObjectData* object); +CW_CALLBACK CWGetSuggestedObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec); +CW_CALLBACK CWGetStoredObjectFileSpec(CWPluginContext context, SInt32 whichfile, CWFileSpec* fileSpec); + +CW_CALLBACK CWDisplayLines(CWPluginContext context, SInt32 nlines); + +CW_CALLBACK CWBeginSubCompile(CWPluginContext context, SInt32 whichfile, CWPluginContext* subContext); +CW_CALLBACK CWEndSubCompile(CWPluginContext subContext); + +CW_CALLBACK CWGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspec, const char *target); +CW_CALLBACK CWGetResourceFile(CWPluginContext context, CWFileSpec* filespec); +CW_CALLBACK CWPutResourceFile(CWPluginContext context, const char* prompt, const char* name, CWFileSpec* filespec); + +/* Metrowerks Pascal support */ +CW_CALLBACK CWLookUpUnit(CWPluginContext context, const char* name, Boolean isdependency, const void** unitdata, SInt32* unitdatalength); +CW_CALLBACK CWSBMfiles(CWPluginContext context, short libref); +CW_CALLBACK CWStoreUnit(CWPluginContext context, const char* unitname, CWMemHandle unitdata, CWDependencyTag dependencytag); +CW_CALLBACK CWReleaseUnit(CWPluginContext context, void* unitdata); +CW_CALLBACK CWUnitNameToFileName(CWPluginContext context, const char* unitname, char* filename); + + /* obsolete, for MacOS backward compatibility only */ +#if CWPLUGIN_API == CWPLUGIN_API_MACOS +CW_CALLBACK CWOSAlert(CWPluginContext context, const char* message, OSErr errorcode); +CW_CALLBACK CWOSErrorMessage(CWPluginContext context, const char *msg, OSErr errorcode); +#endif + +CW_CALLBACK CWGetModifiedFiles(CWPluginContext context, SInt32* modifiedFileCount, const SInt32** modifiedFiles); + +/* Get information from the "Runtime Settings" panel */ +CW_CALLBACK CWGetCommandLineArgs(CWPluginContext context, const char** commandLineArgs); +CW_CALLBACK CWGetWorkingDirectory(CWPluginContext context, CWFileSpec* workingDirectorySpec); +CW_CALLBACK CWGetEnvironmentVariableCount(CWPluginContext context, SInt32* count); +CW_CALLBACK CWGetEnvironmentVariable(CWPluginContext context, SInt32 index, const char** name, const char** value); + +CW_CALLBACK CWGetFrameworkCount(CWPluginContext context, SInt32* frameworkCount); +CW_CALLBACK CWGetFrameworkInfo(CWPluginContext context, SInt32 whichFramework, CWFrameworkInfo* frameworkInfo); +CW_CALLBACK CWGetFrameworkSharedLibrary(CWPluginContext context, SInt32 whichFramework, CWFileSpec* frameworkSharedLibrary); + +#if CW_USE_PRAGMA_IMPORT +#pragma import reset +#endif + +#ifdef __cplusplus + } +#endif + +#ifdef _MSC_VER +#pragma pack(pop,2) +#endif + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif /* __DROPINCOMPILERLINKER_H__ */ diff --git a/sdk_hdrs/DropInPanel.h b/sdk_hdrs/DropInPanel.h deleted file mode 100755 index edee6e2..0000000 --- a/sdk_hdrs/DropInPanel.h +++ /dev/null @@ -1 +0,0 @@ -/* * DropInPanel.h - Drop-In Preferences Panel Interface for Metrowerks CodeWarriorª * * Copyright © 1995 Metrowerks, Inc. All rights reserved. * */ #ifndef __DROPINPANEL_H__ #define __DROPINPANEL_H__ #ifdef __MWERKS__ # pragma once #endif #ifndef CW_STRICT_DIALOGS # define CW_STRICT_DIALOGS 0 #endif #if macintosh #ifndef F_PASCAL # define F_PASCAL(x) pascal x #endif #elif __sun__ || __linux__ #ifndef F_PASCAL # define F_PASCAL(x) x #endif #endif /* system headers */ #ifndef __APPLEEVENTS__ # include #endif #ifndef __CONTROLS__ # include #endif #ifndef __DIALOGS__ # include #endif #ifndef __DRAG__ # include #endif #ifndef __CWPlugins_H__ # include "CWPlugins.h" #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif #if CW_USE_PRAGMA_IMPORT #pragma import on #endif /* this is the current version number of the API documented herein */ #define DROPINPANELAPIVERSION_1 1 /* CW7 API version */ #define DROPINPANELAPIVERSION_2 2 /* intermediate version */ #define DROPINPANELAPIVERSION_3 3 /* CW8 API version */ #define DROPINPANELAPIVERSION_4 4 /* CW9 API version */ #define DROPINPANELAPIVERSION_5 5 /* CW10-CW Pro 1 version */ #define DROPINPANELAPIVERSION_6 6 /* CW Pro 2 version */ #define DROPINPANELAPIVERSION_7 7 /* CW Pro 3 version */ #define DROPINPANELAPIVERSION_8 8 /* CW Pro 4 version */ #define DROPINPANELAPIVERSION_9 9 /* CW Pro 5 version */ #define DROPINPANELAPIVERSION_10 10 /* CW Pro 6 version */ #define DROPINPANELAPIVERSION_11 11 /* CW Pro 7 version (listView Support) */ #define DROPINPANELAPIVERSION DROPINPANELAPIVERSION_11 /* current API version */ /* error codes */ #define kBadPrefVersion 1000 #define kMissingPrefErr 1001 #define kSettingNotFoundErr 1002 #define kSettingTypeMismatchErr 1003 #define kInvalidCallbackErr 1004 #define kSettingOutOfRangeErr 1005 /* requests codes */ enum { reqInitPanel = -2, /* (called when panel is loaded) */ reqTermPanel = -1, /* (called when panel is unloaded) */ reqInitDialog = 0, /* initialize panel's dialog state */ reqTermDialog, /* clean up panel's dialog state */ reqPutData, /* copy options data to dialog items */ reqGetData, /* copy dialog items to options data */ reqFilter, /* filter a dialog event for the panel */ reqItemHit, /* process an itemHit in the panel */ reqAEGetPref, /* get preference setting for AppleEvent request */ reqAESetPref, /* set preference setting from AppleEvent request */ reqValidate, /* tell if current settings force recompile or relink */ reqGetFactory, /* retrieve factory settings */ reqUpdatePref, /* verify and/or modify prefs to fit current version */ reqUpdateProject, /* (only sent to built-in panels) */ reqSetupDebug, /* change settings to reflect debugging status */ reqRenameProject, /* change settings that depend on project name */ reqPrefsLoaded, /* (only sent to built-in panels) */ reqDrawCustomItem, /* draw a custom item */ reqActivateItem, /* activate a custom item */ reqDeactivateItem, /* deactivate a custom item */ reqHandleClick, /* handle mouse down in an active custom item */ reqHandleKey, /* handle key down in an active custom item */ reqFindStatus, /* enable/disable menu items for a custom item */ reqObeyCommand, /* execute a menu command for a custom item */ reqDragEnter, /* the user is dragging into the given item */ reqDragWithin, /* the user is dragging within the given item */ reqDragExit, /* the user is dragging out of the given item */ reqDragDrop, /* the user dropped onto the given item */ reqByteSwapData, /* byte swap the fields in the prefs data */ reqFirstLoad, /* panel has been loaded for the first time */ reqReadSettings, /* read settings from IDE to construct pref data handle */ reqWriteSettings, /* write the individual settings from pref data handle */ reqItemDoubleClick, /* process an double clicked in the panel, currently implemented for listviews */ reqItemIsCellEditable /* currently implemented for listviews, tells whether or not the listview is editable */ }; /* menu command codes */ enum { menu_Cut = 1, menu_Copy, menu_Paste, menu_Clear, menu_SelectAll }; /* Layout and bit flags for 'Flag' resource for panels */ /* */ /* For the version 3 of these resource, we renamed the 'apiversion' field to */ /* 'earliestCompatibleAPIVersion' and added the 'newestAPIVersion' field. */ /* This allows plugins to support more than one API version and therefore run */ /* under more than one version of the IDE. */ typedef struct PanelFlags { unsigned short rsrcversion; /* version number of resource */ CWDataType dropintype; /* dropin type ('Comp', 'Link', 'Panl') */ /* earliest API support by this plugin */ unsigned short earliestCompatibleAPIVersion; unsigned long dropinflags; /* capability flags (see enum below) */ CWDataType panelfamily; /* family of panel (linker, codegen, etc) */ unsigned short newestAPIVersion; /* newest API version supported */ unsigned short dataversion; /* version number of prefs data */ unsigned short panelscope; /* scope of panel (see enum below) */ } PanelFlags; /* capability flags, as used in member dropinflags of PanelFlags struct */ enum { usesStrictAPI = 1 << 31, /* this panel is built with the strict API */ supportsByteSwapping = 1 << 30, /* this panel support the byte-swapping request */ supportsTextSettings = 1 << 29, /* this panel supports the read & write settings requests */ usesCrossPlatformAPI = 1 << 28 /* uses the cross-platform API rather than Mac API */ /* remaining flags are reserved for future use and should be zero-initialized */ }; /* panel scopes, as used in member panelscope of PanelFlags struct */ /* */ /* The scope of a panel tells the IDE which settings window to display the panel. */ /* Currently, only panels for debugger plug-ins use panelScopeGlobal and only */ /* panels for VCS plug-ins use panelScopeProject. A panel for a compiler or linker */ /* must use panelScopeTarget. */ enum { panelScopeGlobal, /* this panel is scoped to the global preferences window */ panelScopeProject, /* this panel is scoped to the VCS settings window */ panelScopeTarget, /* this panel is scoped to the target settings window */ panelScopeRConn /* this panel is scoped to configure remote debugging connections */ }; /* pre-defined panel families, used in panelfamily field of PanelFlags struct */ enum { panelFamilyProject = CWFOURCHAR('p', 'r', 'o', 'j'), panelFamilyFrontEnd = CWFOURCHAR('f', 'e', 'n', 'd'), panelFamilyBackEnd = CWFOURCHAR('b', 'e', 'n', 'd'), panelFamilyBrowser = CWFOURCHAR('b', 'r', 'o', 'w'), panelFamilyEditor = CWFOURCHAR('e', 'd', 'i', 't'), panelFamilyDebugger = CWFOURCHAR('d', 'b', 'u', 'g'), panelFamilyLinker = CWFOURCHAR('l', 'i', 'n', 'k'), panelFamilyMisc = CWFOURCHAR('*', '*', '*', '*') }; typedef struct MWSetting* CWSettingID; #define kNoSettingID 0 /* alias types */ #if CW_STRICT_DIALOGS typedef struct DummyDialog* CWDialog; #else typedef DialogPtr CWDialog; #endif /* forward declarations */ typedef struct CWPanelCallbacks CWPanelCallbacks; /* parameter block -- this is passed to the dropin at each request */ typedef struct PanelParameterBlock { /* common to all dropins */ long request; /* [->] requested action (see below) */ long version; /* [->] version # of shell's API */ void *context; /* [->] reserved for use by shell */ void *storage; /* [<->] reserved for use by the dropin */ FSSpec targetfile; /* [->] FSSpec of current project */ /* specific to panels */ CWDialog dialog; /* [->] pointer to PreferencesÉ dialog */ Handle originalPrefs; /* [->] panel's original options data */ Handle currentPrefs; /* [<->] panel's current options data */ Handle factoryPrefs; /* [<->] panel's "factory" options data */ EventRecord *event; /* [->] dialog event (for reqFilterEvent) */ short baseItems; /* [->] # of items in dialog shell */ short itemHit; /* [<->] for reqFilterEvent and reqItemHit */ Boolean canRevert; /* [<-] enable Revert button */ Boolean canFactory; /* [<-] enable Factory button */ Boolean reset; /* [<-] access paths must be reset */ Boolean recompile; /* [<-] files must be recompiled */ Boolean relink; /* [<-] project must be relinked */ AEKeyword prefsKeyword; /* [->] for reqAEGetPref and reqAESetPref */ AEDesc prefsDesc; /* [->] for reqAESetPref */ Boolean debugOn; /* [->] turning on debugging? */ FSSpec oldtargfile; /* [->] previous project file FSSpec */ /* version 2 API */ CWPanelCallbacks* callbacks; /* version 3 API */ Boolean reparse; /* [<-] project must be reparsed */ /* version 4 API */ DragReference dragref; /* [->] for drag-related requests */ Rect dragrect; /* [<-] rect to track mouse in */ Point dragmouse; /* [->] mouse location during drag */ /* version 5 API */ unsigned char toEndian; /* [->] for reqByteSwapData, the endian we are swapping to */ /* CWPro 3 temporary placeholders for opaque references to prefs data. These will be removed in Pro 4. */ CWMemHandle originalPrefsMemHandle; CWMemHandle currentPrefsMemHandle; CWMemHandle factoryPrefsMemHandle; CWMemHandle panelPrefsMemHandle; /* version 11 api */ long listViewCellRow; /* [->] the cell row of the listView */ long listViewCellCol; /* [->] the cell row of the listView */ } PanelParameterBlock, *PanelParameterBlockPtr; typedef PanelParameterBlock PanelParamBlk; typedef PanelParameterBlockPtr PanelParamBlkPtr; /* callbacks to the IDE */ extern F_PASCAL(OSErr) CWPanlAppendItems(PanelParamBlkPtr ppb, short ditlID); extern F_PASCAL(OSErr) CWPanlDrawPanelBox(PanelParamBlkPtr ppb, long whichItem, ConstStr255Param title); extern F_PASCAL(OSErr) CWPanlShowItem(PanelParamBlkPtr ppb, long whichItem, Boolean showIt); extern F_PASCAL(OSErr) CWPanlEnableItem(PanelParamBlkPtr ppb, long whichItem, Boolean enableIt); extern F_PASCAL(OSErr) CWPanlActivateItem(PanelParamBlkPtr ppb, long whichItem); extern F_PASCAL(OSErr) CWPanlGetItemValue(PanelParamBlkPtr ppb, long whichItem, long* value); extern F_PASCAL(OSErr) CWPanlSetItemValue(PanelParamBlkPtr ppb, long whichItem, long value); extern F_PASCAL(OSErr) CWPanlGetItemText(PanelParamBlkPtr ppb, long whichItem, StringPtr str, short maxLen); extern F_PASCAL(OSErr) CWPanlSetItemText(PanelParamBlkPtr ppb, long whichItem, ConstStr255Param str); extern F_PASCAL(OSErr) CWPanlGetPanelPrefs(PanelParamBlkPtr ppb, StringPtr inPanelName, Handle *prefs, Boolean* requiresByteSwap); extern F_PASCAL(OSErr) CWPanlGetItemRect(PanelParamBlkPtr ppb, long whichItem, Rect* rect); extern F_PASCAL(OSErr) CWPanlGetItemControl(PanelParamBlkPtr ppb, long whichItem, ControlRef* control); extern F_PASCAL(OSErr) CWPanlInvalItem(PanelParamBlkPtr ppb, long whichItem); extern F_PASCAL(OSErr) CWPanlValidItem(PanelParamBlkPtr ppb, long whichItem); extern F_PASCAL(OSErr) CWPanlGetMacPort(PanelParamBlkPtr ppb, GrafPtr* port); extern F_PASCAL(OSErr) CWPanlGetItemTextHandle(PanelParamBlkPtr ppb, long whichItem, Handle *text); extern F_PASCAL(OSErr) CWPanlSetItemTextHandle(PanelParamBlkPtr ppb, long whichItem, Handle text); extern F_PASCAL(OSErr) CWPanlGetItemData(PanelParamBlkPtr ppb, long whichItem, void *outData, long *outDataLength); extern F_PASCAL(OSErr) CWPanlSetItemData(PanelParamBlkPtr ppb, long whichItem, void *inData, long inDataLength); extern F_PASCAL(OSErr) CWPanlGetItemMaxLength(PanelParamBlkPtr ppb, long whichItem, short *outLength); extern F_PASCAL(OSErr) CWPanlSetItemMaxLength(PanelParamBlkPtr ppb, long whichItem, short inLength); extern F_PASCAL(OSErr) CWPanlChooseRelativePath(PanelParamBlkPtr ppb, CWRelativePath* path, Boolean isFolder, short filterCount, void* filterList, char* prompt); extern F_PASCAL(OSErr) CWPanlGetRelativePathString(PanelParamBlkPtr ppb, CWRelativePath* path, char* pathString, long* maxLength); #if macintosh extern F_PASCAL(OSErr) CWPanlReadRelativePathAEDesc(PanelParamBlkPtr ppb, CWRelativePath* path, const AEDesc* desc); extern F_PASCAL(OSErr) CWPanlWriteRelativePathAEDesc(PanelParamBlkPtr ppb, const CWRelativePath* path, AEDesc* desc); #endif /* utility routines */ extern F_PASCAL(OSErr) CWPanlDrawUserItemBox(DialogPtr dialog, short whichItem, ConstStr255Param title); extern F_PASCAL(OSErr) CWPanlInstallUserItem(PanelParamBlkPtr ppb, short whichItem, UserItemProcPtr proc); extern F_PASCAL(OSErr) CWPanlRemoveUserItem(PanelParamBlkPtr ppb, short whichItem); /* reading and writing scalar settings */ extern F_PASCAL(OSErr) CWPanlReadBooleanSetting(PanelParamBlkPtr ppb, const char* name, Boolean* value); extern F_PASCAL(OSErr) CWPanlReadIntegerSetting(PanelParamBlkPtr ppb, const char* name, long* value); extern F_PASCAL(OSErr) CWPanlReadFloatingPointSetting(PanelParamBlkPtr ppb, const char* name, double* value); extern F_PASCAL(OSErr) CWPanlReadStringSetting(PanelParamBlkPtr ppb, const char* name, const char** value); extern F_PASCAL(OSErr) CWPanlReadRelativePathSetting(PanelParamBlkPtr ppb, const char* name, CWRelativePath* value); extern F_PASCAL(OSErr) CWPanlWriteBooleanSetting(PanelParamBlkPtr ppb, const char* name, Boolean value); extern F_PASCAL(OSErr) CWPanlWriteIntegerSetting(PanelParamBlkPtr ppb, const char* name, long value); extern F_PASCAL(OSErr) CWPanlWriteFloatingPointSetting(PanelParamBlkPtr ppb, const char* name, double value); extern F_PASCAL(OSErr) CWPanlWriteStringSetting(PanelParamBlkPtr ppb, const char* name, const char* value); extern F_PASCAL(OSErr) CWPanlWriteRelativePathSetting(PanelParamBlkPtr ppb, const char* name, const CWRelativePath* value); /* reading and writing array and structure settings */ extern F_PASCAL(OSErr) CWPanlGetNamedSetting(PanelParamBlkPtr ppb, const char* name, CWSettingID* settingID); extern F_PASCAL(OSErr) CWPanlGetStructureSettingField(PanelParamBlkPtr ppb, CWSettingID settingID, const char* name, CWSettingID* fieldSettingID); extern F_PASCAL(OSErr) CWPanlGetArraySettingSize(PanelParamBlkPtr ppb, CWSettingID settingID, long* size); extern F_PASCAL(OSErr) CWPanlGetArraySettingElement(PanelParamBlkPtr ppb, CWSettingID settingID, long index, CWSettingID* elementSettingID); extern F_PASCAL(OSErr) CWPanlGetBooleanValue(PanelParamBlkPtr ppb, CWSettingID settingID, Boolean* value); extern F_PASCAL(OSErr) CWPanlGetIntegerValue(PanelParamBlkPtr ppb, CWSettingID settingID, long* value); extern F_PASCAL(OSErr) CWPanlGetFloatingPointValue(PanelParamBlkPtr ppb, CWSettingID settingID, double* value); extern F_PASCAL(OSErr) CWPanlGetStringValue(PanelParamBlkPtr ppb, CWSettingID settingID, const char** value); extern F_PASCAL(OSErr) CWPanlGetRelativePathValue(PanelParamBlkPtr ppb, CWSettingID settingID, CWRelativePath* value); extern F_PASCAL(OSErr) CWPanlSetBooleanValue(PanelParamBlkPtr ppb, CWSettingID settingID, Boolean value); extern F_PASCAL(OSErr) CWPanlSetIntegerValue(PanelParamBlkPtr ppb, CWSettingID settingID, long value); extern F_PASCAL(OSErr) CWPanlSetFloatingPointValue(PanelParamBlkPtr ppb, CWSettingID settingID, double value); extern F_PASCAL(OSErr) CWPanlSetStringValue(PanelParamBlkPtr ppb, CWSettingID settingID, const char* value); extern F_PASCAL(OSErr) CWPanlSetRelativePathValue(PanelParamBlkPtr ppb, CWSettingID settingID, const CWRelativePath* value); #if CW_USE_PRAGMA_IMPORT #pragma import reset #endif #ifdef __cplusplus } #endif #ifdef __MWERKS__ #pragma options align=reset #endif #ifdef _MSC_VER #pragma pack(pop) #endif #endif /* __DROPINPANEL_H__ */ \ No newline at end of file diff --git a/sdk_hdrs/DropInPanelWin32.h b/sdk_hdrs/DropInPanelWin32.h deleted file mode 100755 index 98d0c8a..0000000 --- a/sdk_hdrs/DropInPanelWin32.h +++ /dev/null @@ -1 +0,0 @@ -/* DropInPanelWin32.h This is the old name for the file that is now called CWDropInPanel.h. It is here for backward compatibility with older panels. New panels should include CWDropInPanel.h instead. */ #ifndef __DROPINPANELWIN32_H__ #define __DROPINPANELWIN32_H__ #include "CWDropInPanel.h" #endif \ No newline at end of file diff --git a/sdk_hdrs/DropInVCS.h b/sdk_hdrs/DropInVCS.h deleted file mode 100755 index 6124933..0000000 --- a/sdk_hdrs/DropInVCS.h +++ /dev/null @@ -1 +0,0 @@ -/* DropInVCS.h Copyright (c) 1996-8, Metrowerks Corporation. All rights reserved. This include contains the declarations needed to interface a version control system to the CodeWarrior integrated development environment. */ #ifndef __DROPINVCS_H__ #define __DROPINVCS_H__ #ifdef macintosh #include #include #endif #define VCS_API_VERSION_1 1 // 1.7 IDE through Pro 3 #define VCS_API_VERSION_7 7 // Pro 4 #define VCS_API_VERSION_8 8 // Pro 5 #define VCS_API_VERSION_9 9 // Pro 6 #define VCS_API_CURRENT_VERSION VCS_API_VERSION_9 #ifndef __CWPlugins_H__ #include "CWPlugins.h" #endif #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifndef __CWPluginErrors_H__ #include "CWPluginErrors.h" #endif #ifdef MW_USES_PRAGMA_ONCE #pragma once #endif #ifdef __cplusplus extern "C" { #endif #if CW_USE_PRAGMA_IMPORT #pragma import on #endif // The following constants are to be used when specifying the flags through a // flags callback. For version 3 flags. enum { vcsDoesntPrePostSingleFile = 1L << 31, /* this VCS plugin does NOT call Pre/PostFileAction routines for calls dealing with a single file (file must be accessible before call) */ vcsDoesntPrePostRecursive = 1L << 30, /* this VCS plugin does NOT call Pre/PostFileAction routines for files during recursive calls (files must be accessible before call) */ vcsRequiresEvents = 1L << 29, /* this flag specifies that the VCS is responding to either AppleEvents or other highLevelEvents and the IDE should not try to handle events during callbacks */ vcsWantsIdle = 1L << 28, /* this flag is turned on when the VCS plugin wants to receive idle events */ vcsSupportsPrefsChanged = 1L << 27, /* this flag is turned on when the VCS plugin supports the reqPrefsChanged request */ vcsDoesntUseLoginSettings = 1L << 26, /* this VCS plugin does not use the login settings in the VCS Setup panel */ vcsDoesntUseDatabaseSetting = 1L << 25, /* this VCS plugin does not use the database path setting in the VCS Setup panel */ vcsDoesntUseLocalRootSetting = 1L << 24 /* this VCS plugin does not use the local root setting in the VCS Setup panel */ }; enum { reqDatabaseConnect = 1, // connect to database reqDatabaseDisconnect, // disconnect from database reqDatabaseVariables, // database variables list reqFileAdd, // add file reqFileCheckin, // checkin file reqFileCheckout, // checkout file reqFileComment, // set file comment reqFileDelete, // delete file reqFileDestroy, // destroy file reqFileDifference, // difference file reqFileGet, // get file reqFileHistory, // get file history reqFileLabel, // label file reqFileProperties, // get file properties reqFilePurge, // purge file reqFileRename, // rename file reqFileRollback, // rollback file reqFileStatus, // get file status reqFileUndoCheckout, // cancel file checkout reqFileVersion, // get file version reqFileBranch, // branch a shared file reqFileShare, // share a file reqFileView // view a file }; typedef long CWVCSCommand; enum { cwCommandStatusCommandUnknown = -4, // command unknown cwCommandStatusUnknown = -3, // status unknown cwCommandStatusUnsupported = -2, // command unsupported cwCommandStatusSupported = -1, // command supported cwCommandStatusSucceeded = cwNoErr, // successful cwCommandStatusFailed = 1, // failed cwCommandStatusPartial = 2, // partially successful cwCommandStatusCancelled = 3, // user cancelled cwCommandStatusConnectionLost = 4, // connection lost cwCommandStatusInvalidLogin = 5 // invalid username or password }; typedef long CWVCSCommandStatus; enum { cwItemStatusUnprocessed = -2, // item yet unprocessed cwItemStatusUnknown = -1, // status unknown cwItemStatusSucceeded = 0, // operation succeeded cwItemStatusFailed = 1, // operation failed cwItemStatusCancelled = 2 // operation cancelled }; typedef long CWVCSItemStatus; enum { cwCheckoutStateUnknown = 0xFFFFFFFF, // unknown cwCheckoutStateNotInDatabase = 0x00000002, // not in database cwCheckoutStateNotCheckedOut = 0x00000000, // not checked out cwCheckoutStateCheckedOut = 0x00000001, // checked out cwCheckoutStateMultiplyCheckedOut = 0x00000101, // multiply checked out cwCheckoutStateNotCheckedOutShared = 0x00010000, // not checked out and shared cwCheckoutStateCheckedOutShared = 0x00010001, // checked out and shared cwCheckoutStateMultiplyCheckedOutShared = 0x00010101, // multiply checked out and shared cwCheckoutStateNotCheckedOutBranched = 0x00020000, // not checked out and branched cwCheckoutStateCheckedOutBranched = 0x00020001, // checked out and branched cwCheckoutStateMultiplyCheckedOutBranched = 0x00020101, // checked out and branched cwCheckoutStateNotCheckedOutSharedBranched = 0x00030000, // not checked out, shared and branched cwCheckoutStateCheckedOutSharedBranched = 0x00030001, // checked out, shared and branched cwCheckoutStateMultiplyCheckedSharedOutBranched = 0x00030101, // checked out, shared and branched cwCheckoutStateCheckedOutExclusive = 0x00040001, // exclusively checked out cwCheckoutStateCheckedOutExclusiveShared = 0x00050001, // exclusively checked out and shared cwCheckoutStateCheckedOutExclusiveBranched = 0x00060001, // exclusively checked out and branched cwCheckoutStateCheckedOutExclusiveSharedBranched = 0x00070001, // exclusively checked out, shared and branched cwCheckoutStateCheckedOutMask = 0x00000001, // checked out mask cwCheckoutStateMultiplyCheckedOutMask = 0x00000100, // multiply checked out mask cwCheckoutStateSharedMask = 0x00010000, // shared mask cwCheckoutStateBranchedMask = 0x00020000, // branched mask cwCheckoutStateExclusiveMask = 0x00040000 // exclusive mask }; typedef long CWVCSCheckoutState; enum { cwVersionFormNone = 0, // no record cwVersionFormNumeric = 1, // intergral numeric cwVersionFormAlpha = 2, // alphabetic cwVersionFormLabel = 4, // label cwVersionFormDate = 5 // date / time }; typedef long CWVCSVersionForm; enum { cwCommandDescriptionVersion = 1 }; typedef struct CWVCSCommandDescription { long version; char menuItem[40]; char progressMessage[200]; } CWVCSCommandDescription; typedef union CWVCSVersionData { unsigned long numeric; // integral numeric char* pAlpha; // alphabetic CWFileTime date; // date / time char* pLabel; // label } CWVCSVersionData, *p_CWVCSVersionData, **h_CWVCSVersionData; typedef struct CWVCSVersion { CWVCSVersionForm eVersionForm; // version form CWVCSVersionData sVersionData; // version data } CWVCSVersion, *p_CWVCSVersion, **h_CWVCSVersion; typedef struct CWVCSItem { CWFileSpec fsItem; // item file specification CWVCSItemStatus eItemStatus; // item status code CWVCSVersion version; // item version CWVCSCheckoutState eCheckoutState; // item checkout state } CWVCSItem, *p_CWVCSItem, **h_CWVCSItem; typedef struct CWVCSDatabaseConnection { CWFileSpec sDatabasePath; // path to the database directory CWFileSpec sProjectRoot; // path to the local database directory char* pUsername; // user name char* pPassword; // user password } CWVCSDatabaseConnection, *p_CWVCSDatabaseConnection, **h_CWVCSDatabaseConnection; /* The following callback mechanisms are available for VCS plugins for VCS performing VCS specific * functions and retrieving VCS specific data from the context passed to the main entry point by the * IDE. You may also use any of the callbacks for generic plugins. * * These callbacks are available only to plugins using version 2 of the API or greater. */ /* Call this function as the first thing you do in your main entry point. Check its result. If you pass in * true, then if the v2 plugin is running under a pre-Pro4 IDE it will set up the compatibillity libraries and * return cwNoErr. If you pass in false and your v2 plugin is running uner a pre-Pro4 IDE it will return * cwCommandStatusFailed, at which point you should return this error to the IDE and not process the request * sent to you. * * Note that if you allow v1 compatibility and the result of isV1 is true, your plugin will not receive the V2 * idle requests or preferences changed requests and you must work around accordingly. */ CW_CALLBACK CWAllowV1Compatibility(CWPluginContext context, Boolean canHandleV1Mode, Boolean *isV1); /* Get a comment from the user */ CW_CALLBACK CWGetComment(CWPluginContext context, const char* pPrompt, char* pComment, const long lBufferSize); /* Notify IDE if any changes occur to a file's information or checkout state */ CW_CALLBACK CWVCSStateChanged(CWPluginContext context, const CWFileSpec* file, CWVCSCheckoutState eCheckoutState, const CWVCSVersion* version); /* Display a IDE visual difference window for the passed files. The first file passed in * should be an unchangable file and the second file should be the local file. Instead of passing * a CWFileSpec it is possible to pass in a pointer to text (null terminated) and a title. * If the file spec is used, set both the title and text pointers to NULL */ CW_CALLBACK CWDoVisualDifference(CWPluginContext context, const CWFileSpec* file1, const char* pTitle1, const char* pText1, unsigned long lengthText1, const CWFileSpec* file2, const char* pTitle2, const char* pText2, unsigned long lengthText2); /* Tell the IDE the current ratio of how many items are completed. If you are able to correctly * give a completion ratio, the IDE will display a progress bar indicating how far along the * VCS action has progressed instead of displaying a busy indicator. If you pass -1 as the * total number of items, the busy indicator will replace any progress bar that you have * displayed with a prior call to completion ratio during the handling of a single request */ CW_CALLBACK CWCompletionRatio(CWPluginContext context, int totalItems, int completedItems); /* Get the project file specifier */ CW_CALLBACK CWGetProjectFileSpecifier(CWPluginContext context, CWFileSpec* projectFileSpec); /* Is the command passed an advanced command? */ CW_CALLBACK CWIsAdvancedRequest(CWPluginContext context, Boolean* isAdvanced); /* Is the command passed a recursive command? */ CW_CALLBACK CWIsRecursiveRequest(CWPluginContext context, Boolean* isRecursive); /* Is the command passed simply to check if it is supported? */ CW_CALLBACK CWIsCommandSupportedRequest(CWPluginContext context, Boolean* isCommandSupported); /* Set the pointer to a new overriding menu title string */ CW_CALLBACK CWSetCommandDescription(CWPluginContext context, CWVCSCommandDescription* descr); /* Get the pointer to the database connection structure */ CW_CALLBACK CWGetDatabaseConnectionInfo(CWPluginContext context, CWVCSDatabaseConnection* dbConnection); /* Get the command status code */ CW_CALLBACK CWGetCommandStatus(CWPluginContext context, CWVCSCommandStatus* status); /* Set the command status code */ CW_CALLBACK CWSetCommandStatus(CWPluginContext context, CWVCSCommandStatus status); /* Get the number of VCS items passed to the plugin */ CW_CALLBACK CWGetVCSItemCount(CWPluginContext context, unsigned long* count); /* Get a pointer to the ith entry of the item array, 0 indexed */ CW_CALLBACK CWGetVCSItem(CWPluginContext context, long index, CWVCSItem* item); /* Change the data for a VCS Item in the item array */ CW_CALLBACK CWSetVCSItem(CWPluginContext context, long index, CWVCSItem* item); /* Get what's stored in the VCS pointer storage area */ CW_CALLBACK CWGetVCSPointerStorage(CWPluginContext context, void** storage); /* Store a pointer that will be maintained across calls to the main entry point */ CW_CALLBACK CWSetVCSPointerStorage(CWPluginContext context, void* storage); #if CW_USE_PRAGMA_IMPORT #pragma import reset #endif #ifdef __cplusplus } #endif #ifdef _MSC_VER #pragma pack(pop,2) #endif #ifdef __MWERKS__ #pragma options align=reset #endif #endif /* __DROPINVCS_H__ */ \ No newline at end of file diff --git a/sdk_hdrs/MWBrowse.h b/sdk_hdrs/MWBrowse.h deleted file mode 100755 index 310a5d0..0000000 --- a/sdk_hdrs/MWBrowse.h +++ /dev/null @@ -1 +0,0 @@ -/* * MWBrowse.h * * Copyright © 1993-96 Metrowerks, Inc. All rights reserved. * * Types and constants needed for emitting CodeWarrior * browse information. */ #ifndef __MWBROWSE_H__ #define __MWBROWSE_H__ #ifdef __MWERKS__ #pragma once #endif #include "MWLangDefs.h" #ifdef __MWERKS__ #pragma options align=mac68k #endif #ifdef _MSC_VER #pragma pack(push,2) #endif #ifdef __cplusplus extern "C" { #endif #define BROWSE_HEADER 0xBEABBAEB #define BROWSE_VERSION 2 #define BROWSE_EARLIEST_COMPATIBLE_VERSION 2 typedef struct BrowseHeader { long browse_header; // always set to BROWSE_HEADER long browse_version; // always set to BROWSE_VERSION short browse_language; // the language of this translation unit, enum ELanguage short uses_name_table; // TRUE: uses name table from CW object code long earliest_compatible_version;// always set to BROWSE_EARLIEST_COMPATIBLE_VERSION long reserved[15]; // for future extensions } BrowseHeader; typedef unsigned char EBrowserItem; enum { browseFunction, // function, procedure, or method browseGlobal, // global variable browseClass, // class, struct, or union browseMacro, // macro browseEnum, // enum, enumerated type member browseTypedef, // user-defined type other than class browseConstant, // constant value browseTemplate, // C++ template browsePackage, // Java package browseCompSymbolStart = 0x70, browseEnd = 0xFF // used to denote end-of-list }; // flag constants for functions, member functions, data members enum { kAbstract = 1, // abstract/pure virtual kStatic = 2, // static member kFinal = 4, // final Java class, method, or data member kMember = 8, // item is a class member // reserve flags 0x10, 0x20, and 0x40 for other general flags // flags specific to classes kInterface = 0x80, // class is Java interface kPublic = 0x100, // class is public Java class // flags specific to functions and member functions kInline = 0x80, // inline function kPascal = 0x100, // pascal function kAsm = 0x200, // asm function kVirtual = 0x400, // virtual member function kCtor = 0x800, // is constructor kDtor = 0x1000, // is destructor kNative = 0x2000, // native Java method kSynch = 0x4000, // synchronized Java method kIntrinsic = 0x8000, // intrinsic routine (for General Magic) kConst = 0x10000, // const function // flags specific to data members kTransient = 0x80, // transient Java data member kVolatile = 0x100 // volatile Java data member }; typedef enum EAccess { // can be used as mask values accessNone = 0, accessPrivate = 1, accessProtected = 2, accessPublic = 4, accessAll = accessPrivate+accessProtected+accessPublic } EAccess; typedef unsigned char EMember; enum { memberFunction, // member function/method memberData, // data member/field memberEnd = 0xFF // denotes end-of-list }; typedef enum ETemplateType { // templates are either class or function templates templateClass, templateFunction } ETemplateType; /********************************************************************************/ /* Old (pre-CW9) browse data support definitions */ /********************************************************************************/ #define BROWSE_OLD_VERSION 0 enum { BROWSE_SCOPE_STATIC, // local to this file BROWSE_SCOPE_EXTERN // global to all files }; enum { BROWSE_OBJECT_FUNCTION, // function object BROWSE_OBJECT_DATA // data object }; enum { // browse data types BROWSE_END, // end of browse data BROWSE_OBJECT // a function/data definition }; typedef struct BrowseObjectDef { short type; // always BROWSE_OBJECT short size; // size of following data char object_type; // one of: (BROWSE_OBJECT_FUNCTION,BROWSE_OBJECT_DATA) char object_scope; // one of: (BROWSE_SCOPE_STATIC,BROWSE_SCOPE_EXTERN) long source_offset; // offset of declartation in source code // char name[...]; followed by padded object name (c-string) // char classname[...]; followed by padded class name string (c-string) } BrowseObjectDef; typedef struct BrowseHeader_Old { long browse_header; // always set to BROWSE_HEADER long browse_version; // always set to BROWSE_VERSION long reserved[14]; // for future extensions } BrowseHeader_Old; #ifdef __cplusplus } #endif #ifdef _MSC_VER #pragma pack(pop) #endif #ifdef __MWERKS__ #pragma options align=reset #endif #endif // __MWBROWSE_H__ \ No newline at end of file diff --git a/sdk_hdrs/MWLangDefs.h b/sdk_hdrs/MWLangDefs.h deleted file mode 100755 index 6a6a650..0000000 --- a/sdk_hdrs/MWLangDefs.h +++ /dev/null @@ -1 +0,0 @@ -/* * MWLangDefs.h * * Copyright © 1994-1996 metrowerks inc. All rights reserved. * * Language constants. */ #ifndef MWLangDefs_H #define MWLangDefs_H enum ELanguage { langUnknown, langC, langCPlus, langPascal, langObjectPascal, langJava, langAssembler, // don't care which assembler langFortran, langRez }; #endif // !MWLangDefs_H \ No newline at end of file