ridiculousfish/cdecl-blocks
FreeThe venerable cdecl, with Apple blocks support
FreeFree tier
About ridiculousfish/cdecl-blocks
cdecl-blocks is an enhanced version of the classic cdecl tool, a C gibberish translator that converts English-like phrases (e.g., 'declare foo as array 5 of pointer to function returning int') into C declarations (e.g., 'int (*foo[5])()') and vice versa. This fork, maintained by ridiculous_fish, adds support for Apple's blocks syntax. It also handles typecasts, C++ declarations, and includes command line editing and history via the GNU readline library. The tool is open source and publicly available on GitHub.
Key Features
Translates English-like phrases into C declarations and vice versa
Supports Apple's blocks syntax
Handles typecasts and C++ declarations
Command line editing and history with GNU readline
Keyword completion (when using readline)
Open source and free to use
Pros & Cons
Pros
- Free and open source (public domain base)
- Supports Apple blocks syntax for modern C/Objective-C
- Includes command line editing and history with GNU readline
- Handles both C and C++ declarations
- Lightweight and focused on a single task
Cons
- Requires GNU readline for full features (command editing, history, completion); without it, features are lost
- Limited to C/C++ declaration translation; does not parse full code
- Command-line only; no graphical interface
- Linking with readline significantly increases program size
Best For
Learning and understanding complex C/C++ declarationsConverting between English descriptions and C codeReverse engineering C declarations from descriptionsTeaching C syntax and pointer/function declaration conceptsQuick generation of declaration code for documentation or code snippets
FAQ
What is cdecl?
cdecl is a program that translates English-like phrases describing C declarations into actual C code, and can also convert C declarations back into pseudo-English.
What does the 'blocks' version add?
This version, maintained by ridiculous_fish, adds support for Apple's blocks syntax, allowing translation of block declarations in C/Objective-C.
Is this tool free to use?
Yes, the original cdecl is believed to be in the public domain, and this enhanced version is open source and freely available on GitHub.
Does it support C++?
Yes, cdecl handles C++ declarations, and the distribution includes a separate c++decl command.
Does it require any libraries to compile?
It optionally uses the GNU readline library for command line editing and history. Without readline, those features are lost, but the tool still works.