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

Function lua_pushlstring

src/lapi.cpp:590–599  ·  view source on GitHub ↗

** Pushes on the stack a string with given length. Avoid using 's' when ** 'len' == 0 (as 's' can be NULL in that case), due to later use of ** 'memcmp' and 'memcpy'. */

Source from the content-addressed store, hash-verified

588** 'memcmp' and 'memcpy'.
589*/
590LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
591 TString *ts;
592 lua_lock(L);
593 ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len);
594 setsvalue2s(L, L->top.p, ts);
595 api_incr_top(L);
596 luaC_checkGC(L);
597 lua_unlock(L);
598 return getstr(ts);
599}
600
601
602LUA_API const char *lua_pushexternalstring (lua_State *L,

Callers 15

luaopen_utf8Function · 0.85
loadfuncFunction · 0.85
searcher_CrootFunction · 0.85
finalizeMethod · 0.85
str_subFunction · 0.85
str_spanFunction · 0.85
push_onecaptureFunction · 0.85
str_unpackFunction · 0.85
str_splitFunction · 0.85
contentsFunction · 0.85
luaL_pushresultFunction · 0.85
db_getinfoFunction · 0.85

Calls 2

luaS_newFunction · 0.85
luaS_newlstrFunction · 0.85

Tested by

no test coverage detected