diff options
| -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) |
