Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_SHAREDLIB_H
00020 #define GNASH_SHAREDLIB_H
00021
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025
00026 #include <boost/thread/mutex.hpp>
00027 #include <string>
00028 #include "dsodefs.h"
00029
00030 #ifdef _WIN32
00031 #undef DLL_EXPORT
00032 #define LIBLTDL_DLL_IMPORT 1
00033 #endif
00034
00035 #include <ltdl.h>
00036
00037
00038 #ifdef HAVE_LIBGEN_H
00039 #include <libgen.h>
00040 #endif
00041
00042 namespace gnash {
00043 class as_object;
00044 }
00045
00046 namespace gnash {
00047
00049 class SharedLib
00050 {
00051 typedef boost::mutex::scoped_lock scoped_lock;
00052
00053 public:
00054
00055 typedef bool entrypoint (void *obj);
00056 typedef void initentry(as_object &obj);
00057
00058 SharedLib(const std::string& filespec);
00059 DSOEXPORT SharedLib(const std::string& filespec, const std::string& envvar);
00060 ~SharedLib();
00061
00062 DSOEXPORT bool openLib();
00063 bool openLib(const std::string &filespec);
00064
00065
00066 entrypoint *getDllSymbol (const std::string& symbol);
00067 DSOEXPORT initentry *getInitEntry (const std::string& symbol);
00068
00069 private:
00070
00071 bool closeLib();
00072
00073 lt_dlhandle _dlhandle;
00074 std::string _filespec;
00075 boost::mutex _libMutex;
00076 };
00077
00078 }
00079
00080
00081 #endif
00082
00083
00084
00085
00086