Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

elaraproject/effi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Effi

⚠️ IMPORTANT: Project Elara has switched over to the open-source forge Codeberg. The Project Elara repositories have been moved to this Codeberg page. This GitHub repository is no longer maintained.

Effi is Project Elara's minimal library for interfacing with C functions.

Example usage

use effi::*;

extern "C" {
    // Function signatures of all the C functions you want to call
    fn abs(n: c_int) -> c_int;
    fn sqrt(n: c_double) -> c_double;
    // ...
}

fn main() {
    unsafe {
        let n: i32 = -11;
        let n_2: f64 = 11.0;
        println!("The absolute value of {} is {}", n, abs(n as c_int));
        println!("The square root of {} is {}", n_2, sqrt(n_2 as c_double));
    }
}

About

THIS REPO HAS BEEN MOVED TO https://codeberg.org/elaraproject/elara-ffi AND IS NO LONGER MAINTAINED HERE.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages