X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ide%2Fsrc%2Fproject%2FProjectNode.ec;fp=ide%2Fsrc%2Fproject%2FProjectNode.ec;h=fa5bff734284354058463dce296a5c8183d3ba91;hb=e0d835db3688463b08c92e945367ad2b285abfa8;hp=77af10e268964a05cae52e2b1abee7baebf86ff6;hpb=adfacc7b8ade29675aeeb274a94513e5d0f16f07;p=sdk diff --git a/ide/src/project/ProjectNode.ec b/ide/src/project/ProjectNode.ec index 77af10e..fa5bff7 100644 --- a/ide/src/project/ProjectNode.ec +++ b/ide/src/project/ProjectNode.ec @@ -177,7 +177,56 @@ class TwoStrings : struct } } -enum IntermediateFileType { none, ec, c, sym, imp, bowl, o }; +class DotMain : bool +{ + //property char * { set { } } + DotMain ::FromFileName(char * fileName) + { + DotMain dotMain = false; + if(fileName && fileName[0]) + { + char ext[MAX_EXTENSION]; + GetExtension(fileName, ext); + if(!strcmp(ext, "c") || !strcmp(ext, "ec")) + { + char stripExt[MAX_LOCATION]; + strcpy(stripExt, fileName); + StripExtension(stripExt); + GetExtension(stripExt, ext); + if(!strcmp(ext, "main")) + dotMain = true; + } + } + return dotMain; + } +} + +enum IntermediateFileType +{ + none, ec, c, sym, imp, bowl, o; + + //property char * { set { } } + IntermediateFileType ::FromExtension(char * extension) + { + IntermediateFileType type = none; + if(extension && extension[0]) + { + if(!fstrcmp(extension, "ec")) + type = ec; + else if(!fstrcmp(extension, "c")) + type = c; + else if(!fstrcmp(extension, "sym")) + type = sym; + else if(!fstrcmp(extension, "imp")) + type = imp; + else if(!fstrcmp(extension, "bowl")) + type = bowl; + else if(!fstrcmp(extension, "o")) + type = o; + } + return type; + } +}; class ProjectNode : ListItem { @@ -497,7 +546,8 @@ private: if(dotMain) { - ReplaceSpaces(buffer, project.moduleName); + Project prj = property::project; + ReplaceSpaces(buffer, prj.moduleName); StripExtension(buffer); strcat(buffer, ".main.ec"); } @@ -1049,11 +1099,11 @@ private: { if(child.type != file) result = child.InternalFindByFullPath(path, includeResources, lastDirName); - else if(child.name && !strcmpi(lastDirName, child.name)) + else if(child.name && !fstrcmp(lastDirName, child.name)) { char p[MAX_LOCATION]; child.GetFullFilePath(p); - if(!strcmpi(p, path)) + if(!fstrcmp(p, path)) { result = child; break; @@ -1074,7 +1124,7 @@ private: if(dotMain == true && this.type == project) { GetObjectFileName(p, namesInfo, type, dotMain); - if(!strcmpi(p, fileName)) + if(!fstrcmp(p, fileName)) result = this; } else if(files) @@ -1086,7 +1136,7 @@ private: else if(child.type == file && child.name) { child.GetObjectFileName(p, namesInfo, type, dotMain); - if(!strcmpi(p, fileName)) + if(!fstrcmp(p, fileName)) { result = child; break;