Changeset 2245
- Timestamp:
- Jun 30, 2007, 1:36:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/transmissioncli.c
r2206 r2245 164 164 if( showInfo ) 165 165 { 166 tr_info_t * info = tr_torrentInfo( tor );166 const tr_info_t * info = tr_torrentInfo( tor ); 167 167 168 168 s = tr_torrentStat( tor ); -
trunk/daemon/server.c
r2227 r2245 444 444 size_t buflen; 445 445 uint8_t * buf; 446 tr_info_t * inf;447 446 448 447 if( NULL == val || TYPE_LIST != val->type ) … … 471 470 if( TORRENT_ID_VALID( tor ) ) 472 471 { 473 inf = torrent_info( tor );472 const tr_info_t * inf = torrent_info( tor ); 474 473 if( 0 > ipc_addinfo( added, tor, inf, 0 ) ) 475 474 { … … 497 496 uint8_t * buf; 498 497 const char * dir; 499 tr_info_t * inf;500 498 501 499 if( NULL == dict || TYPE_DICT != dict->type ) … … 531 529 if( TORRENT_ID_VALID( tor ) ) 532 530 { 531 const tr_info_t * inf; 533 532 val = ipc_initval( client->ipc, IPC_MSG_INFO, tag, &pk, TYPE_LIST ); 534 533 if( NULL == val ) … … 750 749 addinfo( benc_val_t * list, int id, int types ) 751 750 { 752 tr_info_t * inf; 753 754 inf = torrent_info( id ); 755 if( NULL == inf ) 756 { 757 return 0; 758 } 759 760 return ipc_addinfo( list, id, inf, types ); 751 const tr_info_t * inf = torrent_info( id ); 752 return inf ? ipc_addinfo( list, id, inf, types ) : 0; 761 753 } 762 754 … … 764 756 addstat( benc_val_t * list, int id, int types ) 765 757 { 766 tr_stat_t * st; 767 768 st = torrent_stat( id ); 769 if( NULL == st ) 770 { 771 return 0; 772 } 773 774 return ipc_addstat( list, id, st, types ); 758 const tr_stat_t * st = torrent_stat( id ); 759 return st ? ipc_addstat( list, id, st, types ) : 0; 775 760 } 776 761 … … 850 835 benc_val_t * hash, pk, * pkinf; 851 836 int64_t found; 852 tr_info_t * inf;853 837 854 838 if( NULL == val || TYPE_LIST != val->type ) … … 868 852 for( ii = 0; val->val.l.count > ii; ii++ ) 869 853 { 854 const tr_info_t * inf; 870 855 hash = &val->val.l.vals[ii]; 871 856 if( NULL == hash || TYPE_STR != hash->type || -
trunk/daemon/torrents.c
r2206 r2245 238 238 } 239 239 240 tr_info_t *240 const tr_info_t * 241 241 torrent_info( int id ) 242 242 { … … 255 255 } 256 256 257 tr_stat_t *257 const tr_stat_t * 258 258 torrent_stat( int id ) 259 259 { … … 476 476 struct tor * tor, * found; 477 477 int errcode; 478 tr_info_t * inf;478 const tr_info_t * inf; 479 479 480 480 assert( ( NULL != path && NULL == hash && NULL == data ) || … … 793 793 benc_val_t top, * list, * tor; 794 794 struct tor * ii; 795 tr_info_t * inf;796 tr_stat_t * st;797 795 uint8_t * buf; 798 796 int len, pexset; … … 829 827 RB_FOREACH( ii, tortree, &gl_tree ) 830 828 { 829 const tr_info_t * inf; 830 const tr_stat_t * st; 831 831 tor = tr_bencListAdd( list ); 832 832 assert( NULL != tor ); -
trunk/daemon/torrents.h
r1635 r2245 39 39 void torrent_stop ( int ); 40 40 void torrent_remove ( int ); 41 tr_info_t * torrent_info( int );42 tr_stat_t * torrent_stat( int );41 const tr_info_t * torrent_info ( int ); 42 const tr_stat_t * torrent_stat ( int ); 43 43 int torrent_lookup ( const uint8_t * ); 44 44 void * torrent_iter ( void *, int * ); -
trunk/gtk/ipc.c
r2227 r2245 808 808 if( IPC_MSG_INFO == msgid ) 809 809 { 810 tr_info_t * inf = tr_torrent_info( tor );810 const tr_info_t * inf = tr_torrent_info( tor ); 811 811 return ipc_addinfo( val, torid, inf, types ); 812 812 } … … 827 827 int ii, torid; 828 828 TrTorrent * tor; 829 tr_info_t* inf;829 const tr_info_t * inf; 830 830 uint8_t * buf; 831 831 size_t size; -
trunk/gtk/torrent-inspector.c
r2170 r2245 1257 1257 GtkWidget * ret; 1258 1258 FileData * data; 1259 tr_info_t* inf;1259 const tr_info_t * inf; 1260 1260 tr_torrent_t * tor; 1261 1261 GtkTreeStore * store; -
trunk/gtk/tr_core.c
r2208 r2245 570 570 { 571 571 GtkTreeIter iter; 572 tr_info_t * inf;572 const tr_info_t * inf; 573 573 574 574 gtk_list_store_append( GTK_LIST_STORE( self->model ), &iter ); -
trunk/gtk/tr_torrent.c
r2221 r2245 257 257 } 258 258 259 tr_info_t *259 const tr_info_t * 260 260 tr_torrent_info(TrTorrent *tor) { 261 261 TR_IS_TORRENT(tor); … … 465 465 tr_torrent_get_state( TrTorrent * tor, benc_val_t * state ) 466 466 { 467 tr_info_t * inf;467 const tr_info_t * inf; 468 468 469 469 TR_IS_TORRENT( tor ); -
trunk/gtk/tr_torrent.h
r2202 r2245 86 86 tr_torrent_stat(TrTorrent *tor); 87 87 88 tr_info_t *88 const tr_info_t * 89 89 tr_torrent_info(TrTorrent *tor); 90 90 -
trunk/libtransmission/ipcparse.c
r2227 r2245 585 585 586 586 int 587 ipc_addinfo( benc_val_t * list, int tor, tr_info_t * inf, int types )587 ipc_addinfo( benc_val_t * list, int tor, const tr_info_t * inf, int types ) 588 588 { 589 589 benc_val_t * dict, * item, * file, * tier; -
trunk/libtransmission/ipcparse.h
r2227 r2245 159 159 uint8_t * ipc_mkgetinfo( struct ipc_info *, size_t *, enum ipc_msg, int64_t, 160 160 int, const int * ); 161 int ipc_addinfo ( benc_val_t *, int, tr_info_t *, int );161 int ipc_addinfo ( benc_val_t *, int, const tr_info_t *, int ); 162 162 int ipc_addstat ( benc_val_t *, int, const tr_stat_t *, int ); 163 163 -
trunk/libtransmission/torrent.c
r2243 r2245 416 416 } 417 417 418 tr_info_t * tr_torrentInfo( tr_torrent_t * tor ) 418 const tr_info_t * 419 tr_torrentInfo( const tr_torrent_t * tor ) 419 420 { 420 421 return &tor->info; -
trunk/libtransmission/transmission.h
r2222 r2245 340 340 * Return torrent metainfo. 341 341 **********************************************************************/ 342 tr_info_t * tr_torrentInfo(tr_torrent_t * );342 const tr_info_t * tr_torrentInfo( const tr_torrent_t * ); 343 343 344 344 /***********************************************************************
Note: See TracChangeset
for help on using the changeset viewer.