| 550 | } |
| 551 | |
| 552 | LUA_API const char *lua_pushstring(lua_State *L, const char *s) |
| 553 | { |
| 554 | if (s == NULL) |
| 555 | { |
| 556 | lua_pushnil(L); |
| 557 | return NULL; |
| 558 | } |
| 559 | else |
| 560 | { |
| 561 | TString *ts; |
| 562 | lua_lock(L); |
| 563 | luaC_checkGC(L); |
| 564 | ts = luaS_new(L, s); |
| 565 | setsvalue2s(L, L->top, ts); |
| 566 | api_incr_top(L); |
| 567 | lua_unlock(L); |
| 568 | return getstr(ts); |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | LUA_API const char *lua_pushvfstring(lua_State *L, const char *fmt, |
| 573 | va_list argp) |
no test coverage detected