Sign in to follow this  
yeisnier

get name of all functions

Recommended Posts

yeisnier    122
This is my C++ code for using LUA.
lua_State *L = lua_open();
luaL_openlibs(L);

luaL_loadfile(L, "..\\printf.lua");

I need to get the name of all functions defined in printf.lua file? thanks ;)

Share this post


Link to post
Share on other sites
Endurion    5408
The basic idea is to get the global table and enumerate everthing in it. If the type is a function, well, it's a function.

The lua manual has a little section on how to enumerate through a lua table in c code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this