diff --git a/include/lang/SC_LibraryConfig.h b/include/lang/SC_LibraryConfig.h index 0cb4502992..d7db407521 100644 --- a/include/lang/SC_LibraryConfig.h +++ b/include/lang/SC_LibraryConfig.h @@ -105,6 +105,6 @@ class SC_LanguageConfig DirVector mExcludedDirectories; }; -extern SC_LanguageConfig* gLibraryConfig; +extern SC_LanguageConfig* gLanguageConfig; #endif // SC_LIBRARYCONFIG_H_INCLUDED diff --git a/lang/LangPrimSource/PyrPrimitive.cpp b/lang/LangPrimSource/PyrPrimitive.cpp index df10e9a3d9..d0c0576462 100644 --- a/lang/LangPrimSource/PyrPrimitive.cpp +++ b/lang/LangPrimSource/PyrPrimitive.cpp @@ -3438,8 +3438,8 @@ static int prLanguageConfig_getLibraryPaths(struct VMGlobals * g, int numArgsPus typedef SC_LanguageConfig::DirVector DirVector; - DirVector const & dirVector = (pathType == includePaths) ? gLibraryConfig->includedDirectories() - : gLibraryConfig->excludedDirectories(); + DirVector const & dirVector = (pathType == includePaths) ? gLanguageConfig->includedDirectories() + : gLanguageConfig->excludedDirectories(); size_t numberOfPaths = dirVector.size(); PyrObject * resultArray = newPyrArray(g->gc, numberOfPaths, 0, true); @@ -3471,9 +3471,9 @@ static int prLanguageConfig_addLibraryPath(struct VMGlobals * g, int numArgsPush return errWrongType; if (pathType == includePaths) - gLibraryConfig->addIncludedDirectory(path); + gLanguageConfig->addIncludedDirectory(path); else - gLibraryConfig->addExcludedDirectory(path); + gLanguageConfig->addExcludedDirectory(path); return errNone; } @@ -3497,9 +3497,9 @@ static int prLanguageConfig_removeLibraryPath(struct VMGlobals * g, int numArgsP return errWrongType; if (pathType == includePaths) - gLibraryConfig->removeIncludedDirectory(path); + gLanguageConfig->removeIncludedDirectory(path); else - gLibraryConfig->removeExcludedDirectory(path); + gLanguageConfig->removeExcludedDirectory(path); return errNone; } @@ -3527,7 +3527,7 @@ static int prLanguageConfig_writeConfigFile(struct VMGlobals * g, int numArgsPus sc_AppendToPath(path, MAXPATHLEN, "sclang_conf.yaml"); } - gLibraryConfig->writeLibraryConfigYAML(path); + gLanguageConfig->writeLibraryConfigYAML(path); return errNone; } diff --git a/lang/LangSource/PyrLexer.cpp b/lang/LangSource/PyrLexer.cpp index 09ca202b82..4e8e8cd293 100644 --- a/lang/LangSource/PyrLexer.cpp +++ b/lang/LangSource/PyrLexer.cpp @@ -1923,7 +1923,7 @@ static bool passOne_ProcessDir(const char *dirname, int level) bool success = true; - if (gLibraryConfig && gLibraryConfig->pathIsExcluded(dirname)) { + if (gLanguageConfig && gLanguageConfig->pathIsExcluded(dirname)) { post("\texcluding dir: '%s'\n", dirname); return success; } @@ -1966,7 +1966,7 @@ bool passOne() if (!passOne_ProcessDir(gCompileDir, 0)) return false; } else - if (!gLibraryConfig->forEachIncludedDirectory(passOne_ProcessDir)) + if (!gLanguageConfig->forEachIncludedDirectory(passOne_ProcessDir)) return false; finiPassOne(); @@ -2005,7 +2005,7 @@ bool passOne_ProcessOneFile(const char * filenamearg, int level) return success; } - if (gLibraryConfig && gLibraryConfig->pathIsExcluded(filename)) { + if (gLanguageConfig && gLanguageConfig->pathIsExcluded(filename)) { post("\texcluding file: '%s'\n", filename); return success; } @@ -2118,7 +2118,7 @@ SC_DLLEXPORT_C bool compileLibrary() compiledOK = false; // FIXME: the library config should have been initialized earlier! - if (!gLibraryConfig) + if (!gLanguageConfig) SC_LanguageConfig::readDefaultLibraryConfig(); compileStartTime = elapsedTime(); diff --git a/lang/LangSource/SC_LibraryConfig.cpp b/lang/LangSource/SC_LibraryConfig.cpp index 69407e7b99..c6ed5421ee 100644 --- a/lang/LangSource/SC_LibraryConfig.cpp +++ b/lang/LangSource/SC_LibraryConfig.cpp @@ -45,7 +45,7 @@ using namespace std; -SC_LanguageConfig *gLibraryConfig = 0; +SC_LanguageConfig *gLanguageConfig = 0; void SC_LanguageConfig::postExcludedDirectories(void) { @@ -117,14 +117,14 @@ void SC_LanguageConfig::removeExcludedDirectory(const char *path) bool SC_LanguageConfig::readLibraryConfig(const char* fileName) { freeLibraryConfig(); - gLibraryConfig = new SC_LanguageConfig(); + gLanguageConfig = new SC_LanguageConfig(); SC_LibraryConfigFile file(::post); bool success = file.open(fileName); if (!success) return false; - bool error = file.read(fileName, gLibraryConfig); + bool error = file.read(fileName, gLanguageConfig); file.close(); if (!error) @@ -138,7 +138,7 @@ extern bool gPostInlineWarnings; bool SC_LanguageConfig::readLibraryConfigYAML(const char* fileName) { freeLibraryConfig(); - gLibraryConfig = new SC_LanguageConfig(); + gLanguageConfig = new SC_LanguageConfig(); using namespace YAML; try { @@ -155,7 +155,7 @@ bool SC_LanguageConfig::readLibraryConfigYAML(const char* fileName) continue; string path; pathNode.GetScalar(path); - gLibraryConfig->addIncludedDirectory(path.c_str()); + gLanguageConfig->addIncludedDirectory(path.c_str()); } } @@ -167,7 +167,7 @@ bool SC_LanguageConfig::readLibraryConfigYAML(const char* fileName) continue; string path; pathNode.GetScalar(path); - gLibraryConfig->addExcludedDirectory(path.c_str()); + gLanguageConfig->addExcludedDirectory(path.c_str()); } } @@ -202,15 +202,15 @@ bool SC_LanguageConfig::writeLibraryConfigYAML(const char* fileName) out << Key << "includePaths"; out << Value << BeginSeq; - for (DirVector::iterator it = gLibraryConfig->mIncludedDirectories.begin(); - it != gLibraryConfig->mIncludedDirectories.end(); ++it) + for (DirVector::iterator it = gLanguageConfig->mIncludedDirectories.begin(); + it != gLanguageConfig->mIncludedDirectories.end(); ++it) out << *it; out << EndSeq; out << Key << "excludePaths"; out << Value << BeginSeq; - for (DirVector::iterator it = gLibraryConfig->mExcludedDirectories.begin(); - it != gLibraryConfig->mExcludedDirectories.end(); ++it) + for (DirVector::iterator it = gLanguageConfig->mExcludedDirectories.begin(); + it != gLanguageConfig->mExcludedDirectories.end(); ++it) out << *it; out << EndSeq; @@ -226,7 +226,7 @@ bool SC_LanguageConfig::writeLibraryConfigYAML(const char* fileName) bool SC_LanguageConfig::defaultLibraryConfig(void) { freeLibraryConfig(); - gLibraryConfig = new SC_LanguageConfig(); + gLanguageConfig = new SC_LanguageConfig(); char compileDir[MAXPATHLEN]; char systemExtensionDir[MAXPATHLEN]; @@ -234,14 +234,14 @@ bool SC_LanguageConfig::defaultLibraryConfig(void) sc_GetResourceDirectory(compileDir, MAXPATHLEN-32); sc_AppendToPath(compileDir, MAXPATHLEN, "SCClassLibrary"); - gLibraryConfig->addIncludedDirectory(compileDir); + gLanguageConfig->addIncludedDirectory(compileDir); if (!sc_IsStandAlone()) { sc_GetSystemExtensionDirectory(systemExtensionDir, MAXPATHLEN); - gLibraryConfig->addIncludedDirectory(systemExtensionDir); + gLanguageConfig->addIncludedDirectory(systemExtensionDir); sc_GetUserExtensionDirectory(userExtensionDir, MAXPATHLEN); - gLibraryConfig->addIncludedDirectory(userExtensionDir); + gLanguageConfig->addIncludedDirectory(userExtensionDir); } return true; } @@ -309,9 +309,9 @@ bool SC_LanguageConfig::readDefaultLibraryConfig() void SC_LanguageConfig::freeLibraryConfig() { - if (gLibraryConfig) { - delete gLibraryConfig; - gLibraryConfig = 0; + if (gLanguageConfig) { + delete gLanguageConfig; + gLanguageConfig = 0; } }