{"id":17256563,"url":"https://github.com/ssteinbach/c_call_zig","last_synced_at":"2025-07-15T23:44:01.175Z","repository":{"id":149359987,"uuid":"550663280","full_name":"ssteinbach/c_call_zig","owner":"ssteinbach","description":"Small example of calling a static zig library from C code.","archived":false,"fork":false,"pushed_at":"2025-04-08T05:18:33.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T06:24:58.779Z","etag":null,"topics":["c","ffi","linking","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssteinbach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-13T06:00:14.000Z","updated_at":"2025-04-08T05:18:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"4dcabc38-1c83-4f6b-8fc9-64d00e1b9e26","html_url":"https://github.com/ssteinbach/c_call_zig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteinbach%2Fc_call_zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteinbach%2Fc_call_zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteinbach%2Fc_call_zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteinbach%2Fc_call_zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssteinbach","download_url":"https://codeload.github.com/ssteinbach/c_call_zig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830395,"owners_count":21168272,"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","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":["c","ffi","linking","zig","ziglang"],"created_at":"2024-10-15T07:14:43.678Z","updated_at":"2025-04-14T06:10:19.758Z","avatar_url":"https://github.com/ssteinbach.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calling Zig from C\n\n## Overview\n\nExample repository for calling zig functions from C.  Zig has some nice\nreflection based JSON parsing ability, this exposes a c function that uses that\nto parse a C-struct out of JSON and return it.\n\n## Requirements\n\n* Zig (built against 0.13.0)\n* C toolchain (clang)\n\n## Building\n\n```bash\n\u003e make\n\u003e ./c_to_zig_json_reader\n```\n\n## Testing\n\nThere is a (small) unit test in `src/json_reader.zig`.\n\n```bash\n\u003e make test\n```\n\n## Build.zig Note\n\nWhen building the static library to wrap in C, make sure the build.zig\nincludes:\n\n```zig\nconst lib = b.addStaticLibrary(\"zigJsonReader\", \"json_reader.zig\");\nlib.bundle_compiler_rt = true;\n```\n\nAdditionally, the header file is written by hand.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssteinbach%2Fc_call_zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssteinbach%2Fc_call_zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssteinbach%2Fc_call_zig/lists"}