]> git.imager.perl.org - imager.git/blob - dynaload.h
mark end of 0.40pre1 changes
[imager.git] / dynaload.h
1 #ifndef _DYNALOAD_H_
2 #define _DYNALOAD_H_
3
4 #include "log.h"
5
6 #if defined(OS_hpux)
7 #include <dl.h>
8 typedef shl_t minthandle_t;
9 #elif defined(WIN32)
10 #define WIN32_LEAN_AND_MEAN
11 #include <windows.h>
12 typedef HMODULE minthandle_t;
13 #undef WIN32_LEAN_AND_MEAN
14 #elif defined(OS_darwin)
15 #define DL_LOADONCEONLY
16 #define DLSYMUN
17 #undef environ
18 #undef bool
19
20 #import <mach-o/dyld.h>
21 typedef void *minthandle_t; 
22 #else 
23 #include <dlfcn.h>
24 typedef void *minthandle_t; 
25 #endif 
26
27 #include "EXTERN.h"
28 #include "perl.h"
29 #include "ppport.h"
30
31 #include "ext.h"
32
33 typedef struct {
34   minthandle_t handle;
35   char *filename;
36   func_ptr *function_list;
37 } DSO_handle;
38
39 typedef struct {
40   HV* hv;
41   char *key;
42   void *store;
43 } UTIL_args;
44
45 int getobj(void *hv_t,char *key,char *type,void **store);
46 int getint(void *hv_t,char *key,int *store);
47 int getdouble(void *hv_t,char *key,double *store);
48 int getvoid(void *hv_t,char *key,void **store);
49
50
51 void *DSO_open(char* file,char** evalstring);
52 int DSO_close(void *);
53 void DSO_call(DSO_handle *handle,int func_index,HV* hv);
54
55 #ifdef __EMX__ /* OS/2 */
56 # ifndef RTLD_LAZY
57 #  define RTLD_LAZY 0
58 # endif /* RTLD_LAZY */
59 int dlclose(minthandle_t);
60 #endif /* __EMX__ */
61
62 #ifdef DLSYMUN
63
64 #define I_EVALSTR "_evalstr"
65 #define I_SYMBOL_TABLE "_symbol_table"
66 #define I_UTIL_TABLE "_util_table"
67 #define I_FUNCTION_LIST "_function_list"
68 #define I_INSTALL_TABLES "_install_tables"
69
70 #else 
71
72 #define I_EVALSTR "evalstr"
73 #define I_SYMBOL_TABLE "symbol_table"
74 #define I_UTIL_TABLE "util_table"
75 #define I_FUNCTION_LIST "function_list"
76 #define I_INSTALL_TABLES "install_tables"
77
78 #endif
79
80 #endif /* _DYNALOAD_H_ */
81