summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-01-01Arrays of type in function arguments now generate pointers to type as per ↵Edward Barnard
the C90 standard. Closes #97.
2014-12-31Adds Default impls for generated composites.Christopher Chambers
gen.rs - Structs and unions now emit an implementation of the Default trait using std::mem::zeroed to create a zeroed instance. tests/support.rs - AST comparisons are now done on the pretty-printed version of the ASTs. Differences in AttrIds and some identifiers (generated with gensym to ensure uniqueness) made it unreliable to compare the ASTs directly. This way should work, even if it doesn't score many points for style. tests/* - Updated to use Default::default() where appropriate. - Eliminated a few warnings.
2015-01-01Merge branch 'override-enum-type' of https://github.com/dgalling/rust-bindgenJyun-Yan You
2015-01-01Merge branch 'func_proto' of https://github.com/chris-chambers/rust-bindgenJyun-Yan You
Conflicts: src/parser.rs tests/forward_declared_struct.rs tests/test_struct.rs
2014-12-30Add macro option to override enum typeDavis Gallinghouse
2014-12-29Adds support for function prototypes, improves tests.Christopher Chambers
Fixes #79. Fixes #100. Cargo.toml - Adds `[[test]]` section pointing to tests.rs, where all former tests are now imported as modules (cf Servo's tests). gen.rs - Breaks up `TFunc` handling into `TFuncPtr` and `TFuncProto`. - Eliminates empty `extern "C" { }` block that was sometimes generated. lib.rs - Eliminates `dead_code` warnings and one about `LinkType` being able to implement `Copy`. parser.rs - Breaks up function handling into `TFuncPtr` and `TFuncProto`. - Uses the `FuncSig` type to capture information about function signatures. - Adds support for pointers to arrays at the global scope. types.rs - Adds types related to function prototype and pointer handling: `FuncSig`, `TFuncPtr` and `TFuncProto`. tests - Adds quote-based testing. Using the `assert_bind_eq!` macro, it is now possible--without too much ceremony--to test bindgen output of an input file against inline source created with the `quote_item!` (and other `quote_*` macros). - Removes stringify-based testing. - Combines test running into a single entry point, `test.rs`. - Shortens test names where possible without losing context.
2014-12-29Correctly output builtins. Closes #29.Edward Barnard
2014-12-29Support more composite field types.Edward Barnard
2014-12-29Cleanup.Edward Barnard
2014-12-29Fix a bug in forward declared structs.Edward Barnard
2014-12-28Create names for unnamed bitfield members so rustc can parse the (incorrect) ↵Edward Barnard
definitions.
2014-12-28Switch to using canonical cursors. Closes #139.Edward Barnard
2014-12-27Use by-ref compare instead of by-val compare in visit_composite.Dmitry Kalyanov
When comparing type that has a pointer to itself, `==' may go into infinite recursion. Comparing by reference avoids this. Since `c' and `ty_compinfo` are Rc<RefCell<..>>, compare references to interior of RefCell.
2014-12-23Add basic build scriptEdward Barnard
2014-12-23Improve public apiEdward Barnard
2014-12-23Fix buildEdward Barnard
2014-12-20Adds support for nested structs and unions.Christopher Chambers
parser.rs - Adds detection of nested composite fields so that they can be handled specially during generation (see visit_composite). - Changes to manual recursion through Clang's cursors so that top-level and nested composites can be handled separately. gen.rs - Improves generation for nested composite types. - Unifies handling of structs and unions somewhat. types.rs - Adds CompKind to distinguish between structs and unions. - Updates CompInfo to use CompKind rather than a bool.
2014-12-19Improves argument name parsing in function pointers.Christopher Chambers
Previously, all function pointer types always had their arguments bound as arg1, arg2, etc. This change preserves the argument names, when they are available. parser.rs - Uses the type cursor to visit children and gather argument names and types. tests/func_ptr.rs - Binds tests/headers/func_ptr.h and tests/headers/func_ptr_in_struct.h and ensures that argument names are correctly bound.
2014-12-18Updates tests in macro.rs and cmath.rs.Christopher Chambers
macro.rs - Removes make_string_vec in favor of the vec! macro. - Updates test_parse_process_args with vec!. cmath.rs - Adds needed 'extern crate libc;' declaration. - bindgen! invocation now references math.h as "/usr/include/math.h", which should be pretty universal. Clang was not able to find the file using just "math.h". - Moves contents of main method into a #[test] method.
2014-12-15Correct output for empty structs.Andrew Cann
This fixes a bug where empty C structs would be outputted as struct Struct_Foo { } instead of struct Struct_Foo;
2014-12-15Fix for rustc update 2014-12-15Andrew Cann
2014-12-13Add #[deriving(Copy)] to rustified structs and unionsAndrew Cann
2014-12-13Fix build for rustc 2014-12-13Andrew Cann
2014-12-03ast::TyPath breakageGyörgy Andrasek
2014-11-20Fixes for rustc updateAndrew Cann
2014-11-18Add enum namespaceJyun-Yan You
2014-11-17Fix buildJyun-Yan You
2014-11-18Fix for rust nightlyBrendan Zabarauskas
2014-11-07Fix build for compiler updatesAndrew Cann
2014-11-03Generate calling-convention-aware bindingklutzy
With this patch, rust-bindgen generates extern functions with calling conventions specified in header. This patch also removes `-abi` flag.
2014-10-30Rename `fail!` to `panic!`Jyun-Yan You
2014-10-29Fix buildJorge Aparicio
Fixes breakage caused by rust-lang/rust#18229 and rust-lang/rust#18365
2014-10-13Fix buildJyun-Yan You
2014-10-10Replace `static` with `const`Jyun-Yan You
2014-10-06Remove some warningsJyun-Yan You
2014-10-03Gc -> RcGyörgy Andrasek
2014-10-03Fix build and replace `find_or_insert_with` with `entry`Jyun-Yan You
2014-09-30Fix build and remove some warningsJyun-Yan You
2014-09-25Fix deprecated itemsEdward Barnard
2014-09-18Fix deprecated itemsEdward Barnard
2014-09-18Update for ast gc removalEdward Barnard
2014-09-12Reduce some warningsJyun-Yan You
2014-09-04Merge branch 'master' of https://github.com/alexchandel/rust-bindgenJyun-Yan You
2014-07-05Fix binary src location for cargo buildAlex Chandel
2014-07-04Build libbindgen and bindgen with CargoAlex Chandel