man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

kva_match(3C)

Name

kva_match - look up a key in a key-value array

Synopsis

char *kva_match(kva_t *kva, char *key);

Description

The kva_match() function searches a kva_t structure, which is part of the authattr_t, execattr_t, profattr_t, or userattr_t structures. The function takes two arguments: a pointer to a key value array, and a key. If the key is in the array, the function returns a pointer to the first corresponding value that matches that key. Otherwise, the function returns NULL.

Return Values

Upon successful completion, the function returns a pointer to the value sought. Otherwise, it returns NULL.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
MT-Safe

See Also

getauthattr(3C), getexecattr(3C), getprofattr(3C), getuserattr(3C)

Notes

The kva_match() function returns a pointer to data that already exists in the key-value array. It does not allocate its own memory for this pointer but obtains it from the key-value array that is passed as its first argument.