ToolsPluginData Struct Reference
VMware Tools Plugins

`#include <plugin.h>`

## Data Fields

char const * | name
GArray * | regs
gboolean(* | errorCb )(ToolsAppCtx *ctx, ToolsAppType type, gpointer data, struct ToolsPluginData *plugin)
gpointer | _private

## Detailed Description

The registration data for an application. This gives the service information about all functionality exported by the application, and any events that the application may be interested in.

When the plugin is shut down, if the regs field is not NULL, it (and its element array) are freed with g_array_free().

Plugins shouldn't try to free the returned structure, since the container will try to use it even after the shutdown signal is sent to plugins. The pointer should either point to statically allocated memory, or be leaked (which should't be a problem since it will only be really leaked when the process is shutting down).

## Field Documentation

## _private

gpointer ToolsPluginData::_private

Private plugin data.

## errorCb

gboolean(* ToolsPluginData::errorCb) (ToolsAppCtx *ctx, ToolsAppType type, gpointer data, struct ToolsPluginData *plugin)

Callback for registration errors. Whenever an entry provided in the regs array fails to be registered, this function, if provided, will be called.

The plugin has two options when this callback fires:

. adjust its internal state so that the failed registration doesn't affect the normal operation of the other functions provided by the plugin, and return TRUE.

. return FALSE so that the container does not try to register any more features of the plugin.

Note that in either case, registrations that succeeded will not be reverted, so the plugin should still make sure that those still work, event if just in a "disabled" state. The plugin will not be unloaded when these errors happen.

Plugins can use the property of the regs field that registration will happen in the order returned by the plugin's "on load" callback to have some control about what features to enable / disable.

Parameters

  [in] | ctx | The application context.
  [in] | type | Type of the app that failed to register.
  [in] | data | App-specific data that failed to register. If NULL, it means that no provider of the given type exists.
  [in] | plugin | The plugin's registration data.

Returns
  See above. TRUE to continue registration, FALSE to stop.

## name

char const* ToolsPluginData::name

Name of the application (required).

## regs

GArray* ToolsPluginData::regs

List of features provided by the app. Registration of applications happens in the same order provided by this array.

The documentation for this struct was generated from the following file:

- lib/include/vmware/tools/plugin.h