// Copyright 2015-2016 Daniel P. Clark & Other Combinatorics Developers // // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be // copied, modified, or distributed except according to those terms. extern crate libc; use libc::c_char; use std::ffi::CStr; use std::str; #[no_mangle] pub extern fn absolute(string: *const c_char) -> bool { let c_str = unsafe { assert!(!string.is_null()); CStr::from_ptr(string) }; let r_str = str::from_utf8(c_str.to_bytes()).unwrap(); match r_str.chars().next() { Some('/') => { true }, _ => { false }, } }