aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-20 13:52:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-20 13:52:50 -0300
commitca6fe7449a74efde6f959605dbe77acf3e64ca0b (patch)
treea6190e813ff712f7db750d4ecd3afd3ac9c0dbab /lua.h
parent1afd5a152dc8b3a304236dc4e07bca38ea5eb53a (diff)
downloadlua-ca6fe7449a74efde6f959605dbe77acf3e64ca0b.tar.gz
lua-ca6fe7449a74efde6f959605dbe77acf3e64ca0b.tar.bz2
lua-ca6fe7449a74efde6f959605dbe77acf3e64ca0b.zip
userdata can have multiple user values
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/lua.h b/lua.h
index d6277b4e..8fb2ccbe 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.339 2017/11/07 13:25:26 roberto Exp roberto $ 2** $Id: lua.h,v 1.340 2018/02/17 19:29:29 roberto Exp roberto $
3** Lua - A Scripting Language 3** Lua - A Scripting Language
4** Lua.org, PUC-Rio, Brazil (http://www.lua.org) 4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** See Copyright Notice at the end of this file 5** See Copyright Notice at the end of this file
@@ -247,9 +247,9 @@ LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
247LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); 247LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p);
248 248
249LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); 249LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
250LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); 250LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue);
251LUA_API int (lua_getmetatable) (lua_State *L, int objindex); 251LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
252LUA_API int (lua_getuservalue) (lua_State *L, int idx); 252LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n);
253 253
254 254
255/* 255/*
@@ -263,7 +263,7 @@ LUA_API void (lua_rawset) (lua_State *L, int idx);
263LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n); 263LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n);
264LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); 264LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
265LUA_API int (lua_setmetatable) (lua_State *L, int objindex); 265LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
266LUA_API void (lua_setuservalue) (lua_State *L, int idx); 266LUA_API int (lua_setiuservalue) (lua_State *L, int idx, int n);
267 267
268 268
269/* 269/*
@@ -380,7 +380,7 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
380 380
381/* 381/*
382** {============================================================== 382** {==============================================================
383** compatibility macros for unsigned conversions 383** compatibility macros
384** =============================================================== 384** ===============================================================
385*/ 385*/
386#if defined(LUA_COMPAT_APIINTCASTS) 386#if defined(LUA_COMPAT_APIINTCASTS)
@@ -390,6 +390,11 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
390#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL) 390#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
391 391
392#endif 392#endif
393
394#define lua_newuserdata(L,s) lua_newuserdatauv(L,s,1)
395#define lua_getuservalue(L,idx) lua_getiuservalue(L,idx,1)
396#define lua_setuservalue(L,idx) lua_setiuservalue(L,idx,1)
397
393/* }============================================================== */ 398/* }============================================================== */
394 399
395/* 400/*