summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dae7ac6..468b398 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,9 +17,12 @@
extern crate libc;
-pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");
+// pub const VERSION: &'static str = env!("CARGO_PKG_VERSION");
+
+pub static VERSION: &'static str = env!("CARGO_PKG_VERSION");
#[no_mangle]
-pub extern fn rs_hello() {
- println!("hello from rust!");
+pub extern fn rs_version() -> *const libc::c_char {
+ // Version from environment has nul termination (I think we can count on this?)
+ return VERSION.as_ptr() as *const libc::c_char;
}