src/server/twitpoollist.c
int removefromtwitpoollist( struct twitpoollist * restrict tpl, 
				struct twitpoollist_node * restrict tplnode ){	
	// Validate the parameters
	if ( tpl == NULL || tplnode == NULL ){
		errno = EINVAL;
		return ( -1 );
	}

	// Unlink the node from the list
	// If it is the first node in the list then the head must be made to point to the next node from
 	// the one to be deleted

	if ( tplnode->tpln_previous == NULL ){
		tpl->tpl_head = tplnode->tpln_next;
	}
	// Otherwise that must happen for the previous node of the one to be deleted.
	else{
		tplnode->tpln_previous->tpln_next = tplnode->tpln_next;
	}

	// Cleanup that node
	deltwitpool( &tplnode->tpln_twitpool );
	while ( pthread_mutex_destroy( &tplnode->tpln_lock ) ){ continue; }
	while ( pthread_cond_destroy( &tplnode->tpln_cond ) ){ continue; }
	free( tplnode );

	return ( 0 );
}
// Remove the node pointed to by tplnode from the list
Remove the node pointed to by tplnode from the list
Remove the node pointed to by tplnode from the list
int removefromtwitpoollist( struct twitpoollist * restrict tpl, 
				struct twitpoollist_node * restrict tplnode ){	
	if ( tpl == NULL || tplnode == NULL ){
		errno = EINVAL;
		return ( -1 );
	}
	if ( tplnode->tpln_previous == NULL ){
		tpl->tpl_head = tplnode->tpln_next;
	}
	else{
		tplnode->tpln_previous->tpln_next = tplnode->tpln_next;
	}
	deltwitpool( &tplnode->tpln_twitpool );
	while ( pthread_mutex_destroy( &tplnode->tpln_lock ) ){ continue; }
	while ( pthread_cond_destroy( &tplnode->tpln_cond ) ){ continue; }
	free( tplnode );
	return ( 0 );
}
int removefromtwitpoollist ( struct twitpoollist * restrict tpl , struct twitpoollist_node * restrict tplnode ) { if ( tpl == NULL || tplnode == NULL ) { errno = EINVAL ; return ( -1 ) ; } if ( tplnode -> tpln_previous == NULL ) { tpl -> tpl_head = tplnode -> tpln_next ; } else { tplnode -> tpln_previous -> tpln_next = tplnode -> tpln_next ; } deltwitpool ( & tplnode -> tpln_twitpool ) ; while ( pthread_mutex_destroy ( & tplnode -> tpln_lock ) ) { continue ; } while ( pthread_cond_destroy ( & tplnode -> tpln_cond ) ) { continue ; } free ( tplnode ) ; return ( 0 ) ; }
Remove the node pointed to by tplnode from the list
Remove the node pointed to by tplnode from the list
// Validate the parameters // Unlink the node from the list // If it is the first node in the list then the head must be made to point to the next node from // the one to be deleted // Otherwise that must happen for the previous node of the one to be deleted. // Cleanup that node