00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: flc_dll_dl.h 00004 00005 libdl Dynamic Link support 00006 ------------------------------------------------------------------- 00007 Author: Giancarlo Niccolai 00008 Begin: dom set 12 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 00021 #ifndef flc_DLL_DL_H 00022 #define flc_DLL_DL_H 00023 #include <falcon/dll_base.h> 00024 #include <dlfcn.h> 00025 00026 namespace Falcon { 00027 00028 class DllLoader_dl 00029 { 00030 void *m_module; 00031 00032 public: 00033 DllLoader_dl(): 00034 m_module( 0 ) 00035 {} 00036 00037 virtual ~DllLoader_dl(); 00038 00039 bool open( const String &dll_name ); 00040 bool close(); 00041 virtual void getErrorDescription( String &descr ) const; 00042 00043 void assign( DllLoader_dl &other ); 00044 00045 DllFunc getSymbol( const String &sym_name ) const ; 00046 static bool isDllMark( char ch1, char ch2 ); 00047 static const char *dllExt() { return "so"; }; 00048 }; 00049 00050 typedef DllLoader_dl DllLoader; 00051 00052 } 00053 00054 #endif 00055 00056 /* end of flc_dll_dl.h */