array.c
//appends param x to end of array param ap
//inits array if necessary
//resizes array if necessary
//returns 1 on success, 0 on failure
appends param x to end of array param ap
inits array if necessary
resizes array if necessary
returns 1 on success, 0 on failure
appends param x to end of array param ap inits array if necessary resizes array if necessary returns 1 on success 0 on failure
int array_append(array_t* ap, int x) {
	if( !ap->array ) {
		init_array(ap, 10);
	}
	if( ap->length == ap->capacity ) {
		int e = array_resize(ap, ap->capacity * 2);
		WARN_EXIT_IF(!e, "array resize for append failed");
		if( !e ) { return(0); }
	}
	ap->array[ ap->length++ ] = x;
	return(1);
}
int array_append ( array_t * ap , int x ) { if ( ! ap -> array ) { init_array ( ap , 10 ) ; } if ( ap -> length == ap -> capacity ) { int e = array_resize ( ap , ap -> capacity * 2 ) ; WARN_EXIT_IF ( ! e , " " ) ; if ( ! e ) { return ( 0 ) ; } } ap -> array [ ap -> length ++ ] = x ; return ( 1 ) ; }
appends param x to end of array param ap
inits array if necessary
resizes array if necessary
returns 1 on success, 0 on failure
appends param x to end of array param ap inits array if necessary resizes array if necessary returns 1 on success 0 on failure