diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-20 16:20:23 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-20 16:20:23 -0300 |
commit | 88d7ffb0d0c7303ef1b766b1100e4220e775ab57 (patch) | |
tree | cbe24dd1203ecb48fd6e4b947c92c14a2ab69ae6 /inout.c | |
parent | 47527d2d3ca6e235d06adf567246c2f3bd424f65 (diff) | |
download | lua-88d7ffb0d0c7303ef1b766b1100e4220e775ab57.tar.gz lua-88d7ffb0d0c7303ef1b766b1100e4220e775ab57.tar.bz2 lua-88d7ffb0d0c7303ef1b766b1100e4220e775ab57.zip |
luaI_type moved to fallback.c
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 30 |
1 files changed, 1 insertions, 29 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.46 1997/03/17 17:01:10 roberto Exp roberto $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.47 1997/03/19 19:41:10 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <string.h> | 11 | #include <string.h> |
@@ -161,34 +161,6 @@ static void luaI_print (void) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | /* | 163 | /* |
164 | ** Internal function: return an object type. | ||
165 | */ | ||
166 | static void luaI_type (void) | ||
167 | { | ||
168 | lua_Object o = lua_getparam(1); | ||
169 | int t = lua_tag(o); | ||
170 | char *s; | ||
171 | if (t == LUA_T_NUMBER) | ||
172 | s = "number"; | ||
173 | else if (lua_isstring(o)) | ||
174 | s = "string"; | ||
175 | else if (lua_istable(o)) | ||
176 | s = "table"; | ||
177 | else if (lua_isnil(o)) | ||
178 | s = "nil"; | ||
179 | else if (lua_isfunction(o)) | ||
180 | s = "function"; | ||
181 | else if (lua_isuserdata(o)) | ||
182 | s = "userdata"; | ||
183 | else { | ||
184 | lua_error("no parameter to function 'type'"); | ||
185 | return; /* to avoid warnings */ | ||
186 | } | ||
187 | lua_pushliteral(s); | ||
188 | lua_pushnumber(t); | ||
189 | } | ||
190 | |||
191 | /* | ||
192 | ** Internal function: convert an object to a number | 164 | ** Internal function: convert an object to a number |
193 | */ | 165 | */ |
194 | static void lua_obj2number (void) | 166 | static void lua_obj2number (void) |