libguac  0.7.0
Data Structures | Defines | Functions
plugin.h File Reference

Provides functions and structures required for handling a client plugin. More...

Go to the source code of this file.

Data Structures

struct  guac_client_plugin
 A handle to a client plugin, containing enough information about the plugin to complete the initial protocol handshake and instantiate a new client supporting the protocol provided by the client plugin. More...

Defines

#define GUAC_PROTOCOL_LIBRARY_PREFIX   "libguac-client-"
 String prefix which begins the library filename of all client plugins.
#define GUAC_PROTOCOL_LIBRARY_SUFFIX   ".so"
 String suffix which ends the library filename of all client plugins.
#define GUAC_PROTOCOL_NAME_LIMIT   256
 The maximum number of characters (COUNTING NULL TERMINATOR) to allow for protocol names within the library filename of client plugins.
#define GUAC_PROTOCOL_LIBRARY_LIMIT
 The maximum number of characters (INCLUDING NULL TERMINATOR) that a character array containing the concatenation of the library prefix, protocol name, and suffix can contain, assuming the protocol name is limited to GUAC_PROTOCOL_NAME_LIMIT characters.

Functions

guac_client_pluginguac_client_plugin_open (const char *protocol)
 Open the plugin which provides support for the given protocol, if it exists.
int guac_client_plugin_close (guac_client_plugin *plugin)
 Close the given plugin, releasing all associated resources.
int guac_client_plugin_init_client (guac_client_plugin *plugin, guac_client *client, int argc, char **argv)
 Initializes the given guac_client using the initialization routine provided by the given guac_client_plugin.

Detailed Description

Provides functions and structures required for handling a client plugin.


Define Documentation

#define GUAC_PROTOCOL_LIBRARY_LIMIT
Value:
(                                  \
                                                                       \
      sizeof(GUAC_PROTOCOL_LIBRARY_PREFIX) - 1 /* "libguac-client-" */ \
    +        GUAC_PROTOCOL_NAME_LIMIT      - 1 /* [up to 256 chars] */ \
    + sizeof(GUAC_PROTOCOL_LIBRARY_SUFFIX) - 1 /* ".so"             */ \
    + 1                                        /* NULL terminator   */ \
                                                                       \
)

The maximum number of characters (INCLUDING NULL TERMINATOR) that a character array containing the concatenation of the library prefix, protocol name, and suffix can contain, assuming the protocol name is limited to GUAC_PROTOCOL_NAME_LIMIT characters.


Function Documentation

int guac_client_plugin_close ( guac_client_plugin plugin)

Close the given plugin, releasing all associated resources.

This function must be called after use of a client plugin is finished.

Parameters:
pluginThe client plugin to close.
Returns:
Zero on success, non-zero if an error occurred while releasing the resources associated with the plugin.
int guac_client_plugin_init_client ( guac_client_plugin plugin,
guac_client client,
int  argc,
char **  argv 
)

Initializes the given guac_client using the initialization routine provided by the given guac_client_plugin.

Parameters:
pluginThe client plugin to use to initialize the new client.
clientThe guac_client to initialize.
argcThe number of arguments being passed to the client.
argvAll arguments to be passed to the client.
Returns:
Zero if initialization was successful, non-zero otherwise.
guac_client_plugin* guac_client_plugin_open ( const char *  protocol)

Open the plugin which provides support for the given protocol, if it exists.

Parameters:
protocolThe name of the protocol to retrieve the client plugin for.
Returns:
The client plugin supporting the given protocol, or NULL if an error occurs or no such plugin exists.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines