File tree 6 files changed +8
-118
lines changed
6 files changed +8
-118
lines changed Original file line number Diff line number Diff line change
1
+ test :
2
+ gcc -g -I$(CURDIR ) /install/include -I$(CURDIR ) /install/lib -ldl -lm -o test/test.out test/test.c $(CURDIR ) /install/lib/liblua.a
3
+ (cd test ; ./test.out; cd ..)
4
+
5
+ .PHONY : test
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
-- script.lua
2
2
-- Receives a table, returns the sum of its components.
3
+
3
4
io.write (" The table the script received has:\n " );
4
5
x = 0
5
6
for i = 1 , # foo do
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ main(void)
51
51
52
52
luaL_openlibs (L ); /* Load Lua libraries */
53
53
54
- /* Load the file containing the script we are going to run */
55
54
status = luaL_loadfile (L , "script.lua" );
56
55
if (status ) {
57
56
/* If something went wrong, error message is at the top of */
@@ -104,6 +103,8 @@ main(void)
104
103
printf ("Script returned: %.0f\n" , sum );
105
104
106
105
lua_pop (L , 1 ); /* Take the returned value out of the stack */
106
+
107
+
107
108
lua_close (L ); /* Cya, Lua */
108
109
109
110
return 0 ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments