- Convert C libraries to header only libraries with prefixed names/identifiers/macros.
- Avoid name clash in libraries.
- Easy auto completion.
- Planned to be used in Yaksha programming language.
- Provides a small python DSL to modify C code.
- DSL Functions
use_source(path: str)
- use this source directory (copy it to temp) and chdirpatch(patch_filename: str)
- apply a .patch file in current temp directoryrename(filename: str, renames: Iterable[Tuple[str, str]])
- perform given regex renamesremove_comments(filename: str)
- remove comments from given fileprefix(filename: str, prefix_: str, renames: Iterable[str])
- rename given identifiers with prefixpreprocess(filename: str, target: str, is_temp=True, args=("-M",))
- run preprocessorextract_ids(filename: str) -> Set[str]
- extract all identifiers (non keyword and larger than 1 char)pack(intro_files: str = "", macro: str = None, private: str = "", public: str = "", target: str = None, is_temp=True)
- package files to a single header filePREFIX
default prefixPREFIX_U
default prefix upper case
- 3rd party dependencies
- See in 3rd folder.
- I needed to patch
fcpp
withfcpp.patch
so it worked for me in Windows.- This needs to be compiled
libs
- Apoorva Joshi's single header packer (used in pack function above)- Apply
libs.patch
- Apply
python-patch
- techtonik's patch script
- Tools
cids
- extract c identifiers (ignores preprocessor)- Ensure this is compiled first before you run
packer.py
- This is used by
extract_ids
- Ensure this is compiled first before you run
- Main Program
packer.py
this executes all packing scripts in instructions folder and create single file header files.