Squash  0.7.0
Data Structures | Typedefs | Functions
SquashPlugin

A plugin. More...

Data Structures

struct  SquashPlugin
 A plugin. More...
 

Typedefs

typedef void(* SquashPluginForeachFunc) (SquashPlugin *plugin, void *data)
 Squashlback to be invoked on each SquashPlugin in a set. More...
 

Functions

SquashStatus squash_plugin_init (SquashPlugin *plugin)
 load a SquashPlugin More...
 
const char * squash_plugin_get_name (SquashPlugin *plugin)
 Get the name of a plugin. More...
 
SquashLicense * squash_plugin_get_licenses (SquashPlugin *plugin)
 Get the licenses of the plugin. More...
 
SquashCodec * squash_plugin_get_codec (SquashPlugin *plugin, const char *codec)
 Get a codec from a plugin by name. More...
 
void squash_plugin_foreach_codec (SquashPlugin *plugin, SquashCodecForeachFunc func, void *data)
 Execute a callback for every codec in the plugin. More...
 

Detailed Description

A plugin.

Typedef Documentation

SquashPluginForeachFunc

Squashlback to be invoked on each SquashPlugin in a set.

Parameters
pluginA plugin
dataUser-supplied data

Definition at line 42 of file plugin.h.

Function Documentation

void squash_plugin_foreach_codec ( SquashPlugin *  plugin,
SquashCodecForeachFunc  func,
void *  data 
)

Execute a callback for every codec in the plugin.

Note
func will be invoked for all codecs supplied by this plugin, even if a higher-priority implementation exists in another plugin. If you only want to list the codecs which supply the highest-priority implementations available, you can use squash_foreach_codec. If not jumping around the hierarchy is important, you can test to see if a codec provides the highest priority implementation by comparing the codec to the return value of squash_get_codec.
Parameters
pluginThe plugin
funcThe callback to execute
dataData to pass to the callback

Definition at line 298 of file plugin.c.

SquashCodec* squash_plugin_get_codec ( SquashPlugin *  plugin,
const char *  codec 
)

Get a codec from a plugin by name.

Parameters
pluginThe plugin.
codecThe codec name.
Returns
The codec, or NULL if it could not be found.

Definition at line 198 of file plugin.c.

SquashLicense* squash_plugin_get_licenses ( SquashPlugin *  plugin)

Get the licenses of the plugin.

Parameters
pluginThe plugin.
Returns
An array of the plugin's licenses terminated with SQUASH_LICENSE_UNKNOWN, or NULL if no licenses were specified.

Definition at line 184 of file plugin.c.

const char* squash_plugin_get_name ( SquashPlugin *  plugin)

Get the name of a plugin.

Parameters
pluginThe plugin.
Returns
The name.

Definition at line 170 of file plugin.c.

SquashStatus squash_plugin_init ( SquashPlugin *  plugin)

load a SquashPlugin

Note
This function is generally only useful inside of a callback passed to squash_foreach_plugin. Every other way to get a plugin (such as squash_get_plugin) will initialize the plugin as well (and return NULL instead of the plugin if initialization fails). The foreach functions, however, do not initialize the plugin since doing so requires actually loading the plugin.
Parameters
pluginThe plugin to load.
Returns
A status code.
Return values
SQUASH_OKThe plugin has been loaded.
SQUASH_UNABLE_TO_LOADUnable to load plugin.

Definition at line 101 of file plugin.c.