Skip to main content

This tool reads a C source file (.c) and generates the text for the corresponding header file, with function declarations for any non-static function definitions found in the provided C file.

Installation

pip install cheaders

Usage

Execute cheaders through the python interpreter as a module:

python -m cheaders source_file.c

Example output

The following example shows what is generated for a sample .c file. The sample file is called ulist_.c, and contains the following code:

Example C source file

int myfunction(int intvar, float floatvar)
{
        // Do important stuff
        return 0;
}


void myotherfunction(int intvar, float floatvar, char long_name_variable)
{
        // Do other important stuff
}

The header file that will be generated, with doxygen comments enabled (the default) looks like this:

Generated header file

/*
 * myfile.h
 *
 * (Description here)
 *
 */


#ifndef MYFILE_H
#define MYFILE_H


/**
 * (Description)
 *
 * @param   intvar      (description)
 * @param   floatvar    (description)
 *
 * @return  (description)
 */
int myfunction(int intvar, float floatvar);


/**
 * (Description)
 *
 * @param   intvar              (description)
 * @param   floatvar            (description)
 * @param   long_name_variable  (description)
 */
void myotherfunction(int intvar, float floatvar, char long_name_variable);


#endif /* MYFILE_H */

Metadata

Release files for cheaders 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cheaders 1.0.0
File Interpreter ABI Platform
cheaders-1.0.0-py3-none-any.whl Python 3 none any Details
cheaders-1.0.0-py2-none-any.whl Python 2 none any Details

Total release size: 10.5 kB

Release files / cheaders-1.0.0-py3-none-any.whl

Download URL cheaders-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
712f7b55d475d2f10779916960b146128c815379c4cdcfc048443c44aa6656a4
BLAKE2b-256 checksum
How to use checksums
3c376a8b45908d1deaae0726be938e6bbd45c8c8c6f7b17536e61eca452aa9e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.9.0-8-amd64

Release files / cheaders-1.0.0-py2-none-any.whl

Download URL cheaders-1.0.0-py2-none-any.whl
Size 5.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
0856629de3837af8cf38af3fb9a381e839b0ab7841d66a4982425a01151e822d
BLAKE2b-256 checksum
How to use checksums
2e538de72c3e7cb9bf9a824371e55468f924963e6d91df6f9ff573bfa88cd7bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.9.0-8-amd64

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page