array.c
//resizes array to param new_size; may increase or decrease size
//returns 1 on success, 0 on failure
resizes array to param new_size; may increase or decrease size
returns 1 on success, 0 on failure
resizes array to param new_size ; may increase or decrease size returns 1 on success 0 on failure
int array_resize(array_t* ap, int new_size) {
	void* tmp = realloc(ap->array, new_size * sizeof(int));
	WARN_EXIT_IF( !tmp, "realloc failed" );
	if( tmp ) {
		WARN_EXIT_IF( new_size < ap->length, "data leak from array resize");
		ap->array = tmp;
		ap->capacity = new_size;
		return(1);
	}
	return(0);
}
int array_resize ( array_t * ap , int new_size ) { void * tmp = realloc ( ap -> array , new_size * sizeof ( int ) ) ; WARN_EXIT_IF ( ! tmp , " " ) ; if ( tmp ) { WARN_EXIT_IF ( new_size < ap -> length , " " ) ; ap -> array = tmp ; ap -> capacity = new_size ; return ( 1 ) ; } return ( 0 ) ; }
resizes array to param new_size; may increase or decrease size
returns 1 on success, 0 on failure
resizes array to param new_size ; may increase or decrease size returns 1 on success 0 on failure