src/gen-chunk.c
bool chunk_list_remove(char *name)
{
	int i, j;
	int newsize = 0;

	for (i = 0; i < chunk_list_max; i++) {
		/* Find the match */
		if (!strcmp(name, chunk_list[i]->name)) {
			/* Copy all the succeeding ones back one */
			for (j = i + 1; j < chunk_list_max; j++)
				chunk_list[j - 1] = chunk_list[j];

			/* Destroy the last one, and shorten the list */
			if ((chunk_list_max % CHUNK_LIST_INCR) == 0)
				newsize = (chunk_list_max - CHUNK_LIST_INCR) *	
					sizeof(struct chunk *);
			chunk_list_max--;
			chunk_list[chunk_list_max] = NULL;
			if (newsize)
				chunk_list = (struct chunk **) mem_realloc(chunk_list, newsize);

			return TRUE;
		}
	}

	return FALSE;
}
/**
 * Remove an entry from the chunk list, return whether it was found
 * \param name the name of the chunk being removed from the list
 * \return whether it was found; success means it was successfully removed
 */
Remove an entry from the chunk list, return whether it was found
\param name the name of the chunk being removed from the list
\return whether it was found; success means it was successfully removed
Remove an entry from the chunk list return whether it was found \ param name the name of the chunk being removed from the list \ return whether it was found ; success means it was successfully removed
bool chunk_list_remove(char *name)
{
	int i, j;
	int newsize = 0;
	for (i = 0; i < chunk_list_max; i++) {
		if (!strcmp(name, chunk_list[i]->name)) {
			for (j = i + 1; j < chunk_list_max; j++)
				chunk_list[j - 1] = chunk_list[j];
			if ((chunk_list_max % CHUNK_LIST_INCR) == 0)
				newsize = (chunk_list_max - CHUNK_LIST_INCR) *	
					sizeof(struct chunk *);
			chunk_list_max--;
			chunk_list[chunk_list_max] = NULL;
			if (newsize)
				chunk_list = (struct chunk **) mem_realloc(chunk_list, newsize);
			return TRUE;
		}
	}
	return FALSE;
}
bool chunk_list_remove ( char * name ) { int i , j ; int newsize = 0 ; for ( i = 0 ; i < chunk_list_max ; i ++ ) { if ( ! strcmp ( name , chunk_list [ i ] -> name ) ) { for ( j = i + 1 ; j < chunk_list_max ; j ++ ) chunk_list [ j - 1 ] = chunk_list [ j ] ; if ( ( chunk_list_max % CHUNK_LIST_INCR ) == 0 ) newsize = ( chunk_list_max - CHUNK_LIST_INCR ) * sizeof ( struct chunk * ) ; chunk_list_max -- ; chunk_list [ chunk_list_max ] = NULL ; if ( newsize ) chunk_list = ( struct chunk * * ) mem_realloc ( chunk_list , newsize ) ; return TRUE ; } } return FALSE ; }
Remove an entry from the chunk list, return whether it was found
 \param name the name of the chunk being removed from the list
 \return whether it was found; success means it was successfully removed
Remove an entry from the chunk list return whether it was found \ param name the name of the chunk being removed from the list \ return whether it was found ; success means it was successfully removed
/* Find the match */ /* Copy all the succeeding ones back one */ /* Destroy the last one, and shorten the list */