![]() |
![]()
| ![]() |
![]()
NAMExt_str_argv_cat() - Append argv-style list to a string LIBRARY#include <xtend/string.h> -lxtend SYNOPSISsize_t xt_str_argv_cat(char *string, char *argv[], size_t first_arg, size_t string_buff_size) ARGUMENTSstring String to which argv elements are appended argv Character pointer array to a list of elements first_arg Index of first argument to append string_buff_size Size of string array including null byte DESCRIPTIONAppend an argv style list of arguments to a string. This is useful for constructing a command to be passed to a shell via system() or similar methods. RETURN VALUESLength of string + all argv elements. If this is greater than string_buff_size, then the string has been truncated. EXAMPLESchar cmd[CMD_MAX + 1] = "ls", SEE ALSOstrlcpy(3), strlcat(3), snprintf(3)
|