Skip to content

barracudanetworks/constantsgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

constantsgen

Generate code in various languages containing constants defined in the specified C-like files. It supports #define constants and named enums.

It uses Python 3.4 enums, and 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.

Supported output languages:

  • Python
  • PHP
  • LaTeX

Example usage:

./generate_constants constants.txt constants.py
./generate_constants -l php constants.txt constants.php

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published