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.16 2004/07/11 07:56:35 csoutheren 00031 * Applied jumbo VxWorks patch, thanks to Eize Slange 00032 * 00033 * Revision 1.15 2004/02/22 02:38:33 ykiryanov 00034 * Removed ifndef BEOS when declaring PDynalink 00035 * 00036 * Revision 1.14 2003/09/17 05:41:58 csoutheren 00037 * Removed recursive includes 00038 * 00039 * Revision 1.13 2003/09/17 01:18:02 csoutheren 00040 * Removed recursive include file system and removed all references 00041 * to deprecated coooperative threading support 00042 * 00043 * Revision 1.12 2003/05/14 00:42:32 rjongbloed 00044 * Added missing virtual keyword to PDynaLink functions. 00045 * 00046 * Revision 1.11 2003/01/24 10:21:06 robertj 00047 * Fixed issues in RTEMS support, thanks Vladimir Nesic 00048 * 00049 * Revision 1.10 2002/10/10 04:43:43 robertj 00050 * VxWorks port, thanks Martijn Roest 00051 * 00052 * Revision 1.9 2002/09/16 01:08:59 robertj 00053 * Added #define so can select if #pragma interface/implementation is used on 00054 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00055 * 00056 * Revision 1.8 2001/06/30 06:59:06 yurik 00057 * Jac Goudsmit from Be submit these changes 6/28. Implemented by Yuri Kiryanov 00058 * 00059 * Revision 1.7 2001/05/22 12:49:32 robertj 00060 * Did some seriously wierd rewrite of platform headers to eliminate the 00061 * stupid GNU compiler warning about braces not matching. 00062 * 00063 * Revision 1.6 1999/03/09 02:59:49 robertj 00064 * Changed comments to doc++ compatible documentation. 00065 * 00066 * Revision 1.5 1999/02/16 08:07:11 robertj 00067 * MSVC 6.0 compatibility changes. 00068 * 00069 * Revision 1.4 1998/09/23 06:20:29 robertj 00070 * Added open source copyright license. 00071 * 00072 * Revision 1.3 1997/06/16 13:15:52 robertj 00073 * Added function to get a dyna-link libraries name. 00074 * 00075 * Revision 1.2 1997/06/08 04:49:20 robertj 00076 * Added DLL file extension string function. 00077 * 00078 * Revision 1.1 1995/03/14 12:44:08 robertj 00079 * Initial revision 00080 * 00081 */ 00082 00083 #ifndef _PDYNALINK 00084 #define _PDYNALINK 00085 00086 #if !defined(P_RTEMS) 00087 00088 #ifdef P_USE_PRAGMA 00089 #pragma interface 00090 #endif 00091 00095 class PDynaLink : public PObject 00096 { 00097 PCLASSINFO(PDynaLink, PObject); 00098 00099 public: 00105 PDynaLink(); 00109 PDynaLink( 00110 const PString & name 00111 ); 00112 00115 ~PDynaLink(); 00117 00120 /* Open a new dyna-link, loading the specified module. 00121 00122 @return 00123 TRUE if the library was loaded. 00124 */ 00125 virtual BOOL Open( 00126 const PString & name 00127 ); 00128 00131 virtual void Close(); 00132 00135 virtual BOOL IsLoaded() const; 00136 00146 virtual PString GetName( 00147 BOOL full = FALSE 00148 ) const; 00149 00155 static PString GetExtension(); 00157 00160 00161 typedef void (*Function)(); 00162 00163 00169 BOOL GetFunction( 00170 PINDEX index, 00171 Function & func 00172 ); 00173 00179 BOOL GetFunction( 00180 const PString & name, 00181 Function & func 00182 ); 00184 00185 00186 // Include platform dependent part of class 00187 #ifdef _WIN32 00188 #include "msos/ptlib/dynalink.h" 00189 #else 00190 #include "unix/ptlib/dynalink.h" 00191 #endif 00192 }; 00193 00194 #endif // !defined(P_RTEMS) 00195 00196 #endif 00197 00198 // End Of File ///////////////////////////////////////////////////////////////