minilua.c 5.4.7 → 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 CHANGED
@@ -4,23 +4,47 @@ This is Lua contained in a single header to be bundled in C/C++ applications wit
4
4
  [Lua](https://www.lua.org/) is a powerful, efficient, lightweight, embeddable scripting language.
5
5
  This library was created by [Eduardo Bart](https://github.com/edubart).
6
6
 
7
+ <br>
8
+
7
9
  ## Installation
8
10
 
9
11
  Run:
10
- ```bash
12
+
13
+ ```sh
11
14
  $ npm i minilua.c
12
15
  ```
13
16
 
14
17
  And then include `minilua.h` as follows:
18
+
15
19
  ```c
16
- #include "node_modules/minilua.c/minilua.h"
20
+ // main.c
21
+ #define MINILUA_IMPLEMENTATION // or LUA_IMPL
22
+ #include <minilua.h>
23
+
24
+ int main() { /* ... */ }
25
+ ```
26
+
27
+ Finally, compile while adding the path `node_modules/minilua.c` to your compiler's include paths.
28
+
29
+ ```bash
30
+ $ clang -I./node_modules/minilua.c main.c # or, use gcc
31
+ $ gcc -I./node_modules/minilua.c main.c
32
+ ```
33
+
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.
35
+
36
+ ```bash
37
+ $ cpoach clang main.c # or, use gcc
38
+ $ cpoach gcc main.c
17
39
  ```
18
40
 
41
+ <br>
42
+
19
43
  ## Example Usage
20
44
 
21
45
  ```c
22
46
  #define LUA_IMPL
23
- #include "minilua.h"
47
+ #include <minilua.h>
24
48
 
25
49
  int main() {
26
50
  lua_State *L = luaL_newstate();
@@ -34,13 +58,15 @@ int main() {
34
58
  }
35
59
  ```
36
60
 
61
+ <br>
62
+
37
63
  ## Usage
38
64
 
39
65
  Include `minilua.h` to use Lua API.
40
66
  Then do the following in *one* C file to implement Lua:
41
67
  ```c
42
68
  #define LUA_IMPL
43
- #include "minilua.h"
69
+ #include <minilua.h>
44
70
  ```
45
71
 
46
72
  By default it detects the system platform to use, however you can explicitly define one.
@@ -52,10 +78,14 @@ therefore it is best to declare the Lua implementation in dedicated C file.
52
78
  Optionally provide the following defines:
53
79
  - `LUA_MAKE_LUA` - implement the Lua command line REPL
54
80
 
81
+ <br>
82
+
55
83
  ## Documentation
56
84
 
57
85
  For documentation on how to use Lua read its [official manual](https://www.lua.org/manual/).
58
86
 
87
+ <br>
88
+
59
89
  ## Updates
60
90
 
61
91
  - **25-Jul-2024**: Updated to Lua 5.4.7.
@@ -65,11 +95,15 @@ For documentation on how to use Lua read its [official manual](https://www.lua.o
65
95
  - **03-Dec-2020**: Updated to Lua 5.4.2.
66
96
  - **27-Nov-2020**: Library created, using Lua 5.4.2-rc1.
67
97
 
98
+ <br>
99
+
68
100
  ## Notes
69
101
 
70
102
  This library tries to keep up with latest official Lua release.
71
103
  The header is generated using the bash script `gen.sh` all modifications done is there.
72
104
 
105
+ <br>
106
+
73
107
  ## License
74
108
 
75
109
  Same license as Lua, the MIT license, see LICENSE.txt for information.
@@ -78,5 +112,7 @@ Same license as Lua, the MIT license, see LICENSE.txt for information.
78
112
  <br>
79
113
 
80
114
 
115
+ [![](https://raw.githubusercontent.com/qb40/designs/gh-pages/0/image/11.png)](https://wolfram77.github.io)<br>
116
+ [![SRC](https://img.shields.io/badge/src-repo-green?logo=Org)](https://github.com/edubart/minilua)
81
117
  [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
82
118
  ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/minilua.c)