11 releases

0.4.0 Mar 22, 2021
0.3.0 Mar 18, 2017
0.2.3 Oct 24, 2016
0.2.1 Sep 13, 2016
0.1.1 Jun 21, 2016

#349 in Science

Download history 90/week @ 2021-10-02 29/week @ 2021-10-09 117/week @ 2021-10-16 47/week @ 2021-10-23 108/week @ 2021-10-30 39/week @ 2021-11-06 186/week @ 2021-11-13 30/week @ 2021-11-20 86/week @ 2021-11-27 47/week @ 2021-12-04 121/week @ 2021-12-11 4/week @ 2021-12-18 5/week @ 2021-12-25 22/week @ 2022-01-01 198/week @ 2022-01-08 255/week @ 2022-01-15

480 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

6MB
127K SLoC

C 108K SLoC // 0.2% comments Rust 11K SLoC // 0.0% comments Happy 5K SLoC FORTRAN Legacy 2.5K SLoC // 0.3% comments Batch 86 SLoC Pan 59 SLoC // 0.4% comments

fitsio-sys

See the main documentation


lib.rs:

This package was automatically generated with rust-bindgen and as such was not user-generated.

The functions contained are expected to be used with fitsio, a high level API wrapper around the low level direct C-bindings, though the bindings are complete enough to be usable.

This code will not be directly documented, and so users should refer to the fitsio C documentation for usage.

Note about function names

Unfortunately we must use fits short names throughout. The C-api exposes long names for functions which are more descriptive, for example fits_open_file instead of ffopen, but the symbols available in the library have only short names, and the long names are merely preprocessor definitions.

Examples

use std::ptr;
use std::ffi;
# use fitsio_sys::{ffinit, ffphps, ffclos};

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let filename = ffi::CString::new("!/tmp/test.fits").unwrap();
let mut fptr = ptr::null_mut();
let mut status = 0;

unsafe {
    // Create a new file, clobbering any pre-existing file
    ffinit(&mut fptr as *mut *mut _,
        filename.as_ptr(),
        &mut status);

    // Add an empty primary HDU
    ffphps(fptr, 8, 0, ptr::null_mut(), &mut status);

    // Finally close the file
    ffclos(fptr, &mut status);
}

assert_eq!(status, 0);
# Ok(())
# }

Dependencies