1 #include <proto/exec.h>
3 #include "hostinterface.h"
4 #include "hostlib_intern.h"
6 /*****************************************************************************
9 #include <proto/hostlib.h>
11 AROS_LH3(APTR
*, HostLib_GetInterface
,
14 AROS_LHA(void *, handle
, A0
),
15 AROS_LHA(const char **, symtable
, A1
),
16 AROS_LHA(ULONG
*, unresolved
, A2
),
19 struct HostLibBase
*, HostLibBase
, 5, HostLib
)
22 Resolve array of symbols in the host operating system library.
23 The result is a pointer to a dynamically allocated array of
27 handle - An opaque library handle provided by HostLib_Open()
28 symbable - A pointer to a NULL-terminated array of symbol names
29 unresolved - An optional location where count of unresolved symbols
30 will be placed. Can be set to NULL to ignore it.
33 A pointer to a dynamically allocated array of symbol values or NULL if
34 empty symbol table was given.
37 Note that the resulting array will always have as many entries as there
38 are in symbol names array. It some symbols (or even all of them) fail
39 to resolve, correspondind entries will be set to NULL. You may supply
40 a valid unresolved pointer if you want to get unresolved symbols count.
42 Even incomplete interface needs to be freed using HostLib_DropInterface().
44 Resulting values are valid as long as the library is open. For portability
45 sake it's advised to free interfaces before closing corresponding libraries.
47 This function appeared in v2 of hostlib.resource.
58 *****************************************************************************/
66 for (c
= symtable
; *c
; c
++)
71 iface
= AllocVec(cnt
* sizeof(APTR
), MEMF_ANY
);
79 for (i
= 0; i
< cnt
; i
++)
81 iface
[i
] = HostLibBase
->HostIFace
->hostlib_GetPointer(handle
, symtable
[i
], NULL
);