httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathanael Noblet <nathan...@gnat.ca>
Subject Apr array functions
Date Mon, 08 Nov 2004 20:47:46 GMT
Any reason there is no function like:

APR_DECLARE(void *) apr_array_get_element(aprt_array_header_t *arr, int 
index)
{
	if(apr_is_empty_array(arr)) {
		return NULL;
	}
	
	if(index > arr->nelts) {
		return NULL;
	}
	
	if(index == 0) {
		return arr->elts;
	}

	return arr->elts+(arr->elt_size * (arr->nelts-1));
}

so that someone can use the array elements without removing them? Is 
there something I don't know that gives a reason why this is bad?

-- 
Nathanael D. Noblet
Gnat Solutions
204 - 131 Gorge Road E
Victoria, BC V9A 1L1

T/F 250.385.4613

http://www.gnat.ca/


Mime
View raw message