Go to the
documentation of this file.
00001 #ifndef _KAYDARA_LIB_H_
00002 #define _KAYDARA_LIB_H_
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 #include <kaydara.h>
00040 #include <kaydaradef.h>
00041 
00042 enum kFBDllOperation { kFBDllLoad, kFBDllUnLoad };
00043 
00044     #if defined(KARCH_ENV_WIN32)
00045 
00046     #define FB_DLL_INIT(DLLNAME,STARTUP)\
00047         __declspec(dllexport) void EntryPoint##DLLNAME(kFBDllOperation STARTUP);\
00048             BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved )\
00049             { \
00050                 switch (fdwReason) \
00051                 { \
00052                 case DLL_PROCESS_ATTACH: EntryPoint##DLLNAME(kFBDllLoad); break; \
00053                 case DLL_PROCESS_DETACH: EntryPoint##DLLNAME(kFBDllUnLoad); break; \
00054                 } \
00055                 return TRUE; \
00056             }\
00057         void EntryPoint##DLLNAME(kFBDllOperation STARTUP)
00058 
00059 #elif defined(KARCH_ENV_IRIX) 
00060     #define FB_DLL_INIT( DllName,Startup ) \
00061     void EntryPoint##DllName(kFBDllOperation Startup); \
00062         extern "C" void KdsoInit( void ) \
00063         { \
00064         EntryPoint##DllName(kFBDllLoad);\
00065         }\
00066         extern "C" void KdsoDone( void ) \
00067         { \
00068         EntryPoint##DllName(kFBDllUnLoad);\
00069         }\
00070     void EntryPoint##DllName(kFBDllOperation Startup)
00071 #elif defined (KARCH_ENV_LINUX)
00072     #define FB_DLL_INIT( DllName,Startup ) \
00073     void EntryPoint##DllName(kFBDllOperation Startup); \
00074     extern "C" void KdsoInit##DllName ( void ) \
00075         { \
00076         EntryPoint##DllName(kFBDllLoad);\
00077         }\
00078     class Init##DllName { public: Init##DllName ()  {KdsoInit##DllName (); } }; \
00079     static Init##DllName Flakel##DllName; \
00080         extern "C" void KdsoDone( void ) \
00081         { \
00082         EntryPoint##DllName(kFBDllUnLoad);\
00083         }\
00084     void EntryPoint##DllName(kFBDllOperation Startup)
00085 #elif defined(KARCH_ENV_MACOSX)
00086     #define FB_DLL_INIT( DllName,Startup ) \
00087     void EntryPoint##DllName(kFBDllOperation Startup); \
00088     extern "C" void KdsoInit##DllName( void ) \
00089     { \
00090         EntryPoint##DllName(kFBDllLoad);\
00091     }\
00092     extern "C" void KdsoDone##DllName( void ) \
00093     { \
00094         EntryPoint##DllName(kFBDllUnLoad);\
00095     }\
00096     void EntryPoint##DllName(kFBDllOperation Startup)
00097 
00098 #endif
00099 
00100 #define KO_MODULE_CALL( Name ) \
00101     extern void KModule##Name( ); \
00102     KModule##Name( );
00103 
00104 #ifdef KARCH_ENV_MACOSX
00105 #define FB_EXT_INIT(libname)\
00106 {\
00107      void KdsoInit##libname( void ); \
00108     KdsoInit##libname();\
00109 }
00110 #else
00111 #define FB_EXT_INIT(libname)
00112 #endif
00113 
00114 #endif