static bool locateFile(const string &relativePath, string &path) { // relativePath has no suffix if (moduleSuffixes.empty()) initModuleSuffixes(); string tail = PATH_SEPARATOR + relativePath; for (unsigned i = 0; i < searchPath.size(); ++i) { string pathWOSuffix = searchPath[i] + tail; for (unsigned j = 0; j < moduleSuffixes.size(); ++j) { string p = pathWOSuffix + moduleSuffixes[j]; FILE *f = fopen(p.c_str(), "rb"); if (f != NULL) { fclose(f); path = p; return true; } } } return false; }
void initLoader() { initModuleSuffixes(); }