{"id":15665930,"url":"https://github.com/upsuper/include_cstr","last_synced_at":"2025-03-03T06:21:41.117Z","repository":{"id":62440813,"uuid":"360507087","full_name":"upsuper/include_cstr","owner":"upsuper","description":"Macro for building static CStr reference from file content","archived":false,"fork":false,"pushed_at":"2021-04-22T12:14:20.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T05:53:09.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/upsuper.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}},"created_at":"2021-04-22T12:14:02.000Z","updated_at":"2021-12-13T07:17:00.000Z","dependencies_parsed_at":"2022-11-01T22:16:10.598Z","dependency_job_id":null,"html_url":"https://github.com/upsuper/include_cstr","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/upsuper%2Finclude_cstr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsuper%2Finclude_cstr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsuper%2Finclude_cstr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsuper%2Finclude_cstr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upsuper","download_url":"https://codeload.github.com/upsuper/include_cstr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241617573,"owners_count":19991707,"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":[],"created_at":"2024-10-03T13:57:37.738Z","updated_at":"2025-03-03T06:21:41.094Z","avatar_url":"https://github.com/upsuper.png","language":"Rust","readme":"# include_cstr\n\n\u003c!-- cargo-sync-readme start --\u003e\n\nA macro for getting `\u0026'static CStr` from a file.\n\nThis macro checks whether the content of the given file is valid for `CStr`\nat compile time, and returns a static reference of `CStr`.\n\nThis macro can be used to to initialize constants on Rust 1.46 and above.\n\nIt currently requires nightly compiler for [`proc_macro_span`][proc_macro_span] feature\nfor resolving relative path to the file,\nso that it can be used in a similar way as `include_str!` and `include_bytes!` macro.\n\n[proc_macro_span]: https://doc.rust-lang.org/unstable-book/library-features/proc-macro-span.html\n\n## Example\n\n```rust\nuse include_cstr::include_cstr;\nuse std::ffi::CStr;\n\nlet example = include_cstr!(\"example.txt\");\nassert_eq!(example, CStr::from_bytes_with_nul(b\"content in example.txt\\0\").unwrap());\n```\n\n\u003c!-- cargo-sync-readme end --\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsuper%2Finclude_cstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupsuper%2Finclude_cstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsuper%2Finclude_cstr/lists"}