Here's runnable code (courtesy of cfillion, potential errors probably because of my adaption ) registering functionName(char*, double*) and auto-generated ReaScript help displaying
Code:
Lua: number retval, string str = reaper.functionName(string str, reaper.array flag)
.
Code:
static const char* definition = "double\0char*,double*\0str,flag\0help text for myfunction";
static double cImpl(char* str, double* flag)
{
return 0;
}
static void* reascriptImpl(void** argv, double* argc)
{
// argument count check is already done by reaper
return (void*)(intptr_t)cImpl((char*)argv[0], (double*)(intptr_t)argv[1]);
}
void registerAPI()
{
// called when initializing the extension
plugin_register("API_functionName", (void*)&cImpl);
plugin_register("APIvararg_functionName", (void*)&reascriptImpl);
plugin_register("APIdef_functionName", (void*)definition);
}
ReaScript help screenshot:
Does this help?
edit:
Now when calling this function in Lua and trying to pass a reaper.array this error occurs as mentioned in OP:
edit2:
Not related to this issue directly, but there's a similar problem for passing HWND:
https://forum.cockos.com/showthread.php?t=208090
Though this may be more of a FR.