1 #include <exec/types.h>
2 #include <aros/libcall.h>
4 #define timeval sys_timeval
8 #include "hostlib_intern.h"
10 #include LC_LIBDEFS_FILE
13 #include <aros/debug.h>
15 AROS_LH2(void *, HostLib_Open
,
16 AROS_LHA(const char *, filename
, A0
),
17 AROS_LHA(char **, error
, A1
),
18 struct HostLibBase
*, HostLibBase
, 1, HostLib
) {
24 D(bug("[hostlib] Open: filename=%s\n", filename
));
26 handle
= dlopen((char *) filename
, RTLD_NOW
);
29 *error
= handle
!= NULL
? dlerror() : NULL
;
36 AROS_LH2(int, HostLib_Close
,
37 AROS_LHA(void *, handle
, A0
),
38 AROS_LHA(char **, error
, A1
),
39 struct HostLibBase
*, HostLibBase
, 2, HostLib
) {
45 D(bug("[hostlib] Close: handle=0x%08x\n", handle
));
47 ret
= dlclose(handle
);
50 *error
= ret
!= 0 ? dlerror() : NULL
;
57 AROS_LH3(void *, HostLib_GetPointer
,
58 AROS_LHA(void *, handle
, A0
),
59 AROS_LHA(const char *, symbol
, A1
),
60 AROS_LHA(char **, error
, A2
),
61 struct HostLibBase
*, HostLibBase
, 3, HostLib
) {
67 D(bug("[hostlib] GetPointer: handle=0x%08x, symbol=%s\n", handle
, symbol
));
71 ptr
= dlsym(handle
, (char *) symbol
);