add addr_rmType()

This commit is contained in:
Eric House 2014-10-28 08:03:19 -07:00
parent 2163d25a27
commit b624867cb4
2 changed files with 9 additions and 0 deletions

View file

@ -2327,6 +2327,14 @@ addr_addType( CommsAddrRec* addr, CommsConnType type )
addr->_conTypes |= 1 << (type - 1); addr->_conTypes |= 1 << (type - 1);
} }
void
addr_rmType( CommsAddrRec* addr, CommsConnType type )
{
XP_ASSERT( COMMS_CONN_NONE != type );
XP_LOGF( "%s(%s)", __func__, ConnType2Str(type) );
addr->_conTypes &= ~(1 << (type - 1));
}
/* Set of NONE is ok, but for anything else it's illegal to be adding a second /* Set of NONE is ok, but for anything else it's illegal to be adding a second
bit. Use addr_addType() for that. */ bit. Use addr_addType() for that. */
void void

View file

@ -227,6 +227,7 @@ XP_Bool comms_isConnected( const CommsCtxt* const comms );
CommsConnType addr_getType( const CommsAddrRec* addr ); CommsConnType addr_getType( const CommsAddrRec* addr );
void addr_setType( CommsAddrRec* addr, CommsConnType type ); void addr_setType( CommsAddrRec* addr, CommsConnType type );
void addr_addType( CommsAddrRec* addr, CommsConnType type ); void addr_addType( CommsAddrRec* addr, CommsConnType type );
void addr_rmType( CommsAddrRec* addr, CommsConnType type );
XP_Bool addr_hasType( const CommsAddrRec* addr, CommsConnType type ); XP_Bool addr_hasType( const CommsAddrRec* addr, CommsConnType type );
XP_Bool addr_iter( const CommsAddrRec* addr, CommsConnType* typp, XP_Bool addr_iter( const CommsAddrRec* addr, CommsConnType* typp,
XP_U32* state ); XP_U32* state );