The Citrine Citadel
Cdecl99 is a tool to help construct or understand complicated C declarations. Inspired by the venerable cdecl, which predates C’s standardization in 1989, cdecl99 implements more or less the same concept but for modern C.
Unlike the original cdecl, cdecl99 supports all relevant C99 keywords, has no undue restrictions on identifiers, understands features such as complex types, variadic functions and named parameters, and also has the ability to parse “plain” type names (which do not declare an identifier).
At this time there is no support for new declaration syntax introduced in C11,
including atomic types, _Alignas
, _Thread_local
or _Noreturn
specifers.
The package includes both an executable program (cdecl99) and a library (libcdecl) which can be used by other programs to provide cdecl-like functionality.
All released files are available from the cdecl99 archive directory. The latest development sources may be browsed online or cloned directly using git, e.g.,
git clone https://git.draconx.ca/cdecl99.git
The most recent release is version 1.3, released on 2024-04-05. Source code for this version is available in cdecl99-1.3.tar.gz (signature). Noteworthy changes in this release:
Use the signature file to verify that the corresponding source bundle is intact. After downloading both files, if GnuPG is installed, the signature can be verified with a command like:
gpg --verify cdecl99-1.3.tar.gz.sig cdecl99-1.3.tar.gz
If the verification fails because you don’t have the required public key, that key can be imported with a command such as:
gpg --keyserver keys.draconx.ca --recv-keys 5B45D3D185B8E1F6
Then run the verify command again. Alternatively, you can
download the public keyring manually and import it
using gpg --import
.
Cdecl99 is writtin in C, so a working C compiler is required. Certain optional features depend on the use of external libraries. In particular,
the GNU Readline library is needed for interactive line-editing and history functionality, and
the GNU libintl library (included with the GNU C library) is needed in order to support localized program messages. However, the core functionality of translating C declarations to/from pseudo-English is not localizable.
Please send suggestions, bug reports, patches or any other correspondence regarding cdecl99 by electronic mail to Nick Bowler <nbowler@draconx.ca>.
Cdecl99 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License or (at your option) any later version.