diff options
author | Lua Team <team@lua.org> | 1994-07-08 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1994-07-08 12:00:00 +0000 |
commit | 944fc7d7d95575f2b8023c1f3d4ac19e1369fc76 (patch) | |
tree | eabf0822f2058229cd0d49c7928683b8cf0ed88e /clients/lua | |
parent | 8b5979a7e8b9732aa2883d2384f853d87b594770 (diff) | |
download | lua-github-1.1.tar.gz |
Lua 1.11.1
Diffstat (limited to 'clients/lua')
-rw-r--r-- | clients/lua/Makefile | 17 | ||||
-rw-r--r-- | clients/lua/README | 5 | ||||
-rw-r--r-- | clients/lua/lua.c | 28 |
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]); +} |