Skip to content

Commit e9d9a01

Browse files
committed
documentation, new methods, new capi version
1 parent 610a976 commit e9d9a01

File tree

8 files changed

+1989
-267
lines changed

8 files changed

+1989
-267
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This [Lua] module provides an array data type and the implementation of the [Car
1010
for handling arrays of primitive numeric C data types in Lua script code and also in native
1111
C code for enhancing native Lua module interoperability and performance.
1212

13+
* [Documentation](./doc/README.md#lua-carray-documentation)
14+
1315
[Lua]: https://www.lua.org
1416
[Carray C API]: https://github.com/lua-capis/lua-carray-capi
1517

@@ -18,7 +20,7 @@ C code for enhancing native Lua module interoperability and performance.
1820
## First Example
1921

2022
```lua
21-
local carray = require"carray"
23+
local carray = require("carray")
2224

2325
local a = carray.new("int", 10)
2426

@@ -52,15 +54,14 @@ assert(x == 202)
5254
assert(y == 203)
5355
assert(z == 204)
5456

55-
local c = carray.new("char", 10)
56-
c:setstring(1, "1234567890")
57+
local c = carray.new("char"):add("1234567890")
5758

5859
assert(c:get(1) == string.byte("1"))
5960
assert(c:tostring() == "1234567890")
60-
assert(c:tostring(1) == "1")
61+
assert(c:tostring(1,1) == "1")
6162
assert(c:tostring(2,4) == "234")
6263

63-
c:setstring(4, "abc")
64+
c:set(4, "ab", string.byte("c"))
6465
assert(c:tostring() == "123abc7890")
6566
```
6667

0 commit comments

Comments
 (0)