Crate cmacros [−] [src]
Library providing functions to assist with parsing and translating '#define' macro definitions from C header files to corresponding Rust code for use with bindings to external libraries.
Structs
CMacro |
Macro definition parsed from a C header file |
ConstDecl |
Attributes for a Rust constant definition |
Enums
TranslateAction |
Specifies a transformation from a C macro definition to Rust code |
Functions
extract_macros |
Parse the source for a C header and extract a list of macro definitions |
generate_rust_src |
Generates Rust source based on a set of C macro definitions and a translation function which specifies how to map each macro to a corresponding Rust type |
guess_type |
Guess a suitable constant type for a macro based on the body of the macro |
translate_macro |
Guesses a suitable translation from a C macro definition to a Rust representation. |