OpenCOVER
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
30typedef shl_t CO_SHLIB_HANDLE;
31#elif _WIN32
32#include <windows.h>
33#define RTLD_LAZY 1
34typedef HINSTANCE CO_SHLIB_HANDLE;
35#else
36typedef void *CO_SHLIB_HANDLE;
37#endif
38
39//#define SGIDLADD
40#ifndef _WIN32
41#define SVR4_DYNAMIC_LINKING
42#endif
43namespace opencover
44{
45//
46//
47//
48class COVEREXPORT coVRDynLib
49{
50
51public:
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
59private:
61 {
62 }
64 {
65 }
66};
67}
68#endif
void * CO_SHLIB_HANDLE
Definition: coVRDynLib.h:36
Definition: ARToolKit.h:33
Definition: coVRDynLib.h:49
static void * dlsym(CO_SHLIB_HANDLE handle, const char *symbolname)
static std::string libName(const std::string &name)
static CO_SHLIB_HANDLE dlopen(const char *filename, bool showErrors=true)
static const char * dlerror(void)
static CO_SHLIB_HANDLE dlopen(const std::string &filename, bool showErrors=true)
static int dlclose(CO_SHLIB_HANDLE handle)