library/src/utility/BP-StringUtilities.cc
// Counts the number of pointers in a null pointer terminated pointer array.  Set
// the max_count parameter to zero to allow for uncapped matches.
Counts the number of pointers in a null pointer terminated pointer array.  Set
the max_count parameter to zero to allow for uncapped matches.
Counts the number of pointers in a null pointer terminated pointer array . Set the max_count parameter to zero to allow for uncapped matches .
size_t BP_CountNumberOfPointersInPointerArray(void ** ptrs, size_t max_count)
{
	if(!ptrs)
		return 0;
	if(!ptrs[0])
		return 0;
	size_t pointer_count = 0;
	size_t n = 0;
	for(; ptrs[pointer_count]; pointer_count++)
	{
		if(max_count)
		if(pointer_count == max_count)
			break;
	}
	return pointer_count;
}
size_t BP_CountNumberOfPointersInPointerArray ( void * * ptrs , size_t max_count ) { if ( ! ptrs ) return 0 ; if ( ! ptrs [ 0 ] ) return 0 ; size_t pointer_count = 0 ; size_t n = 0 ; for ( ; ptrs [ pointer_count ] ; pointer_count ++ ) { if ( max_count ) if ( pointer_count == max_count ) break ; } return pointer_count ; }
Counts the number of pointers in a null pointer terminated pointer array.
Counts the number of pointers in a null pointer terminated pointer array .
// ensure that we have a pointer // return zero if the first pointer is null // set pointer count // walk the pointers // break the loop if we hit the top match count (if set) // return the number of pointers found within the array