Name

match_string — matches given string in an array

Synopsis

int match_string (const char *const * array,
 size_t n,
 const char * string);
 

Arguments

const char *const * array

array of strings

size_t n

number of strings in the array or -1 for NULL terminated arrays

const char * string

string to match with

Return

index of a string in the array if matches, or -EINVAL otherwise.