lua-users home
lua-l archive

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


Cory Cater wrote:
> I am relatively new to Lua and I am looking at accessing some sort of
List
> of globally registered functions. I have started looking at the
reference
> manual and the idea of environment seems to be what I want. I guess I
am
> just looking for a bit of direction. I have begun using tolua++ to get
the
> functions from C into the Lua namespace, and I would like to access if
> possible from the C side or the Lua side a list of all the functions
> registered and if possible but unlikely the arguments they take. 
> 
> If someone can give me some advice on this it would be most
appreciated, 

I think the best way to access a list of globaly available functions is
to use the module system. There are several ways to do so, depending on
the kind of Lua you use (embedded or standalone interpreter, platform
allowing dynamic linking or not).

Look at the end of the ltablib.c file in standard Lua 5.1.1 distribution
for an example. There are also plenty of examples on the wiki and the
mailing list archive. Just ask if you don't know how to start (providing
more context would be useful).