[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_pcall error handler
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 9 Jan 2003 07:25:07 -0200
>Thanks! I've followed the example in lua.c, and it seems to work. I have just
>two questions. Firstly, what is lua_pushliteral? I've done this using
>lua_getglobal. Any reason not to?
lua.c takes special care with errors and so at that point uses lua_rawget
instead of lua_gettable, which is what lua_getglobal does. lua_pushliteral is
a simple macro that avoids the call to strlen in lua_pushstring when you use
literal strings. You can use lua_getglobal.
>And secondly, to do this I've had to use the
>dblib, but I'm not sure I want to give my users access to it. Is there any way
>to prevent them from using it? Would something like just setting the global
>'debug' to nil work?
Yes, you can set 'debug' to nil after loading dblib. But perhaps you can just
copy errorfb from ldblib.c into your code and not load dblib at all.
--lhf