* @brief Lua C closure that returns the array of registered API command names. */
| 694 | * @brief Lua C closure that returns the array of registered API command names. |
| 695 | */ |
| 696 | static int luaApiCallList(lua_State* L) |
| 697 | { |
| 698 | const auto& commands = API::CommandRegistry::instance().commands(); |
| 699 | lua_createtable(L, commands.size(), 0); |
| 700 | |
| 701 | int i = 1; |
| 702 | for (auto it = commands.constBegin(); it != commands.constEnd(); ++it) { |
| 703 | const QByteArray name = it.key().toUtf8(); |
| 704 | lua_pushlstring(L, name.constData(), static_cast<size_t>(name.size())); |
| 705 | lua_rawseti(L, -2, i++); |
| 706 | } |
| 707 | return 1; |
| 708 | } |
| 709 | |
| 710 | //-------------------------------------------------------------------------------------------------- |
| 711 | // Public installation entry points |
nothing calls this directly
no test coverage detected