mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
add user_data (void *) to the queue callback
This commit is contained in:
parent
8ceb1fd016
commit
ae89e4683d
4 changed files with 6 additions and 4 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
||||
/***
|
||||
|
|
Loading…
Reference in a new issue