Skip to content

garoose/constantsgen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

constantsgen

Generate Python containing constants in the specified C-like files.

It supports #define constants and named enums. It takes a specification of which constants to export on standard input and outputs to standard output.

It uses Python 3.4 enums, so it works with Python 3.4 or higher and earlier versions with the enum34 package.

constants.txt contains a description and example of the input format. It does not parse the files, so things that would contain syntax errors in C, like XDR files, do not cause problems.

Example usage:

python constantsgen.py path/to/file.c path/to/file.h < constants.txt > constants.py

About

extract constants from C-like files and emit them in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%