Changeset 5
- Timestamp:
- Jan 12, 2006, 6:32:29 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jamfile
r3 r5 45 45 Depends package : Transmission-$(VERSION_STRING)-OSX.dmg ; 46 46 } 47 else if $(GTK) = yes 48 { 49 SubInclude TOP gtk ; 50 } 47 51 48 52 SubInclude TOP libtransmission ; -
trunk/configure
r2 r5 11 11 --disable-openssl Disable OpenSSL, use built-in SHA1 implementation 12 12 --openssl-prefix=PATH Location of OpenSSL headers and library 13 --disable-gtk Don't build the GTK+ GUI 13 14 14 15 Some influential environment variables: … … 43 44 } 44 45 46 gtk_test() 47 { 48 cat > testconf.c << EOF 49 #include <gtk/gtk.h> 50 int main() 51 { 52 gtk_main(); 53 } 54 EOF 55 if $CC `pkg-config gtk+-2.0 --cflags --libs 2>/dev/null` -o testconf testconf.c 56 then 57 echo "GTK+: yes" 58 GTK=yes 59 GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags` 60 GTKLINKLIBS=`pkg-config gtk+-2.0 --libs` 61 else 62 echo "GTK+: no" 63 GTK=no 64 fi 65 rm -f testconf.c testconf 66 } 67 45 68 # 46 69 # Defaults settings … … 53 76 DEFINES="$DEFINES _GNU_SOURCE" 54 77 openssl_disable=0 78 gtk_disable=0 79 GTK=no 80 GTKCCFLAGS= 81 GTKLINKLIBS= 55 82 56 83 # … … 66 93 x--openssl-prefix=*) 67 94 OPENSSL_PREFIX="$param"; 95 ;; 96 x--disable-gtk) 97 gtk_disable="1"; 68 98 ;; 69 99 x--help) … … 126 156 echo "System: $SYSTEM" 127 157 158 # Check for GTK 159 if pkg-config gtk+-2.0 160 then 161 echo "GTK+: yes" 162 GTK=yes 163 GTKCCFLAGS=`pkg-config gtk+-2.0 --cflags` 164 GTKLINKLIBS=`pkg-config gtk+-2.0 --libs` 165 else 166 echo "GTK+: no" 167 GTK=no 168 fi 169 128 170 # 129 171 # OpenSSL settings … … 136 178 137 179 # 180 # GTK settings 181 # 182 if [ ${gtk_disable} = 1 ]; then 183 echo "GTK+: no" 184 else 185 gtk_test 186 fi 187 188 # 138 189 # Generate config.jam 139 190 # 140 191 rm -f config.jam 141 192 cat > config.jam << EOF 142 CC = $CC ; 143 LINK = $CC ; 144 CCFLAGS = $CFLAGS ; 145 DEFINES = $DEFINES ; 146 LINKLIBS = $LINKLIBS ; 193 CC = $CC ; 194 LINK = $CC ; 195 CCFLAGS = $CFLAGS ; 196 DEFINES = $DEFINES ; 197 LINKLIBS = $LINKLIBS ; 198 GTK = $GTK ; 199 GTKCCFLAGS = $GTKCCFLAGS ; 200 GTKLINKLIBS = $GTKLINKLIBS ; 147 201 EOF 148 202 if [ -n "$OPENSSL_PREFIX" ]; then 149 203 cat >> config.jam << EOF 150 HDRS += $OPENSSL_PREFIX/include ;151 LINKFLAGS += -L$OPENSSL_PREFIX/lib ;204 HDRS += $OPENSSL_PREFIX/include ; 205 LINKFLAGS += -L$OPENSSL_PREFIX/lib ; 152 206 EOF 153 207 fi -
trunk/libtransmission/completion.c
r3 r5 26 26 { 27 27 tr_completion_t * cp; 28 int i; 29 30 cp = calloc( 1, sizeof( tr_completion_t ) ); 28 29 cp = malloc( sizeof( tr_completion_t ) ); 31 30 cp->tor = tor; 32 cp->blockBitfield = calloc( 1, ( tor->blockCount + 7 ) / 8 ); 33 cp->blockDownloaders = calloc( 1, tor->blockCount ); 34 cp->pieceBitfield = calloc( 1, ( tor->info.pieceCount + 7 ) / 8 ); 35 cp->missingBlocks = calloc( 1, tor->info.pieceCount * sizeof( int ) ); 36 37 for( i = 0; i < tor->info.pieceCount; i++ ) 38 { 39 cp->missingBlocks[i] = tr_pieceCountBlocks( i ); 40 } 31 cp->blockBitfield = malloc( ( tor->blockCount + 7 ) / 8 ); 32 cp->blockDownloaders = malloc( tor->blockCount ); 33 cp->pieceBitfield = malloc( ( tor->info.pieceCount + 7 ) / 8 ); 34 cp->missingBlocks = malloc( tor->info.pieceCount * sizeof( int ) ); 35 36 tr_cpReset( cp ); 41 37 42 38 return cp; … … 50 46 free( cp->missingBlocks ); 51 47 free( cp ); 48 } 49 50 void tr_cpReset( tr_completion_t * cp ) 51 { 52 tr_torrent_t * tor = cp->tor; 53 int i; 54 55 cp->blockCount = 0; 56 memset( cp->blockBitfield, 0, ( tor->blockCount + 7 ) / 8 ); 57 memset( cp->blockDownloaders, 0, tor->blockCount ); 58 memset( cp->pieceBitfield, 0, ( tor->info.pieceCount + 7 ) / 8 ); 59 for( i = 0; i < tor->info.pieceCount; i++ ) 60 { 61 cp->missingBlocks[i] = tr_pieceCountBlocks( i ); 62 } 52 63 } 53 64 -
trunk/libtransmission/completion.h
r3 r5 33 33 tr_completion_t * tr_cpInit( tr_torrent_t * ); 34 34 void tr_cpClose( tr_completion_t * ); 35 void tr_cpReset( tr_completion_t * ); 35 36 36 37 /* General */ -
trunk/libtransmission/transmission.c
r3 r5 482 482 tr_lockLock( tor->lock ); 483 483 484 tr_cpReset( tor->completion ); 484 485 tor->io = tr_ioInit( tor ); 485 486 tor->status = tr_cpIsSeeding( tor->completion ) ?
Note: See TracChangeset
for help on using the changeset viewer.