Function esp_idf_sys::esp_console_split_argv
source · pub unsafe extern "C" fn esp_console_split_argv(
line: *mut c_char,
argv: *mut *mut c_char,
argv_size: usize,
) -> usize
Expand description
@brief Split command line into arguments in place @verbatim
-
This function finds whitespace-separated arguments in the given input line.
‘abc def 1 20 .3’ -> [ ‘abc’, ‘def’, ‘1’, ‘20’, ‘.3’ ]
-
Argument which include spaces may be surrounded with quotes. In this case spaces are preserved and quotes are stripped.
‘abc “123 456” def’ -> [ ‘abc’, ‘123 456’, ‘def’ ]
-
Escape sequences may be used to produce backslash, double quote, and space:
‘a\ b\c"’ -> [ ‘a b\c“’ ] @endverbatim @note Pointers to at most argv_size - 1 arguments are returned in argv array. The pointer after the last one (i.e. argv[argc]) is set to NULL.
@param line pointer to buffer to parse; it is modified in place @param argv array where the pointers to arguments are written @param argv_size number of elements in argv_array (max. number of arguments) @return number of arguments found (argc)