| 484 | |
| 485 | |
| 486 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 487 | lua_lock(L); |
| 488 | if (s == NULL) |
| 489 | setnilvalue(L->top); |
| 490 | else { |
| 491 | TString *ts; |
| 492 | luaC_checkGC(L); |
| 493 | ts = luaS_new(L, s); |
| 494 | setsvalue2s(L, L->top, ts); |
| 495 | s = getstr(ts); /* internal copy's address */ |
| 496 | } |
| 497 | api_incr_top(L); |
| 498 | lua_unlock(L); |
| 499 | return s; |
| 500 | } |
| 501 | |
| 502 | |
| 503 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, |
no test coverage detected