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