aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lapi.c b/lapi.c
index 34b335fd..2aaa6505 100644
--- a/lapi.c
+++ b/lapi.c
@@ -535,6 +535,20 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
535} 535}
536 536
537 537
538LUA_API const char *lua_pushextlstring (lua_State *L,
539 const char *s, size_t len, lua_Alloc falloc, void *ud) {
540 TString *ts;
541 lua_lock(L);
542 api_check(L, s[len] == '\0', "string not ending with zero");
543 ts = luaS_newextlstr (L, s, len, falloc, ud);
544 setsvalue2s(L, L->top.p, ts);
545 api_incr_top(L);
546 luaC_checkGC(L);
547 lua_unlock(L);
548 return getstr(ts);
549}
550
551
538LUA_API const char *lua_pushstring (lua_State *L, const char *s) { 552LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
539 lua_lock(L); 553 lua_lock(L);
540 if (s == NULL) 554 if (s == NULL)