commit 65f28f0824411bfe375a1dfa08c9cdc0eea2cb36
parent 2cf954b8ae08a9094354551ee3733f4ff8078443
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 8 Nov 1994 18:05:56 -0200
error function for Lua
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/inout.c b/inout.c
@@ -5,7 +5,7 @@
** Also provides some predefined lua functions.
*/
-char *rcs_inout="$Id: inout.c,v 2.7 1994/11/03 22:34:29 roberto Exp roberto $";
+char *rcs_inout="$Id: inout.c,v 2.8 1994/11/07 16:34:44 roberto Exp roberto $";
#include <stdio.h>
#include <stdlib.h>
@@ -264,3 +264,11 @@ void lua_obj2number (void)
lua_pushnil();
}
+
+void luaI_error (void)
+{
+ char *s = lua_getstring(lua_getparam(1));
+ if (s == NULL) s = "(no message)";
+ lua_error(s);
+}
+
diff --git a/inout.h b/inout.h
@@ -1,5 +1,5 @@
/*
-** $Id: inout.h,v 1.3 1994/11/02 20:29:39 roberto Exp roberto $
+** $Id: inout.h,v 1.4 1994/11/03 22:34:29 roberto Exp roberto $
*/
@@ -23,5 +23,6 @@ void lua_internaldostring (void);
void lua_print (void);
void luaI_type (void);
void lua_obj2number (void);
+void luaI_error (void);
#endif