MCPcopy Create free account
hub / github.com/TASEmulators/fceux / tostring

Function tostring

src/lua-engine.cpp:1829–1835  ·  view source on GitHub ↗

replacement for luaB_tostring() that is able to show the contents of tables (and formats numbers better, and show function prototypes) can be called directly from lua via tostring(), assuming tostring hasn't been reassigned

Source from the content-addressed store, hash-verified

1827// replacement for luaB_tostring() that is able to show the contents of tables (and formats numbers better, and show function prototypes)
1828// can be called directly from lua via tostring(), assuming tostring hasn't been reassigned
1829static int tostring(lua_State *L)
1830{
1831 char* str = rawToCString(L);
1832 str[strlen(str)-2] = 0; // hack: trim off the \r\n (which is there to simplify the print function's task)
1833 lua_pushstring(L, str);
1834 return 1;
1835}
1836
1837// tobitstring(int value)
1838//

Callers 1

luaV_concatFunction · 0.85

Calls 2

rawToCStringFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected