Function fts::ffi::fts_open [] [src]

pub unsafe extern "C" fn fts_open(
    path_argv: *const *const c_char,
    options: c_int,
    compar: Option<extern "C" fn(_: *const *const FTSENT, _: *const *const FTSENT) -> c_int>
) -> *mut FTS

fts_open() in fts.h

C function

FTS *fts_open(char * const *path_argv, int options,
              int (*compar)(const FTSENT **, const FTSENT **));

Safety

path_argv must be a pointer of a null-terminated array of C strings( null-terminated ).

options must contain either FTS_LOGICAL or FTS_PHYSICAL.

Examples

let path  = std::ffi::CString::new( "." ).unwrap();
let paths = vec![path.as_ptr(), std::ptr::null()];
let _fts  = unsafe { fts::ffi::fts_open( paths.as_ptr(), fts::ffi::FTS_LOGICAL, None ) };