{"id":48093954,"url":"https://github.com/nostrability/schemata-c","last_synced_at":"2026-04-04T15:34:06.300Z","repository":{"id":347152352,"uuid":"1192975509","full_name":"nostrability/schemata-c","owner":"nostrability","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-26T20:35:07.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T08:44:58.724Z","etag":null,"topics":["c","interop","json-schema","nostr","nostrability"],"latest_commit_sha":null,"homepage":"","language":"C","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/nostrability.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T18:44:37.000Z","updated_at":"2026-03-26T20:35:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nostrability/schemata-c","commit_stats":null,"previous_names":["nostrability/schemata-c"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nostrability/schemata-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrability%2Fschemata-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrability%2Fschemata-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrability%2Fschemata-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrability%2Fschemata-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nostrability","download_url":"https://codeload.github.com/nostrability/schemata-c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nostrability%2Fschemata-c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c","interop","json-schema","nostr","nostrability"],"created_at":"2026-04-04T15:34:06.139Z","updated_at":"2026-04-04T15:34:06.258Z","avatar_url":"https://github.com/nostrability.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# schemata-c\n\nC data library for [Nostr](https://nostr.com/) protocol JSON schemas. This is the C equivalent of [`schemata-rs`](https://github.com/nostrability/schemata-rs) and the [`@nostrability/schemata`](https://github.com/nostrability/schemata) npm package.\n\nSchemas are generated from the [schemata](https://github.com/nostrability/schemata) `dist/` build via a Python script that produces C source with binary-search lookup. 367 schemas are embedded as static string literals.\n\n## Related projects\n\n| Project | Language | Role |\n|---------|----------|------|\n| [nostrability/schemata](https://github.com/nostrability/schemata) | JSON/JS | Canonical schema definitions |\n| [schemata-validator-c](https://github.com/nostrability/schemata-validator-c) | C | Validator using this library |\n| [schemata-rs](https://github.com/nostrability/schemata-rs) | Rust | Rust equivalent |\n\n## Usage\n\nAdd as a CMake subdirectory:\n\n```cmake\nadd_subdirectory(path/to/schemata-c)\ntarget_link_libraries(my_target PRIVATE schemata)\n```\n\n```c\n#include \u003cschemata/schemata.h\u003e\n#include \u003cstdio.h\u003e\n\nint main(void) {\n    /* Look up a schema by name */\n    const char *schema = schemata_get(\"kind1Schema\");\n    if (schema) {\n        printf(\"kind 1 schema: %.60s...\\n\", schema);\n    }\n\n    /* Iterate all keys */\n    size_t count;\n    const char *const *keys = schemata_keys(\u0026count);\n    printf(\"%zu schemas available\\n\", count);\n    for (size_t i = 0; i \u003c count; i++) {\n        printf(\"  %s\\n\", keys[i]);\n    }\n\n    return 0;\n}\n```\n\n## API\n\n| Function | Description |\n|----------|-------------|\n| `schemata_get(key)` | Look up a schema by export name. Returns static JSON string, or `NULL` if not found. |\n| `schemata_keys(\u0026count)` | Return sorted array of all schema keys. Sets `count` to the number of keys. |\n| `schemata_count()` | Return the total number of embedded schemas. |\n\nAll returned pointers are to static data and must not be freed.\n\n## Build \u0026 test\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=Debug\nmake\nctest -V\n```\n\nRequires [cmocka](https://cmocka.org/) for tests (auto-detected via `pkg-config`). Disable with `-DSCHEMATA_BUILD_TESTS=OFF`.\n\n## License\n\nGPL-3.0-or-later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostrability%2Fschemata-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnostrability%2Fschemata-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnostrability%2Fschemata-c/lists"}