Utilities
Module: Plugins
Utilities to assist in plugin authoring, provided by the vrtree-linker library.
Functions
| Type | Name | 
|---|---|
| void | registerYield(VRPProgressYieldProc proc) Internal implementation of VRProgressYield which stores the progress function and exposes it via progress_yield.  | 
Defines
| Type | Name | 
|---|---|
| LOG_DEBUG  Type passed to a VRPLogProc for debug messages.  | |
| LOG_ERROR  Type passed to a VRPLogProc for error messages.  | |
| LOG_INFO  Type passed to a VRPLogProc for info (standard) messages.  | |
| LOG_WARN  Type passed to a VRPLogProc for warning messages.  | |
| VRPLUGIN_API_IMPL  Combines all helper impl macros.  | |
| VRPLUGIN_API_LOGIMPL  Implements the log registration functions and provides static variables to store the registered log functions, s_logFunc and s_logIndentFunc | |
| VRPLUGIN_API_PERMISSIONIMPL  Implements permission registration functions and provides static variables to store the registered permission functions, s_hasPermissionFunc and s_reqPermissionFunc | |
| VRPLUGIN_API_STDIMPL  Implements the major and minor version query functions.  | |
| VRPLUGIN_API_YIELDIMPL  Implements progress yield registration function and wraps it in progress_yield.  | |
| VRPLUGIN_IMPORT_PERMISSION(NAME)  Helper macro that checks and calls the registered VRPRequestPermissionProc to trigger an application license check. Inserts a return 1 on failure, so should be used in a function that returns an int. | |
| VRPLUGIN_INIT_PERMISSION(NAME)  Helper macro that checks the existence of the registered VRPHasPermissionProc and calls it. Inserts a return 1 on failure, so should be used in a function that returns an int. | |
| VRPLUGIN_INJECT_CORE_LOG  Internal use for Virtalis plugins.  | |
| VRPLUGIN_INJECT_CORE_YIELD  Internal use for Virtalis plugins.  | |
| VRPLUGIN_LOADVRTREE  Loads all the VRTree C API entry points.  | 
Functions Documentation
registerYield
void registerYield(
    VRPProgressYieldProc proc
)
Internal implementation of VRProgressYield which stores the progress function and exposes it via progress_yield.
Macros Documentation
define LOG_DEBUG
#define LOG_DEBUG 3
Type passed to a VRPLogProc for debug messages.
define LOG_ERROR
#define LOG_ERROR 2
Type passed to a VRPLogProc for error messages.
define LOG_INFO
#define LOG_INFO 0
Type passed to a VRPLogProc for info (standard) messages.
define LOG_WARN
#define LOG_WARN 1
Type passed to a VRPLogProc for warning messages.
define VRPLUGIN_API_IMPL
#define VRPLUGIN_API_IMPL VRPLUGIN_API_STDIMPL;      \
  VRPLUGIN_API_LOGIMPL;      \
  VRPLUGIN_API_YIELDIMPL;    \
  VRPLUGIN_API_PERMISSIONIMPL
Combines all helper impl macros.
define VRPLUGIN_API_LOGIMPL
#define VRPLUGIN_API_LOGIMPL static VRPLogProc s_logFunc = NULL;                                   \
  PLUGIN_ENTRY_POINT void VRTREE_APIENTRY VRPRegisterLog(VRPLogProc proc) { s_logFunc = proc; } \
  static VRPLogIndentProc s_logIndentFunc = NULL;                       \
  PLUGIN_ENTRY_POINT void VRTREE_APIENTRY VRPRegisterLogIndent(VRPLogIndentProc proc) { s_logIndentFunc = proc; }
Implements the log registration functions and provides static variables to store the registered log functions, s_logFunc and s_logIndentFunc
define VRPLUGIN_API_PERMISSIONIMPL
#define VRPLUGIN_API_PERMISSIONIMPL static VRPHasPermissionProc s_hasPermissionFunc = NULL;               \
  PLUGIN_ENTRY_POINT void VRTREE_APIENTRY VRPRegisterHasPermission(VRPHasPermissionProc proc) { s_hasPermissionFunc = proc; } \
  static VRPRequestPermissionProc s_reqPermissionFunc = NULL;           \
  PLUGIN_ENTRY_POINT void VRTREE_APIENTRY VRPRegisterRequestPermission(VRPRequestPermissionProc proc) { s_reqPermissionFunc = proc; }
Implements permission registration functions and provides static variables to store the registered permission functions, s_hasPermissionFunc and s_reqPermissionFunc
define VRPLUGIN_API_STDIMPL
#define VRPLUGIN_API_STDIMPL PLUGIN_ENTRY_POINT int VRTREE_APIENTRY VRPGetAPIVersionMajor() { return PLUGIN_API_VERSION_MAJOR; } \
  PLUGIN_ENTRY_POINT int VRTREE_APIENTRY VRPGetAPIVersionMinor() { return PLUGIN_API_VERSION_MINOR; }
Implements the major and minor version query functions.
define VRPLUGIN_API_YIELDIMPL
#define VRPLUGIN_API_YIELDIMPL PLUGIN_ENTRY_POINT void VRTREE_APIENTRY VRPRegisterProgressYield(VRPProgressYieldProc proc) { registerYield(proc); }
Implements progress yield registration function and wraps it in progress_yield.
define VRPLUGIN_IMPORT_PERMISSION
#define VRPLUGIN_IMPORT_PERMISSION(
    NAME
)
if(!s_reqPermissionFunc || s_reqPermissionFunc(NAME, "Cancel Import") == 0) \
    return 1
Helper macro that checks and calls the registered VRPRequestPermissionProc to trigger an application license check. Inserts a return 1 on failure, so should be used in a function that returns an int.
define VRPLUGIN_INIT_PERMISSION
#define VRPLUGIN_INIT_PERMISSION(
    NAME
)
if(!s_hasPermissionFunc) return 1; \
  s_hasPermissionFunc(NAME)
Helper macro that checks the existence of the registered VRPHasPermissionProc and calls it. Inserts a return 1 on failure, so should be used in a function that returns an int.
define VRPLUGIN_INJECT_CORE_LOG
#define VRPLUGIN_INJECT_CORE_LOG 
Internal use for Virtalis plugins.
define VRPLUGIN_INJECT_CORE_YIELD
#define VRPLUGIN_INJECT_CORE_YIELD 
Internal use for Virtalis plugins.
define VRPLUGIN_LOADVRTREE
#define VRPLUGIN_LOADVRTREE {                   \
  int ret = loadVrtree();                       \
  if(ret != 0)                                  \
    return ret; }
Loads all the VRTree C API entry points.