{"id":17774620,"url":"https://github.com/jiegec/cdefines","last_synced_at":"2025-04-01T15:33:02.169Z","repository":{"id":57544509,"uuid":"186232334","full_name":"jiegec/cdefines","owner":"jiegec","description":"Turn #define C codes into Rust constants.","archived":false,"fork":false,"pushed_at":"2022-06-05T01:39:22.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-07T12:36:22.494Z","etag":null,"topics":["rust-macro"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jiegec.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}},"created_at":"2019-05-12T08:56:49.000Z","updated_at":"2022-06-05T01:38:48.000Z","dependencies_parsed_at":"2022-08-27T04:22:27.091Z","dependency_job_id":null,"html_url":"https://github.com/jiegec/cdefines","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiegec%2Fcdefines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiegec%2Fcdefines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiegec%2Fcdefines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiegec%2Fcdefines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiegec","download_url":"https://codeload.github.com/jiegec/cdefines/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246662611,"owners_count":20813770,"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":["rust-macro"],"created_at":"2024-10-26T21:51:32.334Z","updated_at":"2025-04-01T15:33:02.122Z","avatar_url":"https://github.com/jiegec.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdefines\n\nTurn `#define` C codes into Rust constants.\n\n## How to use:\n\nAdd to code:\n\n```rust\nextern crate cdefines;\n\n#[cdefines::preprocessor]\nconst IOCTL: \u0026str = \n    \"#define TCGETS\t\t0x5401\n    #define TCSETS\t\t0x5402\n    #define TCSETSW\t\t0x5403\n    #define TCSETSF\t\t0x5404\";\n```\n\nIt gets translated to:\n\n```rust\nconst IOCTL_TCGETS: usize = 0x5401;\n// ...\nenum IOCTL {\n    TCGETS = 0x5401,\n    // ...\n}\n```\n\n## What is supported\n\n1. Plain integers(hex, oct, bin, dec) e.g. `#define A 0x1234`.\n2. Simple define cascading e.g. `#define A 123` and then `#define B A`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiegec%2Fcdefines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiegec%2Fcdefines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiegec%2Fcdefines/lists"}