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

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 cat(x, y)   x ## y
 concatenation macro, joins args x and y together as a single string More...
 
#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 vmdplugin_ABIVERSION   18
 Use this macro to initialize the abiversion member of each plugin. More...
 
#define VMDPLUGIN_API
 Detect compilations targeting Windows x86 and x64 platforms. More...
 
#define VMDPLUGIN_ERROR   -1
 
#define VMDPLUGIN_EXTERN   VMDPLUGIN_API
 define plugin linkage correctly for both C and C++ based plugins More...
 
#define VMDPLUGIN_fini   xcat(VMDPLUGIN, _fini)
 
#define vmdplugin_HEAD
 Macro for creating a struct header used in all plugin structures. More...
 
#define VMDPLUGIN_init   xcat(VMDPLUGIN, _init)
 
#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_SUCCESS   0
 Error return code for use in the plugin registration and init functions. More...
 
#define VMDPLUGIN_THREADSAFE   1
 
#define VMDPLUGIN_THREADUNSAFE   0
 Use this macro to indicate a plugin's thread-safety at registration time. More...
 
#define xcat(x, y)   cat(x, y)
 concatenation macro, joins args x and y together as a single string More...
 

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_fini (void)
 The Fini method is called when the application will no longer use any plugins in the library. More...
 
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...
 

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

◆ cat

#define cat (   x,
 
)    x ## y

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

◆ VMD_PLUGIN_H

#define VMD_PLUGIN_H

◆ VMDPLUGIN

#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.

◆ vmdplugin_ABIVERSION

#define vmdplugin_ABIVERSION   18

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

◆ VMDPLUGIN_API

#define VMDPLUGIN_API

Detect compilations targeting Windows x86 and x64 platforms.

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

◆ VMDPLUGIN_ERROR

#define VMDPLUGIN_ERROR   -1

◆ VMDPLUGIN_EXTERN

#define VMDPLUGIN_EXTERN   VMDPLUGIN_API

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

◆ VMDPLUGIN_fini

#define VMDPLUGIN_fini   xcat(VMDPLUGIN, _fini)

◆ vmdplugin_HEAD

#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.

◆ VMDPLUGIN_init

#define VMDPLUGIN_init   xcat(VMDPLUGIN, _init)

◆ VMDPLUGIN_register

#define VMDPLUGIN_register   xcat(VMDPLUGIN, _register)

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

◆ VMDPLUGIN_register_tcl

#define VMDPLUGIN_register_tcl   xcat(VMDPLUGIN, _register_tcl)

◆ VMDPLUGIN_SUCCESS

#define VMDPLUGIN_SUCCESS   0

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

◆ VMDPLUGIN_THREADSAFE

#define VMDPLUGIN_THREADSAFE   1

◆ VMDPLUGIN_THREADUNSAFE

#define VMDPLUGIN_THREADUNSAFE   0

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

◆ xcat

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

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