00001 /* 00002 * dynalink.h 00003 * 00004 * Dynamic Link Library abstraction class. 00005 * 00006 * Portable Windows Library 00007 * 00008 * Copyright (c) 1993-1998 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Portable Windows Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * 00024 * Portions are Copyright (C) 1993 Free Software Foundation, Inc. 00025 * All Rights Reserved. 00026 * 00027 * Contributor(s): ______________________________________. 00028 * 00029 * $Log: dynalink.h,v $ 00030 * Revision 1.17 2005/11/25 03:43:47 csoutheren 00031 * Fixed function argument comments to be compatible with Doxygen 00032 * 00033 * Revision 1.16 2004/07/11 07:56:35 csoutheren 00034 * Applied jumbo VxWorks patch, thanks to Eize Slange 00035 * 00036 * Revision 1.15 2004/02/22 02:38:33 ykiryanov 00037 * Removed ifndef BEOS when declaring PDynalink 00038 * 00039 * Revision 1.14 2003/09/17 05:41:58 csoutheren 00040 * Removed recursive includes 00041 * 00042 * Revision 1.13 2003/09/17 01:18:02 csoutheren 00043 * Removed recursive include file system and removed all references 00044 * to deprecated coooperative threading support 00045 * 00046 * Revision 1.12 2003/05/14 00:42:32 rjongbloed 00047 * Added missing virtual keyword to PDynaLink functions. 00048 * 00049 * Revision 1.11 2003/01/24 10:21:06 robertj 00050 * Fixed issues in RTEMS support, thanks Vladimir Nesic 00051 * 00052 * Revision 1.10 2002/10/10 04:43:43 robertj 00053 * VxWorks port, thanks Martijn Roest 00054 * 00055 * Revision 1.9 2002/09/16 01:08:59 robertj 00056 * Added #define so can select if #pragma interface/implementation is used on 00057 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00058 * 00059 * Revision 1.8 2001/06/30 06:59:06 yurik 00060 * Jac Goudsmit from Be submit these changes 6/28. Implemented by Yuri Kiryanov 00061 * 00062 * Revision 1.7 2001/05/22 12:49:32 robertj 00063 * Did some seriously wierd rewrite of platform headers to eliminate the 00064 * stupid GNU compiler warning about braces not matching. 00065 * 00066 * Revision 1.6 1999/03/09 02:59:49 robertj 00067 * Changed comments to doc++ compatible documentation. 00068 * 00069 * Revision 1.5 1999/02/16 08:07:11 robertj 00070 * MSVC 6.0 compatibility changes. 00071 * 00072 * Revision 1.4 1998/09/23 06:20:29 robertj 00073 * Added open source copyright license. 00074 * 00075 * Revision 1.3 1997/06/16 13:15:52 robertj 00076 * Added function to get a dyna-link libraries name. 00077 * 00078 * Revision 1.2 1997/06/08 04:49:20 robertj 00079 * Added DLL file extension string function. 00080 * 00081 * Revision 1.1 1995/03/14 12:44:08 robertj 00082 * Initial revision 00083 * 00084 */ 00085 00086 #ifndef _PDYNALINK 00087 #define _PDYNALINK 00088 00089 #if !defined(P_RTEMS) 00090 00091 #ifdef P_USE_PRAGMA 00092 #pragma interface 00093 #endif 00094 00098 class PDynaLink : public PObject 00099 { 00100 PCLASSINFO(PDynaLink, PObject); 00101 00102 public: 00108 PDynaLink(); 00112 PDynaLink( 00113 const PString & name 00114 ); 00115 00118 ~PDynaLink(); 00120 00123 /* Open a new dyna-link, loading the specified module. 00124 00125 @return 00126 TRUE if the library was loaded. 00127 */ 00128 virtual BOOL Open( 00129 const PString & name 00130 ); 00131 00134 virtual void Close(); 00135 00138 virtual BOOL IsLoaded() const; 00139 00149 virtual PString GetName( 00150 BOOL full = FALSE 00151 ) const; 00152 00158 static PString GetExtension(); 00160 00163 00164 typedef void (*Function)(); 00165 00166 00172 BOOL GetFunction( 00173 PINDEX index, 00174 Function & func 00175 ); 00176 00182 BOOL GetFunction( 00183 const PString & name, 00184 Function & func 00185 ); 00187 00188 00189 // Include platform dependent part of class 00190 #ifdef _WIN32 00191 #include "msos/ptlib/dynalink.h" 00192 #else 00193 #include "unix/ptlib/dynalink.h" 00194 #endif 00195 }; 00196 00197 #endif // !defined(P_RTEMS) 00198 00199 #endif 00200 00201 // End Of File ///////////////////////////////////////////////////////////////