dynalink.h

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

Generated on Fri Mar 7 06:25:02 2008 for PTLib by  doxygen 1.5.1