This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ffi::CString; | |
use std::os::raw::{c_char, c_int}; | |
use std::{ptr, mem}; | |
#[no_mangle] | |
unsafe extern "C" fn get_strings(outlen: *mut c_int) -> *mut *mut c_char { | |
let mut v = vec![]; | |
// Let's fill a vector with null-terminated strings | |
v.push(CString::new("Hello").unwrap()); |