00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: dll_mac.h 00004 00005 libdl Dynamic Link support 00006 ------------------------------------------------------------------- 00007 Author: Guerra Francesco 00008 Begin: sab mag 06 2006 00009 00010 ------------------------------------------------------------------- 00011 (C) Copyright 2006: the FALCON developers (see list in AUTHORS file) 00012 00013 See LICENSE file for licensing details. 00014 */ 00015 00025 #ifndef flc_DLL_DL_H 00026 #define flc_DLL_DL_H 00027 #include <falcon/dll_base.h> 00028 #include <dlfcn.h> 00029 00030 namespace Falcon { 00031 00032 class DllLoader_Mac 00033 { 00034 void *m_module; 00035 00036 public: 00037 DllLoader_Mac(): 00038 m_module( 0 ) 00039 {} 00040 00041 virtual ~DllLoader_Mac(); 00042 00043 bool open( const String &dll_name ); 00044 bool close(); 00045 virtual void getErrorDescription( String &descr ) const; 00046 00047 void assign( DllLoader_Mac &other ); 00048 00049 DllFunc getSymbol( const String &sym_name ) const ; 00050 static bool isDllMark( unsigned char ch1, unsigned char ch2 ); 00051 static const char *dllExt() { return "dylib"; }; 00052 }; 00053 00054 typedef DllLoader_Mac DllLoader; 00055 00056 } 00057 00058 #endif 00059 00060 /* end of flc_dll_dl.h */