1
0
mirror of https://github.com/lua/lua.git synced 2025-02-04 06:13:04 +08:00
lua/lua.c

34 lines
497 B
C
Raw Normal View History

1993-07-28 10:18:00 -03:00
/*
** lua.c
** Linguagem para Usuarios de Aplicacao
*/
1994-11-28 15:12:49 -02:00
char *rcs_lua="$Id: lua.c,v 1.1 1993/12/17 18:41:19 celes Stab roberto $";
1993-12-17 16:41:19 -02:00
1993-07-28 10:18:00 -03:00
#include <stdio.h>
#include "lua.h"
#include "lualib.h"
1994-11-28 15:12:49 -02:00
int main (int argc, char *argv[])
1993-07-28 10:18:00 -03:00
{
int i;
1994-11-28 15:12:49 -02:00
int result = 0;
1993-07-28 10:18:00 -03:00
iolib_open ();
strlib_open ();
mathlib_open ();
1993-12-17 16:41:19 -02:00
if (argc < 2)
1993-07-28 10:18:00 -03:00
{
1993-12-17 16:41:19 -02:00
char buffer[250];
while (gets(buffer) != 0)
1994-11-28 15:12:49 -02:00
result = lua_dostring(buffer);
1993-07-28 10:18:00 -03:00
}
1993-12-17 16:41:19 -02:00
else
for (i=1; i<argc; i++)
1994-11-28 15:12:49 -02:00
result = lua_dofile (argv[i]);
return result;
1993-07-28 10:18:00 -03:00
}