Changeset 6961
- Timestamp:
- Oct 26, 2008, 3:39:04 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/fdlimit.c
r6924 r6961 53 53 #include "utils.h" 54 54 55 #define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ) 55 #define dbgmsg( ... ) \ 56 do { \ 57 if( tr_deepLoggingIsActive( ) ) \ 58 tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ); \ 59 } while( 0 ) 56 60 57 61 /** -
trunk/libtransmission/handshake.c
r6894 r6961 135 135 **/ 136 136 137 #define dbgmsg( handshake, ... ) tr_deepLog(\ 138 __FILE__, __LINE__, tr_peerIoGetAddrStr( handshake->io ), __VA_ARGS__ ) 137 #define dbgmsg( handshake, ... ) \ 138 do { \ 139 if( tr_deepLoggingIsActive( ) ) \ 140 tr_deepLog( __FILE__, __LINE__, tr_peerIoGetAddrStr( handshake->io ), __VA_ARGS__ ); \ 141 } while( 0 ) 139 142 140 143 static const char* -
trunk/libtransmission/peer-io.c
r6906 r6961 41 41 42 42 #define dbgmsg( io, ... ) \ 43 tr_deepLog( __FILE__, __LINE__, tr_peerIoGetAddrStr( io ), __VA_ARGS__ ) 43 do { \ 44 if( tr_deepLoggingIsActive( ) ) \ 45 tr_deepLog( __FILE__, __LINE__, tr_peerIoGetAddrStr( io ), __VA_ARGS__ ); \ 46 } while( 0 ) 44 47 45 48 struct tr_bandwidth -
trunk/libtransmission/peer-mgr.c
r6957 r6961 133 133 134 134 #define tordbg( t, ... ) \ 135 tr_deepLog( __FILE__, __LINE__, t->tor->info.name, __VA_ARGS__ ) 135 do { \ 136 if( tr_deepLoggingIsActive( ) ) \ 137 tr_deepLog( __FILE__, __LINE__, t->tor->info.name, __VA_ARGS__ ); \ 138 } while( 0 ) 136 139 137 140 #define dbgmsg( ... ) \ 138 tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ) 141 do { \ 142 if( tr_deepLoggingIsActive( ) ) \ 143 tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ); \ 144 } while( 0 ) 139 145 140 146 /** … … 864 870 865 871 assert( tr_torrentReqIsValid( tor, index, offset, length ) ); 866 assert( _tr_block( tor, index, offset ) == block );867 872 assert( offset < tr_torPieceCountBytes( tor, index ) ); 868 873 assert( (offset + length) <= tr_torPieceCountBytes( tor, index ) ); -
trunk/libtransmission/rpc-server.c
r6939 r6961 59 59 }; 60 60 61 #define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, MY_NAME, __VA_ARGS__ ) 61 #define dbgmsg( ... ) \ 62 do { \ 63 if( tr_deepLoggingIsActive( ) ) \ 64 tr_deepLog( __FILE__, __LINE__, MY_NAME, __VA_ARGS__ ); \ 65 } while( 0 ) 66 62 67 63 68 /** -
trunk/libtransmission/session.c
r6946 r6961 574 574 #define SHUTDOWN_MAX_SECONDS 30 575 575 576 #define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ) 576 #define dbgmsg( ... ) \ 577 do { \ 578 if( tr_deepLoggingIsActive( ) ) \ 579 tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ); \ 580 } while( 0 ) 577 581 578 582 void -
trunk/libtransmission/torrent.h
r6935 r6961 121 121 uint32_t length ); 122 122 123 void tr_torrentInitFilePriority( tr_torrent *tor,124 tr_file_index_t fileIndex,125 tr_priority_t priority );123 void tr_torrentInitFilePriority( tr_torrent * tor, 124 tr_file_index_t fileIndex, 125 tr_priority_t priority ); 126 126 127 127 128 128 int tr_torrentCountUncheckedPieces( const tr_torrent * ); 129 129 130 int tr_torrentIsPieceChecked( const tr_torrent *, 131 tr_piece_index_t piece ); 132 133 int tr_torrentIsFileChecked( const tr_torrent *, 134 tr_file_index_t file ); 135 136 void tr_torrentSetPieceChecked( 137 tr_torrent *, 138 tr_piece_index_t piece, 139 int isChecked ); 140 141 void tr_torrentSetFileChecked( 142 tr_torrent *, 143 tr_file_index_t 144 file, 145 int 146 isChecked ); 147 148 void tr_torrentUncheck( tr_torrent * ); 149 150 int tr_torrentPromoteTracker( tr_torrent *, 151 int trackerIndex ); 152 153 time_t* tr_torrentGetMTimes( const tr_torrent *, 154 size_t * setmeCount ); 130 int tr_torrentIsPieceChecked( const tr_torrent * tor, 131 tr_piece_index_t piece ); 132 133 int tr_torrentIsFileChecked( const tr_torrent * tor, 134 tr_file_index_t file ); 135 136 void tr_torrentSetPieceChecked( tr_torrent * tor, 137 tr_piece_index_t piece, 138 int isChecked ); 139 140 void tr_torrentSetFileChecked( tr_torrent * tor, 141 tr_file_index_t file, 142 int isChecked ); 143 144 void tr_torrentUncheck( tr_torrent * tor ); 145 146 int tr_torrentPromoteTracker( tr_torrent * tor, 147 int trackerIndex ); 148 149 time_t* tr_torrentGetMTimes( const tr_torrent * tor, 150 size_t * setmeCount ); 155 151 156 152 typedef enum -
trunk/libtransmission/tracker.c
r6910 r6961 125 125 }; 126 126 127 #define dbgmsg( name, ... ) tr_deepLog( __FILE__, __LINE__, name, __VA_ARGS__ ) 127 #define dbgmsg( name, ... ) \ 128 do { \ 129 if( tr_deepLoggingIsActive( ) ) \ 130 tr_deepLog( __FILE__, __LINE__, name, __VA_ARGS__ ); \ 131 } while( 0 ) 128 132 129 133 /*** -
trunk/libtransmission/trevent.c
r6930 r6961 147 147 }; 148 148 149 #define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, "event", __VA_ARGS__ ) 149 #define dbgmsg( ... ) \ 150 do { \ 151 if( tr_deepLoggingIsActive( ) ) \ 152 tr_deepLog( __FILE__, __LINE__, "event", __VA_ARGS__ ); \ 153 } while( 0 ) 150 154 151 155 static void -
trunk/libtransmission/utils.c
r6941 r6961 210 210 } 211 211 212 void 213 tr_deepLog( const char * file, 214 int line, 215 const char * name, 216 const char * fmt, 212 int 213 tr_deepLoggingIsActive( void ) 214 { 215 return IsDebuggerPresent() || (tr_getLog()!=NULL); 216 } 217 218 void 219 tr_deepLog( const char * file, 220 int line, 221 const char * name, 222 const char * fmt, 217 223 ... ) 218 224 { -
trunk/libtransmission/utils.h
r6949 r6961 133 133 134 134 FILE* tr_getLog( void ); 135 136 int tr_deepLoggingIsActive( void ); 135 137 136 138 void tr_deepLog( const char * file, -
trunk/libtransmission/web.c
r6937 r6961 30 30 #define DEFAULT_TIMER_MSEC 2000 31 31 32 #define dbgmsg( ... ) tr_deepLog( __FILE__, __LINE__, "web", __VA_ARGS__ ) 32 #define dbgmsg( ... ) \ 33 do { \ 34 if( tr_deepLoggingIsActive( ) ) \ 35 tr_deepLog( __FILE__, __LINE__, "web", __VA_ARGS__ ); \ 36 } while( 0 ) 33 37 /* #define dbgmsg(...) \ 34 38 do { fprintf( stderr, __VA_ARGS__ ); fprintf( stderr, "\n" ); } while( 0 ) */
Note: See TracChangeset
for help on using the changeset viewer.