Skip to content

kdkasad/c2e

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c2e — C → English translator

GitHub Actions Workflow Status bagde Codecov badge License badge Crates.io Version badge

c2e is a library, CLI tool, and website that can translate C type/variable declarations into English explanations.

$ c2e
> char *const (*(*foo)(const int *[]))[3]
a pointer named foo to a function that takes (an array of pointers to const ints)
and returns a pointer to an array of 3 const pointers to chars

Usage

Website

Head to https://c2e.kasad.com and start typing! The site requires JavaScript and WASM support from your browser, as all translation happens in your browser.

CLI

c2e's CLI tool provides the same capabilities as the website, but in a simple UNIX-style CLI.

Installation (pre-compiled binary)

Download the binary for your platform from the GitHub repository's release page.

Installation (from source using Cargo)

Ensure you have Cargo installed, then run one of the following commands.

# latest release
$ cargo install c2e-cli

# latest development version 
$ cargo install --git https://github.com/kdkasad/c2e c2e-cli

Using the CLI

Run c2e to enter the interactive interface. Enter declarations and the explanations will be printed to the standard output stream. Multiple declarations can be entered on the same line, separated by semicolons.

Pipes can also be used to direct input/output from/to other programs, just like with standard UNIX tools.

Output will be colored if being printed to a terminal that supports color. Piped output will not be colored.

Copyright/license

c2e is written and copyrighted by Kian Kasad. It is made a available under the terms of the GNU General Public License, version 3.

Contributing

All contributions submitted for inclusion in this project will licensed as described above. By submitting a contribution, you agree to make it available under the terms of the license.

About

C declaration → English translator

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published