}
}
-tr_bool
-tr_isAddress( const tr_address * a )
-{
- return a && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 );
-}
-
const char *
tr_ntop( const tr_address * src, char * dst, int size )
{
void tr_normalizeV4Mapped( tr_address * const addr );
void tr_suspectAddress( const tr_address * a, const char * source );
-tr_bool tr_isAddress( const tr_address * a );
+
+#define tr_isAddress(a) ( ((a)!=NULL) && ( (a)->type==TR_AF_INET || (a)->type==TR_AF_INET6 ) )
typedef struct tr_net_af_support
{
tr_bool err = 0;
tr_session * session = io->session;
- assert( tr_isPeerIo( io ) );
-
dbgmsg( io, "canRead" );
/* try to consume the input buffer */
{
int res = 0;
- assert( tr_isPeerIo( io ) );
-
if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, howmuch )))
{
int e;
{
int n;
- assert( tr_isPeerIo( io ) );
-
if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_UP, howmuch )))
{
int e;
time_t doneDate );
/** @brief Sanity checker to test that the direction is TR_UP or TR_DOWN */
-tr_bool tr_isDirection( tr_direction );
+#define tr_isDirection(d) (((d)==TR_UP) || ((d)==TR_DOWN))
/** @} */
return ret;
}
-tr_bool
-tr_isDirection( tr_direction dir )
-{
- return dir==TR_UP || dir==TR_DOWN;
-}
-
int
tr_ptr2int( void* v )
{