MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / lua_pushstring

Function lua_pushstring

src/lapi.cpp:617–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615
616
617LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
618 lua_lock(L);
619 if (s == NULL)
620 setnilvalue(s2v(L->top.p));
621 else {
622 TString *ts;
623 ts = luaS_new(L, s);
624 setsvalue2s(L, L->top.p, ts);
625 s = getstr(ts); /* internal copy's address */
626 }
627 api_incr_top(L);
628 luaC_checkGC(L);
629 lua_unlock(L);
630 return s;
631}
632
633PLUTO_API const char* pluto_pushstring(lua_State* L, const std::string& str) {
634 return lua_pushlstring(L, str.c_str(), str.length());

Callers 15

luaB_costatusFunction · 0.85
os_tmpnameFunction · 0.85
os_getenvFunction · 0.85
os_setlocaleFunction · 0.85
luaopen_osFunction · 0.85
checkfieldFunction · 0.85
lsys_loadFunction · 0.85
lsys_symFunction · 0.85
pusherrorFunction · 0.85
setpathFunction · 0.85
ll_loadlibFunction · 0.85
searchpathFunction · 0.85

Calls 1

luaS_newFunction · 0.85

Tested by

no test coverage detected