|
| 1 | +#![feature(extern_types)] |
| 2 | +#![feature(register_tool)] |
| 3 | +#![register_tool(c2rust)] |
| 4 | +#![allow(dead_code)] |
| 5 | +#![allow(non_camel_case_types)] |
| 6 | + |
| 7 | +pub mod repository { |
| 8 | + #[c2rust::header_src = "attrcache.h:1"] |
| 9 | + pub mod attrcache_h { |
| 10 | + extern "C" { |
| 11 | + #[c2rust::src_loc = "1:1"] |
| 12 | + pub type git_attr_cache; |
| 13 | + } |
| 14 | + } |
| 15 | + |
| 16 | + #[c2rust::header_src = "repository.h:2"] |
| 17 | + pub mod repository_h { |
| 18 | + pub use super::attrcache_h::git_attr_cache; |
| 19 | + |
| 20 | + #[derive(Copy, Clone)] |
| 21 | + #[repr(C)] |
| 22 | + #[c2rust::src_loc = "2:1"] |
| 23 | + pub struct git_repository { |
| 24 | + pub attrcache: *mut git_attr_cache, |
| 25 | + } |
| 26 | + } |
| 27 | + |
| 28 | + use repository_h::git_repository; |
| 29 | +} |
| 30 | + |
| 31 | +pub mod attrcache { |
| 32 | + #[c2rust::header_src = "attrcache.h:1"] |
| 33 | + pub mod attrcache_h { |
| 34 | + #[c2rust::src_loc = "1:1"] |
| 35 | + pub const GIT_ATTR_CONFIG: i32 = 0; |
| 36 | + } |
| 37 | + |
| 38 | + #[c2rust::header_src = "repository.h:2"] |
| 39 | + pub mod repository_h { |
| 40 | + use super::git_attr_cache; |
| 41 | + |
| 42 | + #[derive(Copy, Clone)] |
| 43 | + #[repr(C)] |
| 44 | + #[c2rust::src_loc = "2:1"] |
| 45 | + pub struct git_repository { |
| 46 | + pub attrcache: *mut git_attr_cache, |
| 47 | + } |
| 48 | + |
| 49 | + #[c2rust::src_loc = "3:1"] |
| 50 | + pub unsafe extern "C" fn git_repository_attr_cache( |
| 51 | + repo: *mut git_repository, |
| 52 | + ) -> *mut git_attr_cache { |
| 53 | + (*repo).attrcache |
| 54 | + } |
| 55 | + } |
| 56 | + |
| 57 | + use repository_h::git_repository; |
| 58 | + |
| 59 | + #[derive(Copy, Clone)] |
| 60 | + #[repr(C)] |
| 61 | + pub struct git_attr_cache { |
| 62 | + pub x: i32, |
| 63 | + } |
| 64 | + |
| 65 | + unsafe extern "C" fn attrcache_source_function( |
| 66 | + repo: *mut git_repository, |
| 67 | + ) -> *mut git_attr_cache { |
| 68 | + repository_h::git_repository_attr_cache(repo) |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +fn main() {} |
0 commit comments