main/ims_tcp.c
/*
 * Find the listitem with the given value
 */
Find the listitem with the given value
Find the listitem with the given value
void removeListItemWithValue(List_t *socketList, int fd) {
	ListItem_t* tempItem;
	if (listLIST_IS_EMPTY( socketList ))
		return;
	int len = listCURRENT_LIST_LENGTH( socketList );
	tempItem = (ListItem_t *) listGET_HEAD_ENTRY( socketList );
	for ( int ii = 0; ii < len; ++ii ){
		if( fd == listGET_LIST_ITEM_VALUE( tempItem )){
			uxListRemove( tempItem );
			free(tempItem);
			return;
		}
		tempItem = (ListItem_t *)listGET_NEXT( tempItem );
	}
	return;
}
void removeListItemWithValue ( List_t * socketList , int fd ) { ListItem_t * tempItem ; if ( listLIST_IS_EMPTY ( socketList ) ) return ; int len = listCURRENT_LIST_LENGTH ( socketList ) ; tempItem = ( ListItem_t * ) listGET_HEAD_ENTRY ( socketList ) ; for ( int ii = 0 ; ii < len ; ++ ii ) { if ( fd == listGET_LIST_ITEM_VALUE ( tempItem ) ) { uxListRemove ( tempItem ) ; free ( tempItem ) ; return ; } tempItem = ( ListItem_t * ) listGET_NEXT ( tempItem ) ; } return ; }
Find the listitem with the given value
Find the listitem with the given value
//if we reach here, the value isnt in the list