Basic library initialization

This commit is contained in:
Steven Fackler 2013-10-04 20:46:27 -07:00
parent 97713dfaf5
commit 6afafafe60
3 changed files with 28 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/.rust/
/bin/
/build/
/lib/

18
src/ssl/lib.rs Normal file
View File

@ -0,0 +1,18 @@
mod ffi {
use std::libc::{c_int};
#[link_args = "-lssl"]
extern "C" {
fn SSL_library_init() -> c_int;
fn SSL_load_error_strings();
}
}
#[fixed_stack_segment]
pub fn init() {
unsafe {
ffi::SSL_library_init();
ffi::SSL_load_error_strings();
}
}

6
src/ssl/test.rs Normal file
View File

@ -0,0 +1,6 @@
extern mod ssl;
#[test]
fn test_init_works() {
ssl::init();
}