library/src/utility/BP-StringUtilities.cc
// Destroys an array of pointers but relies on a trailing
// null terminating null pointer to determine when it should
// stop destroying.
Destroys an array of pointers but relies on a trailing
null terminating null pointer to determine when it should
stop destroying.
Destroys an array of pointers but relies on a trailing null terminating null pointer to determine when it should stop destroying .
BP_ERROR_T BP_DestroyPointerArrayNullTerminated(void ** ptrs)
{
	if(!ptrs)
		return ERR_FAILURE;
	size_t n = 0;
	for(; ptrs[n]; n++)
	{
		bpfree(ptrs[n]);
		ptrs[n] = NULL;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DestroyPointerArrayNullTerminated ( void * * ptrs ) { if ( ! ptrs ) return ERR_FAILURE ; size_t n = 0 ; for ( ; ptrs [ n ] ; n ++ ) { bpfree ( ptrs [ n ] ) ; ptrs [ n ] = NULL ; } return ERR_SUCCESS ; }
Destroys an array of pointers but relies on a trailing
null terminating null pointer to determine when it should
stop destroying.
Destroys an array of pointers but relies on a trailing null terminating null pointer to determine when it should stop destroying .
// check to ensure that we have a pointer // destroy the individual elements // return indicating success