{"id":29634334,"url":"https://github.com/rubymetric/rawstr4c","last_synced_at":"2026-06-19T01:31:23.957Z","repository":{"id":305609832,"uuid":"1023330509","full_name":"RubyMetric/rawstr4c","owner":"RubyMetric","description":"Raw strings for the C programming language","archived":false,"fork":false,"pushed_at":"2025-08-09T04:37:04.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T06:19:24.238Z","etag":null,"topics":["c","raku"],"latest_commit_sha":null,"homepage":"https://raku.land/zef:ccmywish/rawstr4c","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyMetric.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,"zenodo":null}},"created_at":"2025-07-21T02:14:04.000Z","updated_at":"2025-08-09T04:37:08.000Z","dependencies_parsed_at":"2025-07-21T05:39:57.923Z","dependency_job_id":null,"html_url":"https://github.com/RubyMetric/rawstr4c","commit_stats":null,"previous_names":["rubymetric/rawstr4c"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyMetric/rawstr4c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frawstr4c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frawstr4c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frawstr4c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frawstr4c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyMetric","download_url":"https://codeload.github.com/RubyMetric/rawstr4c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frawstr4c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273850515,"owners_count":25179354,"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-06T02:00:13.247Z","response_time":2576,"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":["c","raku"],"created_at":"2025-07-21T16:00:29.098Z","updated_at":"2026-06-19T01:31:23.936Z","avatar_url":"https://github.com/RubyMetric.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- -----------------------------------------------------------\n ! SPDX-License-Identifier: GFDL-1.3-or-later\n ! -------------------------------------------------------------\n ! Doc Type      : Markdown\n ! Doc Name      : README.md\n ! Doc Authors   : Aoran Zeng \u003cccmywish@qq.com\u003e\n ! Contributors  :  Nul None  \u003cnul@none.org\u003e\n !               |\n ! Created On    : \u003c2025-07-12\u003e\n ! Last Modified : \u003c2026-04-15\u003e\n ! ---------------------------------------------------------- --\u003e\n\n# rawstr4c\n\nrawstr4c - Raw strings for the C programming language\n\n\u003cbr\u003e\n\n**The key innovation of `rawstr4c` is its use of a Markdown file to explicitly define raw strings inside code blocks — allowing you to fully leverage your editor’s syntax highlighting feature to beautifully render them!**\n\n\u003cbr\u003e\n\n\u003e [!NOTE]\n\u003e `rawstr4c` was originally developed for [chsrc], and is now maintained as a subproject of it. [chsrc] benefits greatly from `rawstr4c`.\n\n\u003cbr\u003e\n\n\n\n## Why implemented in [Raku]?\n\nBecause **Raku** is the **RAw strings Kungfu Utility**!\n\n`rawstr4c` has no module dependencies by design — just install [Rakudo] via your package manager and you're ready to go. Lightweight, hassle-free, and **a perfect excuse to explore Raku, the language you can have fun with**.\n\n\u003cbr\u003e\n\n\n\n## Why do we still need it when we have `R\"()\"`\n\nUntil now (2025-07), the C language does not have raw strings in its current ISO standard, but **both `GCC` and `Clang` have already implemented the extension `R\"()\"`**. In fact, it is enabled by default in `GCC`.\n\nHowever, there are several reasons why we still need `rawstr4c`:\n\n1. `R\"()\"` is just an extension. Many projects that strictly adhere to `-std=c*` cannot use it\n2. Many C compilers may not implement this extension, limiting the choice of C compilers for projects\n3. `LLVM` only supports this extension after July 2024; versions prior to that do not support it\n\nEven if direct raw strings support is added in future C standards like `C3x` or `C4x`, `rawstr4c` still remains meaningful, because when raw strings are written directly in source code files, they cannot be properly highlighted according to the content.\n\nIn [chsrc], we use both the native `R\"()\"` form and also `rawstr4c` to get the maximum flexibility and maintainability.\n\n\u003cbr\u003e\n\n\n\n## Install\n\n[![rawstr4c on Raku Land](https://raku.land/zef:ccmywish/rawstr4c/badges/version)](https://raku.land/zef:ccmywish/rawstr4c)\n\n1. Install [Rakudo] (bundled with `zef`)\n2. Then run:\n\n```bash\n$ zef install rawstr4c\n```\n\n\u003cbr\u003e\n\n\n\n## Usage\n\n```bash\n$ rawstr4c --help\n```\n\nYou need to write a Markdown file (default `rawstr4c.md`) to record raw strings and configure `rawstr4c`. See below for configuration syntax.\n\n\u003cbr\u003e\n\n\n\n## Convention\n\nA configuration file should use this order:\n\n1. section title\n2. description of the variable\n3. configuration block (configblock)\n4. configuration block (configblock) comments\n5. code block (codeblock) (raw string)\n6. comments for the content of the code block (codeblock)\n\n\u003cbr\u003e\n\n\n\n## Configuration Syntax\n\n```markdown\n\n- config-item1 = `:mode`\n\n- config-item2 = `true|false|yes|no`\n\n- config-item3 = `string value`\n\n```\n\nConfiguration items always start with `-`, followed by the configuration item name and an `=`. The right-hand value must be wrapped with ``` `` ```.\n\nNote: if the value is not arbitrarily given by the user, it should be set as a mode type, using `:` as a prefix.\n\n\u003cbr\u003e\n\n\n\n## Configuration Items\n\nNote: unless otherwise specified, the first item is the default value\n\n- output =\n\n  - `:terminal` = output to terminal\n  - `:macro` = output as a `.h` file, defined as macro\n  - `:global-variable` = output a `.h` file and corresponding `.c` file, defined as global variable\n  - `:global-variable-only-header` = output only as a `.h` file, defined as global variable\n\n- output-h-file =\n\n  Custom generated header filename, default value is `rawstr4c.h`\n\n- output-c-file =\n\n  Custom generated C filename, default value is `rawstr4c.c`\n\n- input-file =\n\n  Get input from an existing file, rather than the codeblock\n\n- translate =\n\n  - `:escape` = escape only\n  - `:oct` = octal\n  - `:hex` = hexadecimal\n\n- postfix =\n\n  - `:use-language` = use the language of the codeblock\n  - `your string` = use a custom string as suffix\n\n- name =\n\n  Generated variable name, includes prefix and suffix by default. If this configuration item is not given, the section title will be used\n\n- name-literally = `false` | `true`\n\n  Ignore other configuration items and use `name` directly as the variable name\n\n- namespace =\n\n  Serves as a prefix after `prefix` and before variable name `name`, affecting nested sections\n\n- no-prefix = `false` | `true`\n\n  Whether the variable name uses prefix\n\n- no-postfix = `false` | `true`\n\n  Whether the variable name uses postfix\n\n\u003cbr\u003e\n\n\n\n[Raku]:   https://raku.org/\n[Rakudo]: https://rakudo.org/\n[chsrc]:  https://github.com/RubyMetric/chsrc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubymetric%2Frawstr4c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubymetric%2Frawstr4c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubymetric%2Frawstr4c/lists"}