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

Function get_filename

plugins/blueprint.cpp:1386–1405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1384}
1385
1386static bool get_filename(string &fname,
1387 color_ostream &out,
1388 blueprint_options opts, // copy because we can't const
1389 const string &phase,
1390 int32_t ordinal) {
1391 const char *s = NULL;
1392 if (!Lua::CallLuaModuleFunction(out, "plugins.blueprint", "get_filename",
1393 std::make_tuple(&opts, phase, ordinal), 1, [&](lua_State *L){
1394 s = lua_tostring(L, -1);
1395 }))
1396 return false;
1397
1398 if (!s) {
1399 out.printerr("Failed to retrieve filename from get_filename\n");
1400 return false;
1401 }
1402
1403 fname = s;
1404 return true;
1405}
1406
1407// returns true if we could interface with lua and could verify that the given
1408// phase is a meta phase

Callers 2

write_blueprintFunction · 0.85
write_meta_blueprintFunction · 0.85

Calls 1

CallLuaModuleFunctionFunction · 0.85

Tested by

no test coverage detected