00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #ifndef VMD_PLUGIN_H
00024 #define VMD_PLUGIN_H
00025
00026
00027
00028
00029
00030
00031 #if !defined(VMDPLUGIN)
00032
00036 #define VMDPLUGIN vmdplugin
00037 #endif
00038
00039 #define xcat(x, y) cat(x, y)
00040
00041 #define cat(x, y) x ## y
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00054 #define VMDPLUGIN_register xcat(VMDPLUGIN, _register)
00055 #define VMDPLUGIN_register_tcl xcat(VMDPLUGIN, _register_tcl)
00056 #define VMDPLUGIN_init xcat(VMDPLUGIN, _init)
00057 #define VMDPLUGIN_fini xcat(VMDPLUGIN, _fini)
00058
00062 #if (defined(WIN32))
00063 #define WIN32_LEAN_AND_MEAN
00064 #include <windows.h>
00065
00066 #if defined(VMDPLUGIN_EXPORTS)
00067 #if !defined(STATIC_PLUGIN)
00068
00072 BOOL APIENTRY DllMain( HANDLE hModule,
00073 DWORD ul_reason_for_call,
00074 LPVOID lpReserved
00075 )
00076 {
00077 return TRUE;
00078 }
00079 #endif
00080
00081 #define VMDPLUGIN_API __declspec(dllexport)
00082 #else
00083 #define VMDPLUGIN_API __declspec(dllimport)
00084 #endif
00085 #else
00086
00087 #define VMDPLUGIN_API
00088 #endif
00089
00091 #ifdef __cplusplus
00092 #define VMDPLUGIN_EXTERN extern "C" VMDPLUGIN_API
00093 #else
00094 #define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
00095 #endif
00096
00097
00098
00099
00100
00101
00107 VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
00108
00122 #define vmdplugin_HEAD \
00123 int abiversion; \
00124 const char *type; \
00125 const char *name; \
00126 const char *prettyname; \
00127 const char *author; \
00128 int majorv; \
00129 int minorv; \
00130 int is_reentrant;
00131
00138 typedef struct {
00139 vmdplugin_HEAD
00140 } vmdplugin_t;
00141
00145 #define vmdplugin_ABIVERSION 9
00146
00149 #define VMDPLUGIN_THREADUNSAFE 0
00150 #define VMDPLUGIN_THREADSAFE 1
00151
00155 #define VMDPLUGIN_SUCCESS 0
00156 #define VMDPLUGIN_ERROR -1
00157
00162 typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
00163
00173 VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
00174
00180 VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp,
00181 vmdplugin_register_cb);
00182
00187 VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
00188
00189 #endif