Skip to content

Commit

Permalink
Basic library initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Oct 5, 2013
1 parent 97713df commit 6afafaf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.rust/
/bin/
/build/
/lib/
18 changes: 18 additions & 0 deletions src/ssl/lib.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 0 deletions src/ssl/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extern mod ssl;

#[test]
fn test_init_works() {
ssl::init();
}

0 comments on commit 6afafaf

Please sign in to comment.