Squash  0.7.0
plugin.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_PLUGIN_H
28 #define SQUASH_PLUGIN_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 SquashStatus squash_plugin_init (SquashPlugin* plugin);
37 
38 SQUASH_API const char* squash_plugin_get_name (SquashPlugin* plugin);
39 SQUASH_API SquashLicense* squash_plugin_get_licenses (SquashPlugin* plugin);
40 SQUASH_API SquashCodec* squash_plugin_get_codec (SquashPlugin* plugin, const char* codec);
41 
42 typedef void (*SquashPluginForeachFunc) (SquashPlugin* plugin, void* data);
43 
44 SQUASH_API void squash_plugin_foreach_codec (SquashPlugin* plugin, SquashCodecForeachFunc func, void* data);
45 
46 #if defined _WIN32 || defined __CYGWIN__
47 # ifdef __GNUC__
48 # define SQUASH_PLUGIN_EXPORT __attribute__ ((dllexport))
49 # else
50 # define SQUASH_PLUGIN_EXPORT __declspec(dllexport)
51 # endif
52 #else
53 # if __GNUC__ >= 4
54 # define SQUASH_PLUGIN_EXPORT __attribute__ ((visibility ("default")))
55 # else
56 # define SQUASH_PLUGIN_EXPORT
57 # endif
58 #endif
59 
60 SQUASH_END_DECLS
61 
62 #endif /* SQUASH_PLUGIN_H */
void(* SquashPluginForeachFunc)(SquashPlugin *plugin, void *data)
Squashlback to be invoked on each SquashPlugin in a set.
Definition: plugin.h:42
SQUASH_API void squash_plugin_foreach_codec(SquashPlugin *plugin, SquashCodecForeachFunc func, void *data)
Execute a callback for every codec in the plugin.
Definition: plugin.c:298
SQUASH_API SquashLicense * squash_plugin_get_licenses(SquashPlugin *plugin)
Get the licenses of the plugin.
Definition: plugin.c:184
SquashStatus
Status codes.
Definition: status.h:36
void(* SquashCodecForeachFunc)(SquashCodec *codec, void *data)
Squashlback to be invoked on each SquashCodec in a set.
Definition: codec.h:97
SQUASH_BEGIN_DECLS SQUASH_API SquashStatus squash_plugin_init(SquashPlugin *plugin)
load a SquashPlugin
Definition: plugin.c:101
SQUASH_API SquashCodec * squash_plugin_get_codec(SquashPlugin *plugin, const char *codec)
Get a codec from a plugin by name.
Definition: plugin.c:198
SQUASH_API const char * squash_plugin_get_name(SquashPlugin *plugin)
Get the name of a plugin.
Definition: plugin.c:170