NYI: cannot call this C function (yet)

  • From: madigest i <madigest@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 11 Dec 2013 04:23:48 +0200

Hello.

I’m runing Luajit 2.1 alpha in a little bit strange way:

Host program has C plugin that creates Lua state that runs my Lua code. Lua 
code calls host program C-API-library that can execute host calls.

Almost everything works well. Only trouble is when I call this kind of simple 
functions that only access structs.

long PA_GetLongintVariable( PA_Variable variable )
{
  long value = 0;
  if ( variable.fType == eVK_Longint )
    value = variable.uValue.fLongint;
  return value;
}
local ret = C.PA_GetLongintVariable(var)
 -> I get ”NYI: cannot call this C function (yet)"-error from Luajit.

If I create Lua function that reads value from PA_Variable-struct, then 
everything works:

function getLong(variable)
  local value = 0
  if variable.fType == C.eVK_Longint then
    value = variable.uValue.fLongint
  end
  return value
end

It is ok to use Lua functions (and probably faster), but I have to convert many 
functions from C to Lua.
Is there some way to get around this NYI error?


Regards,

Pasi Mankinen
Finland

Other related posts: