Classes | Namespaces | Macros | Typedefs | Functions
vmdplugin.h File Reference

This header must be included by every VMD plugin library. More...

Classes

struct  PLMD::molfile::vmdplugin_t
 Typedef for generic plugin header, individual plugins can make their own structures as long as the header info remains the same as the generic plugin header, most easily done by using the vmdplugin_HEAD macro. More...
 

Namespaces

 PLMD
 
 PLMD::molfile
 

Macros

#define VMD_PLUGIN_H
 
#define VMDPLUGIN   vmdplugin
 macro defining VMDPLUGIN if it hasn't already been set to the name of a static plugin that is being compiled. More...
 
#define xcat(x, y)   cat(x, y)
 concatenation macro, joins args x and y together as a single string More...
 
#define cat(x, y)   x ## y
 concatenation macro, joins args x and y together as a single string More...
 
#define VMDPLUGIN_API
 "WIN32" is defined on both WIN32 and WIN64 platforms... More...
 
#define VMDPLUGIN_EXTERN   VMDPLUGIN_API
 define plugin linkage correctly for both C and C++ based plugins More...
 
#define vmdplugin_HEAD
 Macro for creating a struct header used in all plugin structures. More...
 
#define vmdplugin_ABIVERSION   16
 Use this macro to initialize the abiversion member of each plugin. More...
 
#define VMDPLUGIN_register   xcat(VMDPLUGIN, _register)
 Macro names entry points correctly for static linkage or dynamic loading. More...
 
#define VMDPLUGIN_register_tcl   xcat(VMDPLUGIN, _register_tcl)
 
#define VMDPLUGIN_init   xcat(VMDPLUGIN, _init)
 
#define VMDPLUGIN_fini   xcat(VMDPLUGIN, _fini)
 
#define VMDPLUGIN_THREADUNSAFE   0
 Use this macro to indicate a plugin's thread-safety at registration time. More...
 
#define VMDPLUGIN_THREADSAFE   1
 
#define VMDPLUGIN_SUCCESS   0
 Error return code for use in the plugin registration and init functions. More...
 
#define VMDPLUGIN_ERROR   -1
 

Typedefs

typedef int(* PLMD::molfile::vmdplugin_register_cb) (void *, vmdplugin_t *)
 Function pointer typedef for register callback functions. More...
 

Functions

VMDPLUGIN_EXTERN int PLMD::molfile::VMDPLUGIN_init (void)
 Init routine: called the first time the library is loaded by the application and before any other API functions are referenced. More...
 
VMDPLUGIN_EXTERN int PLMD::molfile::VMDPLUGIN_register (void *, vmdplugin_register_cb)
 Allow the library to register plugins with the application. More...
 
VMDPLUGIN_EXTERN int PLMD::molfile::VMDPLUGIN_register_tcl (void *, void *tcl_interp, vmdplugin_register_cb)
 Allow the library to register Tcl extensions. More...
 
VMDPLUGIN_EXTERN int PLMD::molfile::VMDPLUGIN_fini (void)
 The Fini method is called when the application will no longer use any plugins in the library. More...
 

Detailed Description

This header must be included by every VMD plugin library.

It defines the API for every plugin so that VMD can organize the plugins it finds.

Macro Definition Documentation

#define cat (   x,
 
)    x ## y

concatenation macro, joins args x and y together as a single string

#define VMD_PLUGIN_H
#define VMDPLUGIN   vmdplugin

macro defining VMDPLUGIN if it hasn't already been set to the name of a static plugin that is being compiled.

This is the catch-all case.

#define vmdplugin_ABIVERSION   16

Use this macro to initialize the abiversion member of each plugin.

#define VMDPLUGIN_API

"WIN32" is defined on both WIN32 and WIN64 platforms...

If we're not compiling on Windows, then this macro is defined empty

#define VMDPLUGIN_ERROR   -1
#define VMDPLUGIN_EXTERN   VMDPLUGIN_API

define plugin linkage correctly for both C and C++ based plugins

#define VMDPLUGIN_fini   xcat(VMDPLUGIN, _fini)
#define vmdplugin_HEAD
Value:
int abiversion; \
const char *type; \
const char *name; \
const char *prettyname; \
const char *author; \
int majorv; \
int minorv; \
int is_reentrant;

Macro for creating a struct header used in all plugin structures.

This header should be placed at the top of every plugin API definition so that it can be treated as a subtype of the base plugin type.

abiversion: Defines the ABI for the base plugin type (not for other plugins) type: A string descriptor of the plugin type. name: A name for the plugin. author: A string identifier, possibly including newlines. Major and minor version. is_reentrant: Whether this library can be run concurrently with itself.

#define VMDPLUGIN_init   xcat(VMDPLUGIN, _init)
#define VMDPLUGIN_register   xcat(VMDPLUGIN, _register)

Macro names entry points correctly for static linkage or dynamic loading.

#define VMDPLUGIN_register_tcl   xcat(VMDPLUGIN, _register_tcl)
#define VMDPLUGIN_SUCCESS   0

Error return code for use in the plugin registration and init functions.

#define VMDPLUGIN_THREADSAFE   1
#define VMDPLUGIN_THREADUNSAFE   0

Use this macro to indicate a plugin's thread-safety at registration time.

#define xcat (   x,
 
)    cat(x, y)

concatenation macro, joins args x and y together as a single string