Skip to content

Instantly share code, notes, and snippets.

@dbrgn
Created January 24, 2017 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrgn/5a0e5ad58ea8a69778d452161ff3dcbe to your computer and use it in GitHub Desktop.
Save dbrgn/5a0e5ad58ea8a69778d452161ff3dcbe to your computer and use it in GitHub Desktop.
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Rectangle {
pub width: ::std::os::raw::c_int,
pub height: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Rectangle() {
assert_eq!(::std::mem::size_of::<Rectangle>() , 8usize);
assert_eq!(::std::mem::align_of::<Rectangle>() , 4usize);
}
extern "C" {
#[link_name = "_ZN9Rectangle14set_values_mutEii"]
pub fn Rectangle_set_values_mut(this: *mut Rectangle,
arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int);
}
extern "C" {
#[link_name = "_ZNK9Rectangle10set_valuesEii"]
pub fn Rectangle_set_values(this: *const Rectangle,
arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int);
}
extern "C" {
#[link_name = "_ZN9Rectangle9get_widthEv"]
pub fn Rectangle_get_width(this: *mut Rectangle) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "_ZN9Rectangle10get_heightEv"]
pub fn Rectangle_get_height(this: *mut Rectangle)
-> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "_ZN9Rectangle4areaEv"]
pub fn Rectangle_area(this: *mut Rectangle) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "_ZN9RectangleC1Eii"]
pub fn Rectangle_Rectangle(this: *mut Rectangle, w: ::std::os::raw::c_int,
h: ::std::os::raw::c_int);
}
extern "C" {
#[link_name = "_ZN9RectangleC1ERKS_"]
pub fn Rectangle_Rectangle1(this: *mut Rectangle, r: *const Rectangle);
}
impl Clone for Rectangle {
fn clone(&self) -> Self { *self }
}
impl Rectangle {
#[inline]
pub unsafe fn set_values_mut(&mut self, arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int) {
Rectangle_set_values_mut(&mut *self, arg1, arg2)
}
#[inline]
pub unsafe fn set_values(&self, arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int) {
Rectangle_set_values(&*self, arg1, arg2)
}
#[inline]
pub unsafe fn get_width(&mut self) -> ::std::os::raw::c_int {
Rectangle_get_width(&mut *self)
}
#[inline]
pub unsafe fn get_height(&mut self) -> ::std::os::raw::c_int {
Rectangle_get_height(&mut *self)
}
#[inline]
pub unsafe fn area(&mut self) -> ::std::os::raw::c_int {
Rectangle_area(&mut *self)
}
#[inline]
pub unsafe fn new(w: ::std::os::raw::c_int, h: ::std::os::raw::c_int)
-> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Rectangle_Rectangle(&mut __bindgen_tmp, w, h);
__bindgen_tmp
}
#[inline]
pub unsafe fn new1(r: *const Rectangle) -> Self {
let mut __bindgen_tmp = ::std::mem::uninitialized();
Rectangle_Rectangle1(&mut __bindgen_tmp, r);
__bindgen_tmp
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment