diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-23 13:35:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-23 13:35:45 -0300 |
commit | 572a69b6afbd368beab8844bc876b0f9690b5253 (patch) | |
tree | f2785c52e1ee9bab5b68823b9481af2510a90829 /lapi.c | |
parent | beee01b170c5fea9ed4527b28b9221d2df1baaba (diff) | |
download | lua-572a69b6afbd368beab8844bc876b0f9690b5253.tar.gz lua-572a69b6afbd368beab8844bc876b0f9690b5253.tar.bz2 lua-572a69b6afbd368beab8844bc876b0f9690b5253.zip |
name changes
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.139 2001/04/11 18:39:37 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.140 2001/04/17 17:35:54 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -151,16 +151,16 @@ LUA_API int lua_type (lua_State *L, int index) { | |||
151 | } | 151 | } |
152 | 152 | ||
153 | 153 | ||
154 | LUA_API const l_char *lua_typename (lua_State *L, int t) { | 154 | LUA_API const l_char *lua_tag2name (lua_State *L, int tag) { |
155 | const l_char *s; | 155 | const l_char *s; |
156 | lua_lock(L); | 156 | lua_lock(L); |
157 | s = (t == LUA_TNONE) ? l_s("no value") : basictypename(G(L), t); | 157 | s = (tag == LUA_TNONE) ? l_s("no value") : basictypename(G(L), tag); |
158 | lua_unlock(L); | 158 | lua_unlock(L); |
159 | return s; | 159 | return s; |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | LUA_API const l_char *lua_xtype (lua_State *L, int index) { | 163 | LUA_API const l_char *lua_xtypename (lua_State *L, int index) { |
164 | StkId o; | 164 | StkId o; |
165 | const l_char *type; | 165 | const l_char *type; |
166 | lua_lock(L); | 166 | lua_lock(L); |
@@ -621,7 +621,7 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold) { | |||
621 | ** miscellaneous functions | 621 | ** miscellaneous functions |
622 | */ | 622 | */ |
623 | 623 | ||
624 | LUA_API int lua_newtype (lua_State *L, const l_char *name, int basictype) { | 624 | LUA_API int lua_newxtype (lua_State *L, const l_char *name, int basictype) { |
625 | int tag; | 625 | int tag; |
626 | lua_lock(L); | 626 | lua_lock(L); |
627 | if (basictype != LUA_TNONE && | 627 | if (basictype != LUA_TNONE && |
@@ -636,7 +636,7 @@ LUA_API int lua_newtype (lua_State *L, const l_char *name, int basictype) { | |||
636 | } | 636 | } |
637 | 637 | ||
638 | 638 | ||
639 | LUA_API int lua_type2tag (lua_State *L, const l_char *name) { | 639 | LUA_API int lua_name2tag (lua_State *L, const l_char *name) { |
640 | int tag; | 640 | int tag; |
641 | const TObject *v; | 641 | const TObject *v; |
642 | lua_lock(L); | 642 | lua_lock(L); |
@@ -798,3 +798,18 @@ LUA_API void lua_setweakmode (lua_State *L, int mode) { | |||
798 | lua_unlock(L); | 798 | lua_unlock(L); |
799 | } | 799 | } |
800 | 800 | ||
801 | |||
802 | |||
803 | /* | ||
804 | ** deprecated function | ||
805 | */ | ||
806 | LUA_API void lua_pushusertag (lua_State *L, void *u, int tag) { | ||
807 | /* ???????? */ | ||
808 | if (lua_pushuserdata(L, u) || 1) /* new udata? */ | ||
809 | lua_settag(L, tag); /* OK, no conflit */ | ||
810 | else { | ||
811 | if (lua_tag(L, -1) != tag) { | ||
812 | lua_error(L, "conflicting tags for the same userdata"); | ||
813 | } | ||
814 | } | ||
815 | } | ||