aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-08 18:06:15 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-08 18:06:15 -0200
commit65f28f0824411bfe375a1dfa08c9cdc0eea2cb36 (patch)
tree2f00d3edcd53495e17fa60ea07ee8a12c47fb577
parent2cf954b8ae08a9094354551ee3733f4ff8078443 (diff)
downloadlua-65f28f0824411bfe375a1dfa08c9cdc0eea2cb36.tar.gz
lua-65f28f0824411bfe375a1dfa08c9cdc0eea2cb36.tar.bz2
lua-65f28f0824411bfe375a1dfa08c9cdc0eea2cb36.zip
error function for Lua
-rw-r--r--inout.c10
-rw-r--r--inout.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/inout.c b/inout.c
index 711193fa..3e6b472b 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.7 1994/11/03 22:34:29 roberto Exp roberto $"; 8char *rcs_inout="$Id: inout.c,v 2.8 1994/11/07 16:34:44 roberto Exp roberto $";
9 9
10#include <stdio.h> 10#include <stdio.h>
11#include <stdlib.h> 11#include <stdlib.h>
@@ -264,3 +264,11 @@ void lua_obj2number (void)
264 lua_pushnil(); 264 lua_pushnil();
265} 265}
266 266
267
268void luaI_error (void)
269{
270 char *s = lua_getstring(lua_getparam(1));
271 if (s == NULL) s = "(no message)";
272 lua_error(s);
273}
274
diff --git a/inout.h b/inout.h
index 0714f1a4..8155bbe4 100644
--- a/inout.h
+++ b/inout.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: inout.h,v 1.3 1994/11/02 20:29:39 roberto Exp roberto $ 2** $Id: inout.h,v 1.4 1994/11/03 22:34:29 roberto Exp roberto $
3*/ 3*/
4 4
5 5
@@ -23,5 +23,6 @@ void lua_internaldostring (void);
23void lua_print (void); 23void lua_print (void);
24void luaI_type (void); 24void luaI_type (void);
25void lua_obj2number (void); 25void lua_obj2number (void);
26void luaI_error (void);
26 27
27#endif 28#endif