bool _init( const int argc, char** argv, NodeFactory* nodeFactory ) { const char *env = getenv( "EQ_LOG_LEVEL" ); if( env ) lunchbox::Log::level = lunchbox::Log::getLogLevel( env ); env = getenv( "EQ_LOG_TOPICS" ); if( env ) lunchbox::Log::topics |= atoll( env ); lunchbox::Log::instance().setThreadName( "Main" ); if( ++_initialized > 1 ) // not first { LBINFO << "Equalizer client library initialized more than once" << std::endl; return true; } if( !_parseArguments( argc, argv )) return false; LBINFO << "Equalizer v" << Version::getString() << " initializing" << std::endl; #ifdef AGL GetCurrentEventQueue(); #endif #ifdef GLX ::XInitThreads(); #endif #ifdef EQ_USE_PARACOMP LBINFO << "Initializing Paracomp library" << std::endl; PCerr err = pcSystemInitialize( 0 ); if( err != PC_NO_ERROR ) { LBERROR << "Paracomp initialization failed: " << err << std::endl; return false; } #endif LBASSERT( nodeFactory ); Global::_nodeFactory = nodeFactory; const std::string& programName = Global::getProgramName(); if( programName.empty() && argc > 0 ) Global::setProgramName( argv[0] ); const std::string& workDir = Global::getWorkDir(); if( workDir.empty( )) { char cwd[MAXPATHLEN]; Global::setWorkDir( getcwd( cwd, MAXPATHLEN )); } _initPlugins(); return fabric::init( argc, argv ); }
bool _init( const int argc, char** argv, NodeFactory* nodeFactory ) { const char *env = getenv( "EQ_LOG_LEVEL" ); if( env ) lunchbox::Log::level = lunchbox::Log::getLogLevel( env ); env = getenv( "EQ_LOG_TOPICS" ); if( env ) lunchbox::Log::topics |= atoll( env ); lunchbox::Log::instance().setThreadName( "Main" ); _parseArguments( argc, argv ); LBINFO << "Equalizer v" << Version::getString() << " initializing" << std::endl; if( ++_initialized > 1 ) // not first { LBINFO << "Equalizer client library initialized more than once" << std::endl; return true; } // _initErrors(); #ifdef AGL GetCurrentEventQueue(); #endif #ifdef EQ_USE_PARACOMP LBINFO << "Initializing Paracomp library" << std::endl; PCerr err = pcSystemInitialize( 0 ); if( err != PC_NO_ERROR ) { LBERROR << "Paracomp initialization failed: " << err << std::endl; return false; } #endif LBASSERT( nodeFactory ); Global::_nodeFactory = nodeFactory; _initPlugins(); return fabric::init( argc, argv ); }