~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/src/cppunit/BeOsDynamicLibraryManager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <cppunit/Portability.h>
2
 
 
3
 
#if defined(CPPUNIT_HAVE_BEOS_DLL_LOADER)
4
 
#include <cppunit/plugin/DynamicLibraryManager.h>
5
 
 
6
 
#include <kernel/image.h>
7
 
 
8
 
 
9
 
CPPUNIT_NS_BEGIN
10
 
 
11
 
 
12
 
DynamicLibraryManager::LibraryHandle 
13
 
DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
14
 
{
15
 
  return (LibraryHandle)::load_add_on( libraryName.c_str() );
16
 
}
17
 
 
18
 
 
19
 
void 
20
 
DynamicLibraryManager::doReleaseLibrary()
21
 
{
22
 
  ::unload_add_on( (image_id)m_libraryHandle );
23
 
}
24
 
 
25
 
 
26
 
DynamicLibraryManager::Symbol 
27
 
DynamicLibraryManager::doFindSymbol( const std::string &symbol )
28
 
{
29
 
  void *symbolPointer;
30
 
  if ( ::get_image_symbol( (image_id)m_libraryHandle, 
31
 
                           symbol.c_str(), 
32
 
                           B_SYMBOL_TYPE_TEXT, 
33
 
                           &symbolPointer ) == B_OK )
34
 
    return symnolPointer;
35
 
  return NULL;
36
 
}
37
 
 
38
 
 
39
 
std::string 
40
 
DynamicLibraryManager::getLastErrorDetail() const
41
 
{
42
 
  return "";
43
 
}
44
 
 
45
 
 
46
 
CPPUNIT_NS_END
47
 
 
48
 
 
49
 
#endif // defined(CPPUNIT_HAVE_BEOS_DLL_LOADER)