コード例 #1
0
ファイル: enrobage.cpp プロジェクト: gauravchawla03/Stanford
FILE* fopensearch(const char* filename, string& fullpath)
{   
    FILE* f;
    char* envpath;

    if ((f = fopen(filename, "r"))) { 
    	buildFullPathname(fullpath, filename); 
    	return f;
    }
    if ((f = fopenat(fullpath, gMasterDirectory, filename))) { 
    	return f;
    }
    if ((envpath = getenv("FAUST_LIB_PATH")) && (f = fopenat(fullpath, envpath, filename))) {
        return f;
    }
    if ((f = fopenat(fullpath, gFaustDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperSuperDirectory, "architecture", filename))) { 
    	return f;
    }
    return 0;
}
コード例 #2
0
ファイル: enrobage.cpp プロジェクト: OpenDAWN/faudiostream
FILE* fopensearch(const char* filename, string& fullpath)
{   
    FILE* f;
    char* envpath;


    // search in current directory

    if ((f = fopen(filename, "r"))) { 
    	buildFullPathname(fullpath, filename); 
    	return f;
    }

    // search file in user supplied directory path

    for (list< string >::iterator i = gImportDirList.begin(); i != gImportDirList.end(); i++) {
        if ((f = fopenat(fullpath, *i, filename))) {
            //std::cerr << "found file : " << fullpath << std::endl;
            return f;
        }
    }


    // search in default directories

    if ((f = fopenat(fullpath, gMasterDirectory, filename))) { 
    	return f;
    }
    if ((envpath = getenv("FAUST_LIB_PATH")) && (f = fopenat(fullpath, envpath, filename))) {
		return f;
    }
    if ((f = fopenat(fullpath, gFaustDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperSuperDirectory, "architecture", filename))) { 
    	return f;
    }
#ifdef INSTALL_PREFIX
    if ((f = fopenat(fullpath, INSTALL_PREFIX "/lib/faust", filename))) { 
    	return f;
    }
#endif
    if ((f = fopenat(fullpath, "/usr/local/lib/faust", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, "/usr/lib/faust", filename))) { 
    	return f;
    }
    return 0;
}
コード例 #3
0
ファイル: enrobage.cpp プロジェクト: gauravchawla03/Stanford
FILE* fopensearch(const char* filename, string& fullpath)
{   
    FILE* f;
    char* envpath;

    if ((f = fopen(filename, "r"))) { 
    	buildFullPathname(fullpath, filename); 
    	return f;
    }
    if ((f = fopenat(fullpath, gMasterDirectory, filename))) { 
    	return f;
    }
    if ((envpath = getenv("FAUST_LIB_PATH")) && (f = fopenat(fullpath, envpath, filename))) {
		return f;
    }
    if ((f = fopenat(fullpath, gFaustDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperDirectory, "architecture", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, gFaustSuperSuperDirectory, "architecture", filename))) { 
    	return f;
    }
#ifdef INSTALL_PREFIX
    if ((f = fopenat(fullpath, INSTALL_PREFIX "/lib/faust", filename))) { 
    	return f;
    }
#endif
    if ((f = fopenat(fullpath, "/usr/local/lib/faust", filename))) { 
    	return f;
    }
    if ((f = fopenat(fullpath, "/usr/lib/faust", filename))) { 
    	return f;
    }
    return 0;
}
コード例 #4
0
ファイル: enrobage.cpp プロジェクト: OpenDAWN/faudiostream
/**
 * Try to open the file '<dir>/<filename>'. If it succeed, it stores the full pathname
 * of the file into <fullpath>
 */
static FILE* fopenat(string& fullpath, const string& dir, const char* filename)
{
    return fopenat(fullpath, dir.c_str(), filename);
}