| 625 | } |
| 626 | |
| 627 | void DFHack::help_helper(color_ostream &con, const std::string &entry_name) { |
| 628 | ConditionalCoreSuspender suspend{}; |
| 629 | |
| 630 | if (!suspend) { |
| 631 | con.printerr("Failed Lua call to helpdb.help (could not acquire core lock).\n"); |
| 632 | return; |
| 633 | } |
| 634 | |
| 635 | auto L = DFHack::Core::getInstance().getLuaState(); |
| 636 | Lua::StackUnwinder top(L); |
| 637 | |
| 638 | if (!lua_checkstack(L, 2) || |
| 639 | !Lua::PushModulePublic(con, L, "helpdb", "help")) { |
| 640 | con.printerr("Failed to load helpdb Lua code\n"); |
| 641 | return; |
| 642 | } |
| 643 | |
| 644 | Lua::Push(L, entry_name); |
| 645 | |
| 646 | if (!Lua::SafeCall(con, L, 1, 0)) { |
| 647 | con.printerr("Failed Lua call to helpdb.help.\n"); |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | void tags_helper(color_ostream &con, const std::string &tag) { |
| 652 | ConditionalCoreSuspender suspend{}; |
nothing calls this directly
no test coverage detected