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