lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Oct 28, 2013 at 9:09 AM, Journeyer J. Joh <oosaprogrammer@gmail.com> wrote:
I need to verify one thing.
The api "attach()" is defined in lua.c like below.

int my_attach(lua_State *L)
{
 ...........
}
static int pmain (lua_State *L) {
    ...................
    lua_pushcfunction(L, my_attach);
    lua_setglobal(L, "attach");
    ....................
}

#1. I'd like to know the difference between those two below.

wsapi --op

  and 

orbit ics.lua

#2. How can I make my code access extended lua api, attach() with below?

wsapi --op



Check the !# line in the two scripts, they should be pointing to different Lua binaries, only one of which has been compiled with your extra "attach" function.

BTW, why are you adding a funcion to lua.c instead of packaging it in a C module and require'ing?
 
And there is another difference between those two.

href = "" media = 'screen'

This code shows different behaviors depending on how the orbit web service is invoked.
So,

#3. Why this code behaves differently depending on how orbit is invoked?


The snippet above does not compile, so I will assume that you are talking about the return value of web:static_link. The static_link method tries to prefix the link with the application path, depending on how you launched the application and where it is this prefix will be different. You can always override the launcher's guess by setting the "prefix" field of the web object.

--
Fabio Mascarenhas