add user_data (void *) to the queue callback

This commit is contained in:
Jordan Lee 2011-08-03 23:40:51 +00:00
parent 8ceb1fd016
commit ae89e4683d
4 changed files with 6 additions and 4 deletions

View File

@ -3575,7 +3575,7 @@ queuePulse( tr_session * session, tr_direction dir )
if( tor != NULL ) {
tr_torrentStartNow( tor );
if( tor->queue_started_callback != NULL )
(*tor->queue_started_callback)( tor );
(*tor->queue_started_callback)( tor, tor->queue_started_user_data );
}
}
}

View File

@ -3323,9 +3323,10 @@ torrentSetQueued( tr_torrent * tor, bool queued )
}
void
tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent * ) )
tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent *, void * ), void * user_data )
{
torrent->queue_started_callback = callback;
torrent->queue_started_user_data = user_data;
}

View File

@ -236,7 +236,8 @@ struct tr_torrent
tr_torrent_idle_limit_hit_func * idle_limit_hit_func;
void * idle_limit_hit_func_user_data;
void ( * queue_started_callback )( tr_torrent * );
void * queue_started_user_data;
void ( * queue_started_callback )( tr_torrent *, void * queue_started_user_data );
bool isRunning;
bool isStopping;

View File

@ -809,7 +809,7 @@ void tr_sessionSetQueueStalledMinutes( tr_session *, int minutes );
int tr_sessionGetQueueStalledMinutes( const tr_session * );
/** @brief Set a callback that is invoked when the queue starts a torrent */
void tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent * ) );
void tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent *, void * ), void * user_data );
/***