Changeset 1576
- Timestamp:
- Mar 22, 2007, 6:07:22 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/beos/TRWindow.cpp
r1564 r1576 161 161 // Try adding the torrent to the engine. 162 162 int error; 163 tr_torrent_t *nTorrent = tr_torrentInit(engine, path.Path(), 0, &error);163 tr_torrent_t *nTorrent = tr_torrentInit(engine, path.Path(), NULL, 0, &error); 164 164 if (nTorrent != NULL && Lock()) { // Success. Add the TRTorrent item. 165 165 transfers->AddItem(new TRTransfer(path.Path(), node, nTorrent)); -
trunk/cli/transmissioncli.c
r1564 r1576 127 127 128 128 /* Open and parse torrent file */ 129 if( !( tor = tr_torrentInit( h, torrentPath, 0, &error ) ) )129 if( !( tor = tr_torrentInit( h, torrentPath, NULL, 0, &error ) ) ) 130 130 { 131 131 printf( "Failed opening torrent file `%s'\n", torrentPath ); -
trunk/gtk/tr_torrent.c
r1504 r1576 279 279 handle = tr_torrentInitSaved(back, torrent, 0, &errcode); 280 280 else 281 handle = tr_torrentInit(back, torrent, trflags, &errcode);281 handle = tr_torrentInit(back, torrent, NULL, trflags, &errcode); 282 282 283 283 if(NULL == handle) { -
trunk/libtransmission/torrent.c
r1564 r1576 30 30 **********************************************************************/ 31 31 static tr_torrent_t * torrentRealInit( tr_handle_t *, tr_torrent_t * tor, 32 int flags, int * error );32 uint8_t *, int flags, int * error ); 33 33 static void torrentReallyStop( tr_torrent_t * ); 34 34 static void downloadLoop( void * ); … … 55 55 56 56 tr_torrent_t * tr_torrentInit( tr_handle_t * h, const char * path, 57 int flags, int * error )57 uint8_t * hash, int flags, int * error ) 58 58 { 59 59 tr_torrent_t * tor = calloc( sizeof( tr_torrent_t ), 1 ); … … 68 68 } 69 69 70 return torrentRealInit( h, tor, flags, error );70 return torrentRealInit( h, tor, hash, flags, error ); 71 71 } 72 72 … … 84 84 } 85 85 86 return torrentRealInit( h, tor, ( TR_FLAG_SAVE | flags ), error );86 return torrentRealInit( h, tor, NULL, ( TR_FLAG_SAVE | flags ), error ); 87 87 } 88 88 … … 94 94 **********************************************************************/ 95 95 static tr_torrent_t * torrentRealInit( tr_handle_t * h, tr_torrent_t * tor, 96 int flags, int * error )96 uint8_t * hash, int flags, int * error ) 97 97 { 98 98 tr_torrent_t * tor_tmp; … … 111 111 SHA_DIGEST_LENGTH ) ) 112 112 { 113 if( NULL != hash ) 114 { 115 memcpy( hash, tor->info.hash, SHA_DIGEST_LENGTH ); 116 } 113 117 *error = TR_EDUPLICATE; 114 118 tr_metainfoFree( &tor->info ); -
trunk/libtransmission/transmission.h
r1564 r1576 194 194 * tr_torrentInit 195 195 *********************************************************************** 196 * Opens and parses torrent file at 'path'. If the file exists and is a197 * valid torrent file, returns an handle and adds it to the list of196 * Opens and parses torrent file at 'path'. If the file exists and is 197 * a valid torrent file, returns an handle and adds it to the list of 198 198 * torrents (but doesn't start it). Returns NULL and sets *error 199 * otherwise. If the TR_FLAG_SAVE flag is passed then a copy of the 200 * torrent file will be saved. 199 * otherwise. If hash is not NULL and the torrent is already loaded 200 * then it's 20-byte hash will be copied in. If the TR_FLAG_SAVE flag 201 * is passed then a copy of the torrent file will be saved. 201 202 **********************************************************************/ 202 203 #define TR_EINVALID 1 … … 205 206 #define TR_EOTHER 666 206 207 tr_torrent_t * tr_torrentInit( tr_handle_t *, const char * path, 207 int flags, int * error );208 uint8_t * hash, int flags, int * error ); 208 209 209 210 /*********************************************************************** … … 211 212 *********************************************************************** 212 213 * Opens and parses a torrent file as with tr_torrentInit, only taking 213 * the hash string of a saved torrent file instead of a filename. 214 * the hash string of a saved torrent file instead of a filename. There 214 215 * are currently no valid flags for this function. 215 216 **********************************************************************/ -
trunk/macosx/Controller.m
r1565 r1576 703 703 704 704 torrentPath = [[files objectAtIndex: 0] retain]; 705 tempTor = tr_torrentInit(fLib, [torrentPath UTF8String], 0, &error);705 tempTor = tr_torrentInit(fLib, [torrentPath UTF8String], NULL, 0, &error); 706 706 707 707 [files removeObjectAtIndex: 0]; … … 1818 1818 while ((file = [enumerator nextObject])) 1819 1819 { 1820 tr_torrent_t * tempTor = tr_torrentInit(fLib, [file UTF8String], 0, &error);1820 tr_torrent_t * tempTor = tr_torrentInit(fLib, [file UTF8String], NULL, 0, &error); 1821 1821 1822 1822 if (tempTor) -
trunk/macosx/Torrent.m
r1575 r1576 1221 1221 1222 1222 if (!fHandle && path) 1223 fHandle = tr_torrentInit(fLib, [path UTF8String], TR_FLAG_SAVE, & error);1223 fHandle = tr_torrentInit(fLib, [path UTF8String], NULL, TR_FLAG_SAVE, & error); 1224 1224 1225 1225 if (!fHandle)
Note: See TracChangeset
for help on using the changeset viewer.