2024-05-24 10:51:41 +02:00
|
|
|
# Caa - *Generate Beef bindings from C Headers*
|
2024-05-18 09:37:08 +02:00
|
|
|
|
2024-05-24 10:52:03 +02:00
|
|
|
This program is still in development and might not work fully, see [TODO](#todo) for more info on whats missing
|
2024-05-24 10:51:41 +02:00
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
- [Libclang Beef bindings](https://code.booklordofthe.dev/Booklordofthedings/Libclang-beef)
|
|
|
|
- [Libclang.dll & Libclang.lib](https://releases.llvm.org/download.html) *(contained in the LLVM download)*
|
|
|
|
|
|
|
|
## CLI
|
|
|
|
The CLI program is extremely simple and doesnt have much customizeability.
|
|
|
|
The process is as follows:
|
|
|
|
- It asks you for the amount of parameters to pass into clang
|
|
|
|
- You pass in the parameters one after another *(The first one needs to be the file path to the header)*
|
|
|
|
- The program parses the header *(For debugging purposes it lists all tokens that where not parsed)*
|
|
|
|
- You input the output file path
|
|
|
|
- File is output, program is stopped
|
|
|
|
|
|
|
|
## API
|
|
|
|
- Binding.Bind => Takes in String[] args and generates the in memory model of the header
|
|
|
|
- Binding.Generate => Creates the string representation and outputs it into the target file
|
2024-05-24 12:10:42 +02:00
|
|
|
- Binding.CursorHandles => Dictionary containing handlers for specific cursor types, can be extended *(Current broken)*
|
2024-05-24 10:51:41 +02:00
|
|
|
- Binding.Options => General Options for binding and generating
|
|
|
|
|
2024-05-24 10:58:05 +02:00
|
|
|
## Binding.Options
|
|
|
|
- Namespace => What to name the namespace and what to remove infront of all fields and names
|
|
|
|
- RemoveEnumStart => Try to find a common start to enum members and remove it
|
|
|
|
- LowercaseEnums => Outputs all enum fields in lowercase to make it easier to beefify it
|
|
|
|
|
2024-05-24 10:51:41 +02:00
|
|
|
## TODO
|
|
|
|
- Error handling when opening the header
|
|
|
|
- Remove the hack, and get Args to actually work on line 31 in Binding
|
|
|
|
- Booleans should be parsed to Beef bools
|
|
|
|
- Some libraries (sqlite) use defines for enums/constants. Find a way to parse these
|
|
|
|
- Parse the output into multiple files
|
|
|
|
- Type parse function pointers correctly
|
2024-05-24 12:10:42 +02:00
|
|
|
- Struct fields inside of structs seemingly dont work
|
|
|
|
- Fix CursorHandles (I think its because of pointer fuckery
|