Squash  0.7.0
Data Structures | Typedefs | Functions

A plugin. More...

Data Structures

struct  SquashPlugin
 A plugin. More...


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


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


Squashlback to be invoked on each SquashPlugin in a set.

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.

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

pluginThe plugin.
codecThe codec name.
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.

pluginThe plugin.
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.

pluginThe plugin.
The name.

Definition at line 170 of file plugin.c.

SquashStatus squash_plugin_init ( SquashPlugin *  plugin)

load a SquashPlugin

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.
pluginThe plugin to load.
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.