You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -80,9 +80,11 @@ In general, just replace the "k" with the word "cont". This is just to make the
80
80
81
81
Because `error` is a reserved word in Zig, these functions have been renamed to `raiseError` and `raiseErrorAux` respectively.
82
82
83
-
### `lua_tostring` and `lua_tolstring`
83
+
### `string` vs `lstring`
84
84
85
-
These functions have been combined into `Lua.toString()`. The function `lua_tostring` is a macro around `lua_tolstring` and does not return the length of the string.
85
+
The "string" variant functions vs the "lstring" functions only differ by returning the length of the string. In ziglua, the lstring functions are all named "bytes" instead. For example, `lua_tolstring` is `Lua.toBytes`. This is because these functions are typically used in cases when the string _might_ contain zeros before the null-terminating zero.
86
+
87
+
The "string" variant functions are safe to use when the string is known to be null terminated without inner zeros.
Copy file name to clipboardExpand all lines: readme.md
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,10 @@ In a nutshell, ziglua is a simple wrapper around the C API you would get by usin
17
17
* Compiler-enforced checking of optional pointers
18
18
* Functions return `bool` rather than `int` to indicate success
19
19
20
-
While there are some helper functions added to complement the C API, ziglua aims to remain low-level. If you want something higher-level, perhaps try [zoltan](https://github.com/ranciere/zoltan).
20
+
While there are some helper functions added to complement the C API, ziglua aims to remain low-level.
21
+
This allows full access to Lua with the added benefits of Zig's improvements over C.
22
+
23
+
If you want something higher-level, perhaps try [zoltan](https://github.com/ranciere/zoltan).
21
24
22
25
## Getting Started
23
26
@@ -58,13 +61,9 @@ See [docs.md](https://github.com/natecraddock/ziglua/blob/master/docs.md) for do
58
61
59
62
## Status
60
63
61
-
All functions, types, and constants in the public Lua API have been wrapped in Zig **(268/268 identifiers)**.
62
-
63
-
All of the functions have been referenced in tests, so the parameters are correctly typed.
64
-
65
-
But I am still going through each function to decide the correct return types, errors, parameters, naming, etc.
64
+
Nearly all functions, types, and constants in the C API have been wrapped in ziglua. Only a few exceptions have been made when the function doesn't make sense in Zig (like functions using `va_list`).
66
65
67
-
ziglua should be relatively stable and safe to use now, but is still rapidly changing.
66
+
All functions have been type checked, but only the standard C API has been tested fully. ziglua should be relatively stable and safe to use now, but is still new and changing frequently.
0 commit comments