prg_vector_find_equivalent()
Abstract
Searches a vector for an equivalent element.
Syntax
prg_vector_find_equivalent (vector_ptr, client_state_ptr, equiv_proc, found_ptr)
| Argument | Type | Description |
|---|---|---|
vector_ptr |
PrgT_Vector * |
Vector of interest. |
client_state_ptr |
const void * |
Element we are looking for. |
equiv_proc |
PrgT_Vector_Element_Equiv_Proc |
Function that determines if two elements are equivalent. |
found_ptr |
int * |
Set to PRGC_TRUE if a matching element is found, PRGC_FALSE otherwise. |
Return Type
unsigned long
zero-indexed position of the matching element. This is only meaningful if found_ptr is set to PRGC_TRUE.
Header
prg_vector.h
Details
Searches through the elements of the vector using equiv_proc to determine if a match is found. If a matching element is found, its position index in the vector is returned. If this procedure does not find an element, it returns a meaningless value. For this reason, you should always check the value of found_ptr before using the return value.
The prototype for equiv_proc is given in PrgT_Vector_Element_Equiv_Proc.