X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..49a143664075d786078a899ae8b3c947330f4df2:/include/wx/dynlib.h diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 66125b7c28..e163ae2098 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -6,7 +6,7 @@ // Created: 20/07/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Guilhem Lavaux -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DYNLIB_H__ @@ -131,7 +131,7 @@ public: // to use it polymorphically. ~wxDynamicLibrary() { Unload(); } - // return TRUE if the library was loaded successfully + // return true if the library was loaded successfully bool IsLoaded() const { return m_handle != 0; } // load the library with the given name (full or not), return true if ok @@ -151,6 +151,16 @@ public: // Return the raw handle from dlopen and friends. wxDllType GetLibHandle() const { return m_handle; } + // check if the given symbol is present in the library, useful to verify if + // a loadable module is our plugin, for example, without provoking error + // messages from GetSymbol() + bool HasSymbol(const wxString& name) const + { + bool ok; + DoGetSymbol(name, &ok); + return ok; + } + // resolve a symbol in a loaded DLL, such as a variable or function name. // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to // export unmangled names) @@ -186,6 +196,10 @@ public: #endif protected: + // the real implementation of GetSymbol() + void *DoGetSymbol(const wxString& name, bool *success = 0) const; + + // platform specific shared lib suffix. static const wxChar *ms_dllext; @@ -220,11 +234,11 @@ public: which case the library is searched for in all standard locations (use GetDllExt() to construct the filename) - if success pointer is not NULL, it will be filled with TRUE if everything - went ok and FALSE otherwise + if success pointer is not NULL, it will be filled with true if everything + went ok and false otherwise */ static wxDllType LoadLibrary(const wxString& name, bool *success = NULL); - + /* This function unloads the shared library previously loaded with LoadLibrary