00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: flc_dll.h 00004 00005 Base class for Dynamic load system 00006 ------------------------------------------------------------------- 00007 Author: Giancarlo Niccolai 00008 Begin: mar ago 3 2004 00009 00010 ------------------------------------------------------------------- 00011 (C) Copyright 2004: the FALCON developers (see list in AUTHORS file) 00012 00013 See LICENSE file for licensing details. 00014 */ 00015 00016 00017 #ifndef flc_DLL_BASE_H 00018 #define flc_DLL_BASE_H 00019 00020 #include <falcon/string.h> 00021 00022 namespace Falcon 00023 { 00024 00025 class DllFunc 00026 { 00027 void *m_data; 00028 00029 public: 00030 DllFunc( void *data ): 00031 m_data(data) 00032 {} 00033 00034 void *data() const { return m_data; } 00035 void data( void *dt ) { m_data = dt; } 00036 }; 00037 00038 class DllLoader_base 00039 { 00040 public: 00041 DllLoader_base() {} 00042 virtual ~DllLoader_base() {} 00043 00044 virtual bool open( const String &dll_name ) = 0; 00045 virtual bool close() = 0; 00046 virtual DllFunc getSymbol( const String &sym_name ) const = 0; 00047 virtual void getErrorDescription( String &descr ) const = 0; 00048 00049 static bool isDllMark( char ch1, char ch2 ) { return false; } 00050 static const char *dllExt() { return ""; } 00051 00052 00053 }; 00054 00055 } 00056 00057 #endif 00058 /* end of flc_dll.h */