Initial revision
[imager.git] / dynaload.h
CommitLineData
02d1d628
AMH
1#ifndef _DYNALOAD_H_
2#define _DYNALOAD_H_
3
4#include "log.h"
5
6#if defined(OS_hpux)
7#include <dl.h>
8typedef shl_t minthandle_t;
9#elif defined(WIN32)
10#define WIN32_LEAN_AND_MEAN
11#include <windows.h>
12typedef HMODULE minthandle_t;
13#undef WIN32_LEAN_AND_MEAN
14#else
15#include <dlfcn.h>
16typedef void *minthandle_t;
17#endif
18
19#include "EXTERN.h"
20#include "perl.h"
21#include "ppport.h"
22
23#include "ext.h"
24
25typedef struct {
26 minthandle_t handle;
27 char *filename;
28 func_ptr *function_list;
29} DSO_handle;
30
31typedef struct {
32 HV* hv;
33 char *key;
34 void *store;
35} UTIL_args;
36
37int getobj(void *hv_t,char *key,char *type,void **store);
38int getint(void *hv_t,char *key,int *store);
39int getdouble(void *hv_t,char *key,double *store);
40int getvoid(void *hv_t,char *key,void **store);
41
42
43void *DSO_open(char* file,char** evalstring);
44int DSO_close(void *);
45void DSO_call(DSO_handle *handle,int func_index,HV* hv);
46
47#ifdef __EMX__ /* OS/2 */
48# ifndef RTLD_LAZY
49# define RTLD_LAZY 0
50# endif /* RTLD_LAZY */
51int dlclose(minthandle_t);
52#endif /* __EMX__ */
53
54#ifdef DLSYMUN
55
56#define I_EVALSTR "_evalstr"
57#define I_SYMBOL_TABLE "_symbol_table"
58#define I_UTIL_TABLE "_util_table"
59#define I_FUNCTION_LIST "_function_list"
60#define I_INSTALL_TABLES "_install_tables"
61
62#else
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#endif
71
72#endif /* _DYNALOAD_H_ */
73