Ignore:
Timestamp:
Sep 28, 2007, 2:51:34 PM (15 years ago)
Author:
charles
Message:

add a callback to notify clients when a torrent's state changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.h

    r3201 r3220  
    444444void tr_torrentStop( tr_torrent * );
    445445
    446 /***********************************************************************
    447  * tr_getComplete, tr_getIncomplete and tr_getPartial
    448  ***********************************************************************
    449  * The first call after a torrent changed state returns 1. Returns 0
    450  * in other cases.
    451  **********************************************************************/
    452 int tr_getIncomplete( tr_torrent * tor );
    453 int tr_getDone( tr_torrent * tor );
    454 int tr_getComplete( tr_torrent * tor );
    455 
     446
     447/**
     448***  Register to be notified whenever a torrent's state changes.
     449**/
     450
     451typedef enum
     452{
     453    TR_CP_INCOMPLETE,   /* doesn't have all the desired pieces */
     454    TR_CP_DONE,         /* has all the pieces but the DND ones */
     455    TR_CP_COMPLETE      /* has every piece */
     456}
     457cp_status_t;
     458
     459typedef void (tr_torrent_status_func)(tr_torrent   * torrent,
     460                                      cp_status_t    status,
     461                                      void         * user_data );
     462
     463void tr_torrentSetStatusCallback( tr_torrent             * torrent,
     464                                  tr_torrent_status_func   func,
     465                                  void                   * user_data );
     466
     467void tr_torrentClearStatusCallback( tr_torrent * torrent );
    456468
    457469/**
     
    611623#define TR_STATUS_INACTIVE \
    612624    (TR_STATUS_STOPPING|TR_STATUS_STOPPED)
    613 
    614 typedef enum
    615 {
    616     TR_CP_INCOMPLETE,   /* doesn't have all the desired pieces */
    617     TR_CP_DONE,         /* has all the pieces but the DND ones */
    618     TR_CP_COMPLETE      /* has every piece */
    619 }
    620 cp_status_t;
    621625
    622626/***********************************************************************
Note: See TracChangeset for help on using the changeset viewer.