Ignore:
Timestamp:
Mar 9, 2006, 1:36:29 AM (16 years ago)
Author:
titer
Message:

Adds an error feedback for tr_torrentInit.
Adds tr_torrentInfo along with tr_torrentStat.
Removed now unused tr_setFinished.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_api/libtransmission/transmission.c

    r137 r138  
    167167 * to fill it.
    168168 **********************************************************************/
    169 tr_torrent_t * tr_torrentInit( tr_handle_t * h, const char * path )
     169tr_torrent_t * tr_torrentInit( tr_handle_t * h, const char * path,
     170                               int * error )
    170171{
    171172    tr_torrent_t  * tor, * tor_tmp;
     
    180181    if( tr_metainfoParse( inf, path ) )
    181182    {
     183        *error = TR_EINVALID;
    182184        free( tor );
    183185        return NULL;
     
    190192                     SHA_DIGEST_LENGTH ) )
    191193        {
    192             tr_err( "Torrent already open" );
     194            *error = TR_EDUPLICATE;
    193195            free( tor );
    194196            return NULL;
     
    253255}
    254256
     257tr_info_t * tr_torrentInfo( tr_torrent_t * tor )
     258{
     259    return &tor->info;
     260}
     261
    255262/***********************************************************************
    256263 * tr_torrentScrape
     
    329336int tr_getFinished( tr_torrent_t * tor )
    330337{
    331         return tor->finished;
    332 }
    333 void tr_setFinished( tr_torrent_t * tor, int val)
    334 {
    335         tor->finished = val;
     338    if( tor->finished )
     339    {
     340        tor->finished = 0;
     341        return 1;
     342    }
     343    return 0;
    336344}
    337345
     
    355363    tr_lockLock( &tor->lock );
    356364
    357     memcpy( &s->info, &tor->info, sizeof( tr_info_t ) );
    358365    s->status = tor->status;
    359366    memcpy( s->error, tor->error, sizeof( s->error ) );
Note: See TracChangeset for help on using the changeset viewer.