aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-08-26 21:26:33 +1000
committerdaurnimator <quae@daurnimator.com>2017-08-26 21:40:54 +1000
commit3931e7fc37c5c3cc30f8e35e5bdb06a59af1e884 (patch)
tree28b7a475354a3ce08364f801d3c3b73d7132b98d
parentace784b225237d1b59576847cd96e3cab9c70dbb (diff)
downloadlua-compat-5.3-3931e7fc37c5c3cc30f8e35e5bdb06a59af1e884.tar.gz
lua-compat-5.3-3931e7fc37c5c3cc30f8e35e5bdb06a59af1e884.tar.bz2
lua-compat-5.3-3931e7fc37c5c3cc30f8e35e5bdb06a59af1e884.zip
Add lua_pushlstring (return value)
-rw-r--r--README.md2
-rw-r--r--c-api/compat-5.3.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6bab5f3..08614a1 100644
--- a/README.md
+++ b/README.md
@@ -147,7 +147,7 @@ For Lua 5.1 additionally:
147* `lua_arith` (see [here][19]) 147* `lua_arith` (see [here][19])
148* `lua_compare` 148* `lua_compare`
149* `lua_len`, `lua_rawlen`, and `luaL_len` 149* `lua_len`, `lua_rawlen`, and `luaL_len`
150* `lua_pushstring` (return value) 150* `lua_pushstring`, `lua_pushlstring` (return value)
151* `lua_copy` 151* `lua_copy`
152* `lua_pushglobaltable` 152* `lua_pushglobaltable`
153* `luaL_testudata` 153* `luaL_testudata`
diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h
index 67e1da6..5c3052b 100644
--- a/c-api/compat-5.3.h
+++ b/c-api/compat-5.3.h
@@ -122,6 +122,9 @@ COMPAT53_API void lua_len (lua_State *L, int i);
122#define lua_pushstring(L, s) \ 122#define lua_pushstring(L, s) \
123 (lua_pushstring(L, (s)), lua_tostring(L, -1)) 123 (lua_pushstring(L, (s)), lua_tostring(L, -1))
124 124
125#define lua_pushlstring(L, s, len) \
126 (lua_pushlstring(L, (s), (len)), lua_tostring(L, -1))
127
125#ifndef luaL_newlibtable 128#ifndef luaL_newlibtable
126# define luaL_newlibtable(L, l) \ 129# define luaL_newlibtable(L, l) \
127 (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1)) 130 (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1))