# 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);


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

##### 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.