Move func "basic_geom_init_from_args" to Rust
This commit is contained in:
parent
30b8bd2703
commit
59e06c476c
11
src/geom.c
11
src/geom.c
|
@ -77,17 +77,6 @@ struct WinGeom win_geom_create_from_args(
|
|||
* Argument init functions *
|
||||
***************************/
|
||||
|
||||
void basic_geom_init_from_args(
|
||||
const BasicGeom basic_geom,
|
||||
const int x,
|
||||
const int y,
|
||||
const int width,
|
||||
const int height
|
||||
) {
|
||||
position_init_from_args(&basic_geom->position, x, y);
|
||||
sizes_init_from_args(&basic_geom->sizes, width, height);
|
||||
}
|
||||
|
||||
void win_geom_init_from_args(
|
||||
const WinGeom win_geom,
|
||||
const int x,
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -91,3 +91,17 @@ unsafe extern "C" fn sizes_init_from_args(
|
|||
) {
|
||||
*sizes = geom::Sizes::new(width, height);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn basic_geom_init_from_args(
|
||||
basic_geom: *mut geom::BasicGeom,
|
||||
x: c_int,
|
||||
y: c_int,
|
||||
width: c_int,
|
||||
height: c_int,
|
||||
) {
|
||||
*basic_geom = geom::BasicGeom::new(
|
||||
geom::Position::new(x, y),
|
||||
geom::Sizes::new(width, height),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue