OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coVRDynLib.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _CO_DYNAMIC_LIB_H
9 #define _CO_DYNAMIC_LIB_H
10 
23 #include <util/coTypes.h>
24 #include <string>
25 #ifdef __hpux
26 #include <dl.h>
27 #endif
28 
29 #ifdef __hpux
30 typedef shl_t CO_SHLIB_HANDLE;
31 #elif _WIN32
32 #include <windows.h>
33 #define RTLD_LAZY 1
34 typedef HINSTANCE CO_SHLIB_HANDLE;
35 #else
36 typedef void *CO_SHLIB_HANDLE;
37 #endif
38 
39 //#define SGIDLADD
40 #ifndef _WIN32
41 #define SVR4_DYNAMIC_LINKING
42 #endif
43 namespace opencover
44 {
45 //
46 //
47 //
48 class COVEREXPORT coVRDynLib
49 {
50 
51 public:
52  static const char *dlerror(void);
53  static CO_SHLIB_HANDLE dlopen(const char *filename, bool showErrors = true);
54  static CO_SHLIB_HANDLE dlopen(const std::string &filename, bool showErrors = true);
55  static void *dlsym(CO_SHLIB_HANDLE handle, const char *symbolname);
56  static int dlclose(CO_SHLIB_HANDLE handle);
57  static std::string libName(const std::string &name);
58 
59 private:
60  coVRDynLib()
61  {
62  }
63  ~coVRDynLib()
64  {
65  }
66 };
67 }
68 #endif
Definition: coVRDynLib.h:48
void * CO_SHLIB_HANDLE
Definition: coVRDynLib.h:36