MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getCurrentModVarName

Function getCurrentModVarName

Engine/source/i18n/lang.cpp:447–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447UTF8 *getCurrentModVarName(UTF8 *buffer, U32 bufsize)
448{
449 char varName[256];
450 StringTableEntry cbName = CodeBlock::getCurrentCodeBlockName();
451
452 const UTF8 *slash = (const UTF8*)dStrchr(cbName, '/');
453 if (slash == NULL)
454 {
455 Con::errorf("Illegal CodeBlock path detected in sanitiseVarName() (no mod directory): %s", cbName);
456 return NULL;
457 }
458
459 dStrncpy(varName, cbName, slash - (const UTF8*)cbName);
460 varName[slash - (const UTF8*)cbName] = 0;
461
462 return sanitiseVarName((UTF8*)varName, buffer, bufsize);
463}
464
465const LangTable *getCurrentModLangTable()
466{

Callers 1

getCurrentModLangTableFunction · 0.85

Calls 4

dStrncpyFunction · 0.85
sanitiseVarNameFunction · 0.85
dStrchrFunction · 0.50
errorfFunction · 0.50

Tested by

no test coverage detected