parse_c_multistring

Function parse_c_multistring 

Source
pub unsafe fn parse_c_multistring<F>(
    buf: *const c_char,
    limit: Option<usize>,
    f: F,
) -> usize
where F: FnMut(&[u8]),
Expand description

Parses a C “multistring”.

This function can be used to process the “multistring” format used by some C APIs, e.g. Windows environment variable values or the req->ptr result in a uv_fs_readdir() call.

Optionally, a limit can be passed in, limiting the parsing to only being done limit times.

The specified closure is invoked with each string that is found, and the number of strings found is returned.