00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef GIMP_PRINT_MODULE_H
00031 #define GIMP_PRINT_MODULE_H
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #include <gimp-print/list.h>
00038
00039 #ifdef USE_LTDL
00040 #include <ltdl.h>
00041 #elif defined(USE_DLOPEN)
00042 #include <dlfcn.h>
00043 #endif
00044
00045
00046 #ifdef USE_LTDL
00047 #define DLOPEN(Filename) lt_dlopen(Filename)
00048 #define DLSYM(Handle, Symbol) lt_dlsym(Handle, Symbol)
00049 #define DLCLOSE(Handle) lt_dlclose(Handle)
00050 #define DLERROR() lt_dlerror()
00051 #elif defined(USE_DLOPEN)
00052 #define DLOPEN(Filename) dlopen(Filename, RTLD_LAZY)
00053 #define DLSYM(Handle, Symbol) stp_dlsym(Handle, Symbol, modulename)
00054 #define DLCLOSE(Handle) dlclose(Handle)
00055 #define DLERROR() dlerror()
00056 #endif
00057
00058 typedef struct stp_module_version
00059 {
00060 int major;
00061 int minor;
00062 } stp_module_version_t;
00063
00064
00065 typedef enum
00066 {
00067 STP_MODULE_CLASS_INVALID,
00068 STP_MODULE_CLASS_MISC,
00069 STP_MODULE_CLASS_FAMILY,
00070 STP_MODULE_CLASS_COLOR,
00071 STP_MODULE_CLASS_DITHER
00072 } stp_module_class_t;
00073
00074
00075 typedef struct stp_module
00076 {
00077 const char *name;
00078 const char *version;
00079 const char *comment;
00080 stp_module_class_t class;
00081 #ifdef USE_LTDL
00082 lt_dlhandle handle;
00083 #else
00084 void *handle;
00085 #endif
00086 int (*init)(void);
00087 int (*fini)(void);
00088 void *syms;
00089
00090
00091 } stp_module_t;
00092
00093
00094 extern int stp_module_load(void);
00095 extern int stp_module_exit(void);
00096 extern int stp_module_open(const char *modulename);
00097 extern int stp_module_init(void);
00098 extern int stp_module_close(stp_list_item_t *module);
00099 extern stp_list_t *stp_module_get_class(stp_module_class_t class);
00100
00101
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105
00106 #endif