summaryrefslogtreecommitdiff
path: root/clients/lua
diff options
context:
space:
mode:
Diffstat (limited to 'clients/lua')
-rw-r--r--clients/lua/Makefile17
-rw-r--r--clients/lua/README5
-rw-r--r--clients/lua/lua.c28
3 files changed, 50 insertions, 0 deletions
diff --git a/clients/lua/Makefile b/clients/lua/Makefile
new file mode 100644
index 00000000..7bb74208
--- /dev/null
+++ b/clients/lua/Makefile
@@ -0,0 +1,17 @@
+# makefile for lua interpreter
+
+BIN= $(LUA)/bin
+INC= $(LUA)/include
+LIB= $(LUA)/lib
+
+CC= gcc
+CFLAGS= -g -Wall -O2 -I$(INC)
+
+OBJS= lua.o
+T=$(BIN)/lua
+
+$T: $(OBJS)
+ $(CC) -o $@ $(OBJS) -L$(LIB) -llua -llualib -lm
+
+clean:
+ rm -f $T $(OBJS)
diff --git a/clients/lua/README b/clients/lua/README
new file mode 100644
index 00000000..c529892a
--- /dev/null
+++ b/clients/lua/README
@@ -0,0 +1,5 @@
+This client is a simple lua interpreter.
+It either loads and executes the files named on the command line or reads
+and executes lines from stdin.
+Note that, in the second case, each line must contain a complete statement.
+For instance, functions cannot span several lines.
diff --git a/clients/lua/lua.c b/clients/lua/lua.c
new file mode 100644
index 00000000..c4b83cee
--- /dev/null
+++ b/clients/lua/lua.c
@@ -0,0 +1,28 @@
+/*
+** lua.c
+** Linguagem para Usuarios de Aplicacao
+*/
+
+char *rcs_lua="$Id: lua.c,v 1.1 1993/12/17 18:41:19 celes Exp $";
+
+#include <stdio.h>
+
+#include "lua.h"
+#include "lualib.h"
+
+void main (int argc, char *argv[])
+{
+ int i;
+ iolib_open ();
+ strlib_open ();
+ mathlib_open ();
+ if (argc < 2)
+ {
+ char buffer[2048];
+ while (gets(buffer) != 0)
+ lua_dostring(buffer);
+ }
+ else
+ for (i=1; i<argc; i++)
+ lua_dofile (argv[i]);
+}