Skip to content

Instantly share code, notes, and snippets.

@auroranockert
Created February 19, 2014 19:12
Show Gist options
  • Save auroranockert/9099349 to your computer and use it in GitHub Desktop.
Save auroranockert/9099349 to your computer and use it in GitHub Desktop.
#[link(name = "cairo")]
extern {
fn cairo_matrix_init(this: *mut Matrix, xx: f64, yx: f64, xy: f64, yy: f64, x0: f64, y0: f64) -> Matrix;
}
pub struct Matrix {
xx: f64,
yx: f64,
xy: f64,
yy: f64,
x0: f64,
y0: f64
}
fn main() {
use std;
unsafe {
let mut m = std::unstable::intrinsics::init();
cairo_matrix_init(&mut m, 10.0, 1.0, 2.0, 3.0, 4.0, 5.0);
println!("{:?}", m);
}
}
#include <stdio.h>
#include <cairo.h>
int main() {
cairo_matrix_t m;
cairo_matrix_init(&m, 10.0, 1.0, 2.0, 3.0, 4.0, 5.0);
printf("%f", m.x0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment