MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_pushlstring

Function lua_pushlstring

3rd/lua-5.4.3/src/lapi.c:520–529  ·  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

518** 'memcmp' and 'memcpy'.
519*/
520LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
521 TString *ts;
522 lua_lock(L);
523 ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len);
524 setsvalue2s(L, L->top, ts);
525 api_incr_top(L);
526 luaC_checkGC(L);
527 lua_unlock(L);
528 return getstr(ts);
529}
530
531
532LUA_API const char *lua_pushstring (lua_State *L, const char *s) {

Callers 15

formatFunction · 0.85
range_formatFunction · 0.85
type_formatFunction · 0.85
update_configFunction · 0.85
PushDiagnosticToLuaFunction · 0.85
diagnose_fileFunction · 0.85
set_default_configFunction · 0.85
set_nonstandard_symbolFunction · 0.85
spell_analysisFunction · 0.85

Calls 2

luaS_newFunction · 0.85
luaS_newlstrFunction · 0.85

Tested by

no test coverage detected