Skip to content

Commit 90cf3e1

Browse files
committed
Implement base for metacall calls by handle.
1 parent 63300b6 commit 90cf3e1

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

source/metacall/include/metacall/metacall.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,25 @@ METACALL_API int metacall_load_from_configuration(const char * path, void ** han
270270
*/
271271
METACALL_API void * metacallv(const char * name, void * args[]);
272272

273+
/**
274+
* @brief
275+
* Call a function anonymously by handle @handle value array @args
276+
* This function allows to avoid name collisions when calling functions by name
277+
*
278+
* @param[in] handle
279+
* Handle where the function belongs
280+
*
281+
* @param[in] name
282+
* Name of the function
283+
*
284+
* @param[in] args
285+
* Array of pointers to data
286+
*
287+
* @return
288+
* Pointer to value containing the result of the call
289+
*/
290+
METACALL_API void * metacallhv(void * handle, const char * name, void * args[]);
291+
273292
/**
274293
* @brief
275294
* Call a function anonymously by variable arguments @va_args

source/metacall/source/metacall.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ void * metacallv(const char * name, void * args[])
264264
return metacallfv(loader_get(name), args);
265265
}
266266

267+
void * metacallhv(void * handle, const char * name, void * args[])
268+
{
269+
(void)handle;
270+
(void)name;
271+
(void)args;
272+
273+
/* TODO */
274+
275+
return NULL;
276+
}
277+
267278
void * metacall(const char * name, ...)
268279
{
269280
function f = loader_get(name);

0 commit comments

Comments
 (0)