Squash  0.7.0
context.h
1 /* Copyright (c) 2013 The Squash Authors
2  *
3  * Permission is hereby granted, free of charge, to any person
4  * obtaining a copy of this software and associated documentation
5  * files (the "Software"), to deal in the Software without
6  * restriction, including without limitation the rights to use, copy,
7  * modify, merge, publish, distribute, sublicense, and/or sell copies
8  * of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be
12  * included in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21  * SOFTWARE.
22  *
23  * Authors:
24  * Evan Nemerson <evan@nemerson.com>
25  */
26 
27 #ifndef SQUASH_CONTEXT_H
28 #define SQUASH_CONTEXT_H
29 
30 #if !defined (SQUASH_H_INSIDE) && !defined (SQUASH_COMPILATION)
31 #error "Only <squash/squash.h> can be included directly."
32 #endif
33 
34 SQUASH_BEGIN_DECLS
35 
36 SQUASH_API SquashContext* squash_context_get_default (void);
37 SQUASH_API SquashPlugin* squash_context_get_plugin (SquashContext* context, const char* plugin);
38 SQUASH_API SquashCodec* squash_context_get_codec (SquashContext* context, const char* codec);
39 SQUASH_API void squash_context_foreach_plugin (SquashContext* context, SquashPluginForeachFunc func, void* data);
40 SQUASH_API void squash_context_foreach_codec (SquashContext* context, SquashCodecForeachFunc func, void* data);
41 SQUASH_API SquashCodec* squash_context_get_codec_from_extension (SquashContext* context, const char* extension);
42 
43 SQUASH_API SquashPlugin* squash_get_plugin (const char* plugin);
44 SQUASH_API SquashCodec* squash_get_codec (const char* codec);
45 SQUASH_API void squash_foreach_plugin (SquashPluginForeachFunc func, void* data);
46 SQUASH_API void squash_foreach_codec (SquashCodecForeachFunc func, void* data);
47 SQUASH_API SquashCodec* squash_get_codec_from_extension (const char* extension);
48 
49 SQUASH_END_DECLS
50 
51 #endif /* SQUASH_CONTEXT_H */
SQUASH_API SquashPlugin * squash_context_get_plugin(SquashContext *context, const char *plugin)
Retrieve a SquashPlugin from a SquashContext.
Definition: context.c:190
SQUASH_API SquashCodec * squash_get_codec(const char *codec)
Retrieve a SquashCodec.
Definition: context.c:149
void(* SquashPluginForeachFunc)(SquashPlugin *plugin, void *data)
Squashlback to be invoked on each SquashPlugin in a set.
Definition: plugin.h:42
SQUASH_API SquashCodec * squash_get_codec_from_extension(const char *extension)
Retrieve a codec based on an extension.
Definition: context.c:177
SQUASH_BEGIN_DECLS SQUASH_API SquashContext * squash_context_get_default(void)
Retrieve the default SquashContext.
Definition: context.c:638
SQUASH_API SquashPlugin * squash_get_plugin(const char *plugin)
Retrieve a SquashPlugin.
Definition: context.c:209
SQUASH_API void squash_context_foreach_codec(SquashContext *context, SquashCodecForeachFunc func, void *data)
Execute a callback for every loaded codec.
Definition: context.c:564
SQUASH_API SquashCodec * squash_context_get_codec(SquashContext *context, const char *codec)
Retrieve a SquashCodec from a SquashContext.
Definition: context.c:114
void(* SquashCodecForeachFunc)(SquashCodec *codec, void *data)
Squashlback to be invoked on each SquashCodec in a set.
Definition: codec.h:97
SQUASH_API SquashCodec * squash_context_get_codec_from_extension(SquashContext *context, const char *extension)
Retrieve a codec from a context based on an extension.
Definition: context.c:161
SQUASH_API void squash_foreach_codec(SquashCodecForeachFunc func, void *data)
Execute a callback for every loaded codec in the default context.
Definition: context.c:597
SQUASH_API void squash_context_foreach_plugin(SquashContext *context, SquashPluginForeachFunc func, void *data)
Execute a callback for every loaded plugin.
Definition: context.c:525
SQUASH_API void squash_foreach_plugin(SquashPluginForeachFunc func, void *data)
Execute a callback for every loaded plugin in the default context.
Definition: context.c:578