Cfunctions - automatically make C header files

cfunctions (pronounced `see-functions') is a C utility for extracting function prototypes and global variables from C files.

Try it!

Try running cfunctions on a C file.

cfunctions takes C files and extracts global information such as function prototypes and external variable declarations from them.

This is useful for

cfunctions's default behaviour is to run as a filter (pipe) reading a C file from standard input and writing to standard output. It can also read files from the command line, and make complete header files, with a banner at the top, a preprocessor wrapper, and copying of verbatim material such as typedefs, macros or struct definitions automatically generated.

cfunctions can also optionally make GNU C style `extern inline' functions by copying the inline functions into the header file, with a normal prototype for the case of non-GNU C compilers.

cfunctions cuts down on the cost of making header files and maintaining them compared to hand-editing.

One can also use it to make forward declarations for static functions, etc. by using it as a pipe. It can also make a tag table from the C file.

cfunctions can be controlled by command-line switches and by directives in the C files themselves.


The current version is 0.28


cfunctions can be downloaded from

Version control repository

There is a "git" repository for cfunctions. This repository does not contain header files which are generated by Cfunctions itself, so it is not possible to compile these sources. It is necessary to have a working version of Cfunctions in order to build it. People who wish to develop Cfunctions should download it from to create a working version, and build it, before forking the repository.

Mailing list

There is a mailing list for this program at It is possible to mail to the list at New versions are announced on the mailing list.

Bugs or problems

Bugs and all problems should be reported to the maintainer via email, or to the mailing list.

How to use cfunctions

Please see the online manual.

See also

The following open-source projects have a similar goal to Cfunctions.


Makeheaders by D. Richard Hipp, also author of the SQLite software, creates a header file from a C file in a similar way to Cfunctions. It also works for C++ files.

Copyright © Ben Bullock 2009-2015. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( / Privacy / Disclaimer