{"id":20704326,"url":"https://github.com/osch/lua-carray","last_synced_at":"2025-09-10T06:30:48.023Z","repository":{"id":65687946,"uuid":"494217993","full_name":"osch/lua-carray","owner":"osch","description":"Lua arrays for primitive numeric C data types","archived":false,"fork":false,"pushed_at":"2023-11-12T16:57:05.000Z","size":56,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T01:35:43.556Z","etag":null,"topics":["lua","lua-capi","lua-library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-19T20:21:28.000Z","updated_at":"2024-05-27T14:54:53.000Z","dependencies_parsed_at":"2024-11-17T01:12:00.481Z","dependency_job_id":"6e728069-88e2-4553-b917-ada012886665","html_url":"https://github.com/osch/lua-carray","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/osch/lua-carray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-carray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-carray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-carray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-carray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osch","download_url":"https://codeload.github.com/osch/lua-carray/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osch%2Flua-carray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274422120,"owners_count":25282123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","lua-capi","lua-library"],"created_at":"2024-11-17T01:11:57.387Z","updated_at":"2025-09-10T06:30:47.792Z","avatar_url":"https://github.com/osch.png","language":"C","readme":"# lua-carray \n[![Licence](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE)\n[![build status](https://github.com/osch/lua-carray/workflows/test/badge.svg)](https://github.com/osch/lua-carray/actions/workflows/test.yml)\n[![Build status](https://ci.appveyor.com/api/projects/status/v8t6rsf45dwt60pl/branch/master?svg=true)](https://ci.appveyor.com/project/osch/lua-carray/branch/master)\n[![Install](https://img.shields.io/badge/Install-LuaRocks-brightgreen.svg)](https://luarocks.org/modules/osch/carray)\n\n\u003c!-- ---------------------------------------------------------------------------------------- --\u003e\n\nThis [Lua] module provides an array data type and the implementation of the [Carray C API] \nfor handling arrays of primitive numeric C data types in Lua script code and also in native \nC code for enhancing native Lua module interoperability and performance. \n\n   * [Documentation](./doc/README.md#lua-carray-documentation)\n\n[Lua]:          https://www.lua.org\n[Carray C API]: https://github.com/lua-capis/lua-carray-capi\n\n\u003c!-- ---------------------------------------------------------------------------------------- --\u003e\n\n## First Example\n\n ```lua\nlocal carray = require(\"carray\")\n\nlocal a = carray.new(\"int\", 10)\n\nfor i = 1, a:len() do\n    assert(a:get(i) == 0)\nend\n\nfor i = 1, a:len() do\n    a:set(i, 100 + i)\nend\n\nfor i = 1, a:len() do\n    assert(a:get(i) == 100 + i)\nend\n\nlocal x, y, z = a:get(2, 4)\nassert(x == 102)\nassert(y == 103)\nassert(z == 104)\n\n\nlocal x, y, z = a:get(-3, -1)\nassert(x == 108)\nassert(y == 109)\nassert(z == 110)\n\na:set(2, 202, 203, 204)\n\nlocal x, y, z = a:get(2, 4)\nassert(x == 202)\nassert(y == 203)\nassert(z == 204)\n\nlocal c = carray.new(\"char\"):append(\"1234567890\")\n\nassert(c:get(1) == string.byte(\"1\"))\nassert(c:tostring() == \"1234567890\")\nassert(c:tostring(1,1) == \"1\")\nassert(c:tostring(2,4) == \"234\")\n\nc:set(4, \"ab\", string.byte(\"c\"))\nassert(c:tostring() == \"123abc7890\")\n```\n\n\u003c!-- ---------------------------------------------------------------------------------------- --\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosch%2Flua-carray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosch%2Flua-carray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosch%2Flua-carray/lists"}