return nh_lua_variable lua table as a string */
| 1294 | |
| 1295 | /* return nh_lua_variable lua table as a string */ |
| 1296 | char * |
| 1297 | get_nh_lua_variables(void) |
| 1298 | { |
| 1299 | char *key = NULL; |
| 1300 | |
| 1301 | if (!gl.luacore) { |
| 1302 | panic("nh luacore not inited"); |
| 1303 | /*NOTREACHED*/ |
| 1304 | return key; |
| 1305 | } |
| 1306 | lua_getglobal(gl.luacore, "get_variables_string"); |
| 1307 | if (lua_type(gl.luacore, -1) == LUA_TFUNCTION) { |
| 1308 | if (nhl_pcall_handle(gl.luacore, 0, 1, "get_nh_lua_variables", |
| 1309 | NHLpa_impossible)) { |
| 1310 | return key; |
| 1311 | } |
| 1312 | key = dupstr(lua_tostring(gl.luacore, -1)); |
| 1313 | } |
| 1314 | lua_pop(gl.luacore, 1); |
| 1315 | return key; |
| 1316 | } |
| 1317 | |
| 1318 | RESTORE_WARNING_UNREACHABLE_CODE |
| 1319 |
no test coverage detected