Пример #1
0
int main( int argc, char ** argv )
{
    int nLibIndex = ParseArgs( argc, argv );
    if( nLibIndex == 0 )
        return -1;

    if( g_fDiag )
        Diags( argc, argv );

    Logger logger;
    GetLinuxPwd();
    for( ; nLibIndex < argc; nLibIndex++ )
    {
        StringList files = GetFileList( argv[nLibIndex] );
        for( StringList::const_iterator it=files.begin(); it!=files.end(); ++it )
        {
            std::string library = *it;

            std::cout << "Loading Library: " << library << std::endl;
            DllHandle hModule = LOAD_LIBRARY( library.c_str() );
            DLERROR_CHECK;

            if( !hModule )
            {
                std::cout<<"ERROR: Failed to load "<< *it << std::endl; 
                std::cout.flush(); 
                continue;
            }

            RunAllFn pRunAll = (RunAllFn)GET_PROC_ADDRESS( hModule, "RunAll" );
            if( pRunAll == NULL )
            {
                std::cerr << std::endl << "Function RunAll() not found in library " << library << "!" << std::endl;
                FREE_LIBRARY( hModule );
                continue;
            }
            pRunAll( &logger, g_configFileName.c_str() );
            
            FREE_LIBRARY( hModule );
        } // next library
    } // next arg

    if( g_fCSV )
    {
        try 
        {
            std::ofstream log(g_logPath.c_str());
            GenerateReportCSV( logger, log, g_fNoHeader );
        }
        catch(...)
        {
            std::cerr << "Error writing log file " << g_logPath << "!" << std::endl;
        }
    }
    
    std::cout << std::endl;
}
Пример #2
0
int
free_library(ZARRAYP libID)
{
  void *handle;
  if (assign_ZARRAYP_to_pointer(&handle, libID)) {
    return ZF_FAILURE;
  }
  if (FREE_LIBRARY(handle)) {
    logger("FREE_LIBRARY failed\n");\
    return ZF_FAILURE;
  }
  return ZF_SUCCESS;
}
Пример #3
0
void Module::Release() {
	config.Reset();

	if (pFactory != NULL) {
		ProtocolFactoryManager::UnRegisterProtocolFactory(pFactory);
		delete pFactory;
		pFactory = NULL;
	}

	if (libHandler != NULL) {
		FREE_LIBRARY(libHandler);
		libHandler = NULL;
	}
}
Пример #4
0
void ExternalReader::m_libcleanup(void)
{
	close();

	FREE_LIBRARY(m_hLib);

	m_hLib = 0;
	m_hOpen = 0;
	m_hClose = 0;
	m_hSend = 0;
	m_hGetATR = 0;
	m_hSupportsPACE = 0;
	m_hDoPACE = 0;
}