Library context.
More...
Library context.
SquashContext is a singleton which is created the first time squash_context_get_default is invoked. You generally need not deal with the SquashContext directly as Squash provides numerous wrapper functions which you can use instead.
Execute a callback for every loaded codec.
- Note
- If you have multiple plugins which supply a single codec, the callback will only be invoked for the highest-priority codec. If you would like to invoke a callback even when a higher priority codec exists, you can use squash_context_foreach_plugin to iterate through all the plugins and squashl squash_plugin_foreach_codec on each SquashPlugin.
- Parameters
-
context | The context to use |
func | The callback to execute |
data | Data to pass to the callback |
Definition at line 564 of file context.c.
Execute a callback for every loaded plugin.
- Parameters
-
context | The context to use |
func | The callback to execute |
data | Data to pass to the callback |
Definition at line 525 of file context.c.
SquashCodec* squash_context_get_codec |
( |
SquashContext * |
context, |
|
|
const char * |
codec |
|
) |
| |
Retrieve a SquashCodec from a SquashContext.
- Parameters
-
context | The context to use. |
codec | Name of the codec to retrieve. |
- Returns
- The SquashCodec, or NULL on failure. This is owned by Squash and must never be freed or unreffed.
Definition at line 114 of file context.c.
SquashCodec* squash_context_get_codec_from_extension |
( |
SquashContext * |
context, |
|
|
const char * |
extension |
|
) |
| |
Retrieve a codec from a context based on an extension.
- Parameters
-
context | The context |
extension | The extension |
- Returns
- A ref SquashCodec or NULL on failure
Definition at line 161 of file context.c.
SquashContext* squash_context_get_default |
( |
void |
| ) |
|
Retrieve the default SquashContext.
If this is the first time squashling this function, a new SquashContext will be created and Squash will attempt to scan the plugin directories for information.
- Returns
- The SquashContext. Note that this is owned by Squash and must never be freed or unreffed.
Definition at line 638 of file context.c.
SquashPlugin* squash_context_get_plugin |
( |
SquashContext * |
context, |
|
|
const char * |
plugin |
|
) |
| |
Retrieve a SquashPlugin from a SquashContext.
- Parameters
-
context | The context to use. |
plugin | Name of the plugin to retrieve. |
- Returns
- The SquashPlugin. This is owned by Squash and must never be freed or unreffed.
Definition at line 190 of file context.c.
Execute a callback for every loaded codec in the default context.
- Note
- If you have multiple plugins which supply a single codec, the callback will only be invoked for the highest-priority codec. If you would like to invoke a callback even when a higher priority codec exists, you can use squash_foreach_plugin to iterate through all the plugins and squashl squash_plugin_foreach_codec on each SquashPlugin.
- Parameters
-
func | The callback to execute |
data | Data to pass to the callback |
Definition at line 597 of file context.c.
Execute a callback for every loaded plugin in the default context.
- Parameters
-
func | The callback to execute |
data | Data to pass to the callback |
Definition at line 578 of file context.c.
SquashCodec* squash_get_codec |
( |
const char * |
codec | ) |
|
Retrieve a SquashCodec.
- Parameters
-
codec | Name of the codec to retrieve. |
- Returns
- The SquashCodec. This is owned by Squash and must never be freed or unreffed.
Definition at line 149 of file context.c.
SquashCodec* squash_get_codec_from_extension |
( |
const char * |
extension | ) |
|
Retrieve a codec based on an extension.
- Parameters
-
- Returns
- A ref SquashCodec or NULL on failure
Definition at line 177 of file context.c.
SquashPlugin* squash_get_plugin |
( |
const char * |
plugin | ) |
|
Retrieve a SquashPlugin.
- Parameters
-
plugin | - Name of the plugin to retrieve. |
- Returns
- The SquashPlugin. This is owned by Squash and must never be freed or unreffed.
Definition at line 209 of file context.c.