minilua.c 5.4.8 → 5.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -19
- package/minilua/minilua.h +29348 -29348
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,33 +19,23 @@ And then include `minilua.h` as follows:
|
|
|
19
19
|
```c
|
|
20
20
|
// main.c
|
|
21
21
|
#define MINILUA_IMPLEMENTATION // or LUA_IMPL
|
|
22
|
-
#include
|
|
22
|
+
#include <minilua.h>
|
|
23
23
|
|
|
24
24
|
int main() { /* ... */ }
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Finally, compile while adding the path `node_modules/minilua.c` to your compiler's include paths.
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
$ clang main.c # or, use gcc
|
|
31
|
-
$ gcc main.c
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
You may also use a simpler approach:
|
|
35
|
-
|
|
36
|
-
```c
|
|
37
|
-
// main.c
|
|
38
|
-
#define MINILUA_IMPLEMENTATION // or LUA_IMPL
|
|
39
|
-
#include <minilua.h>
|
|
40
|
-
|
|
41
|
-
int main() { /* ... */ }
|
|
30
|
+
$ clang -I./node_modules/minilua.c main.c # or, use gcc
|
|
31
|
+
$ gcc -I./node_modules/minilua.c main.c
|
|
42
32
|
```
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
You may also use a simpler approach with the [cpoach](https://www.npmjs.com/package/cpoach.sh) tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
|
|
45
35
|
|
|
46
36
|
```bash
|
|
47
|
-
$ clang
|
|
48
|
-
$ gcc
|
|
37
|
+
$ cpoach clang main.c # or, use gcc
|
|
38
|
+
$ cpoach gcc main.c
|
|
49
39
|
```
|
|
50
40
|
|
|
51
41
|
<br>
|
|
@@ -54,7 +44,7 @@ $ gcc -I./node_modules/minilua.c main.c
|
|
|
54
44
|
|
|
55
45
|
```c
|
|
56
46
|
#define LUA_IMPL
|
|
57
|
-
#include
|
|
47
|
+
#include <minilua.h>
|
|
58
48
|
|
|
59
49
|
int main() {
|
|
60
50
|
lua_State *L = luaL_newstate();
|
|
@@ -76,7 +66,7 @@ Include `minilua.h` to use Lua API.
|
|
|
76
66
|
Then do the following in *one* C file to implement Lua:
|
|
77
67
|
```c
|
|
78
68
|
#define LUA_IMPL
|
|
79
|
-
#include
|
|
69
|
+
#include <minilua.h>
|
|
80
70
|
```
|
|
81
71
|
|
|
82
72
|
By default it detects the system platform to use, however you can explicitly define one.
|
|
@@ -122,6 +112,7 @@ Same license as Lua, the MIT license, see LICENSE.txt for information.
|
|
|
122
112
|
<br>
|
|
123
113
|
|
|
124
114
|
|
|
115
|
+
[](https://wolfram77.github.io)<br>
|
|
125
116
|
[](https://github.com/edubart/minilua)
|
|
126
117
|
[](https://nodef.github.io)
|
|
127
118
|

|