MCPcopy Create free account
hub / github.com/DFHack/dfhack / help_helper

Method help_helper

library/Core.cpp:627–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void 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
651void tags_helper(color_ostream &con, const std::string &tag) {
652 ConditionalCoreSuspender suspend{};

Callers

nothing calls this directly

Calls 4

lua_checkstackFunction · 0.85
PushModulePublicFunction · 0.85
PushFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected