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.

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.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com