~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: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

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)