remove the backwards compatability typedefs at BentMyWookie's suggestion. update libT, gtk, daemon, and cli accordingly...

This commit is contained in:
Charles Kerr 2007-09-20 20:14:13 +00:00
parent 2ad52ebd39
commit fb70a9cca0
27 changed files with 243 additions and 291 deletions

View File

@ -84,7 +84,7 @@ static int downloadLimit = -1;
static char * torrentPath = NULL;
static int natTraversal = 0;
static sig_atomic_t gotsig = 0;
static tr_torrent_t * tor;
static tr_torrent * tor;
static char * finishCall = NULL;
static char * announce = NULL;
@ -109,9 +109,9 @@ char * getStringRatio( float ratio )
int main( int argc, char ** argv )
{
int i, error;
tr_handle_t * h;
const tr_stat_t * s;
tr_handle_status_t * hstat;
tr_handle * h;
const tr_stat * s;
tr_handle_status * hstat;
printf( "Transmission %s - http://transmission.m0k.org/\n\n",
LONG_VERSION_STRING );
@ -156,7 +156,7 @@ int main( int argc, char ** argv )
if( sourceFile && *sourceFile ) /* creating a torrent */
{
int ret;
tr_metainfo_builder_t* builder = tr_metaInfoBuilderCreate( h, sourceFile );
tr_metainfo_builder * builder = tr_metaInfoBuilderCreate( h, sourceFile );
tr_makeMetaInfo( builder, torrentPath, announce, comment, isPrivate );
while( !builder->isDone ) {
wait_msecs( 1 );
@ -177,7 +177,7 @@ int main( int argc, char ** argv )
if( showInfo )
{
const tr_info_t * info = tr_torrentInfo( tor );
const tr_info * info = tr_torrentInfo( tor );
s = tr_torrentStat( tor );

View File

@ -485,7 +485,7 @@ addmsg1( enum ipc_msg id UNUSED, benc_val_t * val, int64_t tag, void * arg )
tor = torrent_add_file( file->val.s.s, NULL, -1 );
if( TORRENT_ID_VALID( tor ) )
{
const tr_info_t * inf = torrent_info( tor );
const tr_info * inf = torrent_info( tor );
if( 0 > ipc_addinfo( added, tor, inf, 0 ) )
{
errnomsg( "failed to build message" );
@ -544,7 +544,7 @@ addmsg2( enum ipc_msg id UNUSED, benc_val_t * dict, int64_t tag, void * arg )
if( TORRENT_ID_VALID( tor ) )
{
const tr_info_t * inf;
const tr_info * inf;
val = ipc_initval( client->ipc, IPC_MSG_INFO, tag, &pk, TYPE_LIST );
if( NULL == val )
{
@ -755,14 +755,14 @@ infomsg( enum ipc_msg id, benc_val_t * val, int64_t tag, void * arg )
int
addinfo( benc_val_t * list, int id, int types )
{
const tr_info_t * inf = torrent_info( id );
const tr_info * inf = torrent_info( id );
return inf ? ipc_addinfo( list, id, inf, types ) : 0;
}
int
addstat( benc_val_t * list, int id, int types )
{
const tr_stat_t * st = torrent_stat( id );
const tr_stat * st = torrent_stat( id );
return st ? ipc_addstat( list, id, st, types ) : 0;
}
@ -862,7 +862,7 @@ lookmsg( enum ipc_msg id UNUSED, benc_val_t * val, int64_t tag, void * arg )
for( ii = 0; val->val.l.count > ii; ii++ )
{
const tr_info_t * inf;
const tr_info * inf;
hash = &val->val.l.vals[ii];
if( NULL == hash || TYPE_STR != hash->type ||
SHA_DIGEST_LENGTH * 2 != hash->val.s.i )

View File

@ -56,7 +56,7 @@ struct tor
{
int id;
uint8_t hash[SHA_DIGEST_LENGTH];
tr_torrent_t * tor;
tr_torrent * tor;
int pexset;
int pex;
RB_ENTRY( tor ) idlinks;
@ -80,7 +80,7 @@ static struct tor * hashlookup ( const uint8_t * );
static struct tor * iterate ( struct tor * );
static struct event_base * gl_base = NULL;
static tr_handle_t * gl_handle = NULL;
static tr_handle * gl_handle = NULL;
static struct tortree gl_tree = RB_INITIALIZER( &gl_tree );
static struct hashtree gl_hashes = RB_INITIALIZER( &gl_hashes );
static int gl_lastid = 0;
@ -185,7 +185,7 @@ torrent_start( int id )
tor = idlookup( id );
if( tor != NULL )
{
const tr_stat_t * st = tr_torrentStat( tor->tor );
const tr_stat * st = tr_torrentStat( tor->tor );
if( TR_STATUS_INACTIVE & st->status )
{
@ -207,7 +207,7 @@ torrent_stop( int id )
tor = idlookup( id );
if( tor != NULL )
{
const tr_stat_t * st = tr_torrentStat( tor->tor );
const tr_stat * st = tr_torrentStat( tor->tor );
if( TR_STATUS_ACTIVE & st->status )
{
@ -233,7 +233,7 @@ torrent_remove( int id )
}
}
const tr_info_t *
const tr_info *
torrent_info( int id )
{
struct tor * tor;
@ -250,7 +250,7 @@ torrent_info( int id )
return tr_torrentInfo( tor->tor );
}
const tr_stat_t *
const tr_stat *
torrent_stat( int id )
{
struct tor * tor;
@ -473,7 +473,7 @@ opentor( const char * path, const char * hash, uint8_t * data, size_t size,
{
struct tor * tor, * found;
int errcode;
const tr_info_t * inf;
const tr_info * inf;
assert( ( NULL != path && NULL == hash && NULL == data ) ||
( NULL == path && NULL != hash && NULL == data ) ||
@ -623,10 +623,10 @@ starttimer( int callnow )
static void
timerfunc( int fd UNUSED, short event UNUSED, void * arg UNUSED )
{
struct tor * tor, * next;
tr_handle_status_t * hs;
int stillmore;
struct timeval tv;
struct tor * tor, * next;
tr_handle_status * hs;
int stillmore;
struct timeval tv;
/* true if we've still got live torrents... */
stillmore = tr_torrentCount( gl_handle ) != 0;
@ -827,8 +827,8 @@ savestate( void )
RB_FOREACH( ii, tortree, &gl_tree )
{
const tr_info_t * inf;
const tr_stat_t * st;
const tr_info * inf;
const tr_stat * st;
tor = tr_bencListAdd( list );
assert( NULL != tor );
tr_bencInit( tor, TYPE_DICT );

View File

@ -37,8 +37,8 @@ int torrent_add_data ( uint8_t *, size_t, const char *, int
void torrent_start ( int );
void torrent_stop ( int );
void torrent_remove ( int );
const tr_info_t * torrent_info ( int );
const tr_stat_t * torrent_stat ( int );
const tr_info * torrent_info ( int );
const tr_stat * torrent_stat ( int );
int torrent_lookup ( const uint8_t * );
void * torrent_iter ( void *, int * );

View File

@ -80,7 +80,7 @@ struct infowind
guint timer;
struct
{
tr_tracker_info_t * track;
tr_tracker_info * track;
GtkLabel * trackwid;
GtkLabel * annwid;
GtkLabel * scrwid;

View File

@ -817,12 +817,12 @@ addinfo( TrTorrent * tor, enum ipc_msg msgid, int torid, int types,
{
if( IPC_MSG_INFO == msgid )
{
const tr_info_t * inf = tr_torrent_info( tor );
const tr_info * inf = tr_torrent_info( tor );
return ipc_addinfo( val, torid, inf, types );
}
else
{
const tr_stat_t * st = tr_torrent_stat( tor );
const tr_stat * st = tr_torrent_stat( tor );
return ipc_addstat( val, torid, st, types );
}
}
@ -836,7 +836,7 @@ smsg_look( enum ipc_msg id SHUTUP, benc_val_t * val, int64_t tag,
benc_val_t packet, * pkval, * hash;
int ii, torid;
TrTorrent * tor;
const tr_info_t * inf;
const tr_info * inf;
uint8_t * buf;
size_t size;
@ -981,7 +981,7 @@ smsg_pref( enum ipc_msg id, benc_val_t * val SHUTUP, int64_t tag, void * arg )
struct constate_serv * srv = &con->u.serv;
uint8_t * buf;
size_t size;
tr_handle_status_t * hstat;
tr_handle_status * hstat;
const char * pref;
int num;

View File

@ -158,7 +158,7 @@ readinitialprefs( struct cbdata * cbdata );
static void
prefschanged( TrCore * core, int id, gpointer data );
static void
setpex( tr_torrent_t * tor, void * arg );
setpex( tr_torrent * tor, void * arg );
static gboolean
updatemodel(gpointer gdata);
static void
@ -767,7 +767,7 @@ static void
prefschanged( TrCore * core SHUTUP, int id, gpointer data )
{
struct cbdata * cbdata = data;
tr_handle_t * tr = tr_core_handle( cbdata->core );
tr_handle * tr = tr_core_handle( cbdata->core );
gboolean boolval;
switch( id )
@ -829,7 +829,7 @@ g_message ("foo");
}
void
setpex( tr_torrent_t * tor, void * arg )
setpex( tr_torrent * tor, void * arg )
{
gboolean * val;

View File

@ -35,8 +35,8 @@ typedef struct
GtkWidget * private_check;
GtkWidget * dialog;
GtkWidget * progress_dialog;
tr_metainfo_builder_t * builder;
tr_handle_t * handle;
tr_metainfo_builder * builder;
tr_handle * handle;
}
MakeMetaUI;
@ -217,7 +217,7 @@ file_chooser_shown_cb( GtkWidget *w, gpointer folder_toggle )
}
GtkWidget*
make_meta_ui( GtkWindow * parent, tr_handle_t * handle )
make_meta_ui( GtkWindow * parent, tr_handle * handle )
{
int row = 0;
GtkWidget *d, *t, *w, *h, *rb_file, *rb_dir;

View File

@ -16,6 +16,6 @@
#include <gtk/gtk.h>
#include <libtransmission/transmission.h>
GtkWidget* make_meta_ui( GtkWindow * parent, tr_handle_t * handle );
GtkWidget* make_meta_ui( GtkWindow * parent, tr_handle * handle );
#endif

View File

@ -90,7 +90,7 @@ debug_window_text_buffer_new ( void )
void
msgwin_update( void )
{
tr_msg_list_t * msgs, * ii;
tr_msg_list * msgs, * ii;
g_assert( textbuf != NULL );

View File

@ -78,8 +78,8 @@ release_gobject_array (gpointer data)
static gboolean
refresh_pieces (GtkWidget * da, GdkEventExpose * event UNUSED, gpointer gtor)
{
tr_torrent_t * tor = tr_torrent_handle( TR_TORRENT(gtor) );
const tr_info_t * info = tr_torrent_info( TR_TORRENT(gtor) );
tr_torrent * tor = tr_torrent_handle( TR_TORRENT(gtor) );
const tr_info * info = tr_torrent_info( TR_TORRENT(gtor) );
int mode = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(da), "draw-mode"));
GdkColormap * colormap = gtk_widget_get_colormap (da);
@ -261,21 +261,21 @@ static const char* peer_column_names[N_PEER_COLS] =
static int compare_peers (const void * a, const void * b)
{
const tr_peer_stat_t * pa = (const tr_peer_stat_t *) a;
const tr_peer_stat_t * pb = (const tr_peer_stat_t *) b;
const tr_peer_stat * pa = a;
const tr_peer_stat * pb = b;
return strcmp (pa->addr, pb->addr);
}
static int compare_addr_to_peer (const void * a, const void * b)
{
const char * addr = (const char *) a;
const tr_peer_stat_t * peer = (const tr_peer_stat_t *) b;
const tr_peer_stat * peer = b;
return strcmp (addr, peer->addr);
}
static void
peer_row_set (GtkTreeStore * store,
GtkTreeIter * iter,
const tr_peer_stat_t * peer)
peer_row_set (GtkTreeStore * store,
GtkTreeIter * iter,
const tr_peer_stat * peer)
{
const char * client = peer->client;
@ -297,9 +297,9 @@ peer_row_set (GtkTreeStore * store,
}
static void
append_peers_to_model (GtkTreeStore * store,
const tr_peer_stat_t * peers,
int n_peers)
append_peers_to_model (GtkTreeStore * store,
const tr_peer_stat * peers,
int n_peers)
{
int i;
for (i=0; i<n_peers; ++i) {
@ -310,7 +310,7 @@ append_peers_to_model (GtkTreeStore * store,
}
static GtkTreeModel*
peer_model_new (tr_torrent_t * tor)
peer_model_new (tr_torrent * tor)
{
GtkTreeStore * m = gtk_tree_store_new (N_PEER_COLS,
G_TYPE_STRING, /* addr */
@ -325,8 +325,8 @@ peer_model_new (tr_torrent_t * tor)
G_TYPE_FLOAT); /* uploadToRate */
int n_peers = 0;
tr_peer_stat_t * peers = tr_torrentPeers (tor, &n_peers);
qsort (peers, n_peers, sizeof(tr_peer_stat_t), compare_peers);
tr_peer_stat * peers = tr_torrentPeers (tor, &n_peers);
qsort (peers, n_peers, sizeof(tr_peer_stat), compare_peers);
append_peers_to_model (m, peers, n_peers);
tr_torrentPeersFree( peers, 0 );
return GTK_TREE_MODEL (m);
@ -449,11 +449,11 @@ refresh_peers (GtkWidget * top)
int n_peers;
GtkTreeIter iter;
PeerData * p = (PeerData*) g_object_get_data (G_OBJECT(top), "peer-data");
tr_torrent_t * tor = tr_torrent_handle ( p->gtor );
tr_torrent * tor = tr_torrent_handle ( p->gtor );
GtkTreeModel * model = p->model;
GtkTreeStore * store = p->store;
tr_peer_stat_t * peers;
const tr_stat_t * stat = tr_torrent_stat( p->gtor );
tr_peer_stat * peers;
const tr_stat * stat = tr_torrent_stat( p->gtor );
/**
*** merge the peer diffs into the tree model.
@ -465,15 +465,15 @@ refresh_peers (GtkWidget * top)
n_peers = 0;
peers = tr_torrentPeers (tor, &n_peers);
qsort (peers, n_peers, sizeof(tr_peer_stat_t), compare_peers);
qsort (peers, n_peers, sizeof(tr_peer_stat), compare_peers);
i = 0;
if (gtk_tree_model_get_iter_first (model, &iter)) do
{
char * addr = NULL;
tr_peer_stat_t * peer = NULL;
tr_peer_stat * peer = NULL;
gtk_tree_model_get (model, &iter, PEER_COL_ADDRESS, &addr, -1);
peer = bsearch (addr, peers, n_peers, sizeof(tr_peer_stat_t),
peer = bsearch (addr, peers, n_peers, sizeof(tr_peer_stat),
compare_addr_to_peer);
g_free (addr);
@ -485,8 +485,8 @@ refresh_peers (GtkWidget * top)
peer_row_set (store, &iter, peer);
/* remove it from the tr_peer_stat_t list */
g_memmove (peer, peer+1, sizeof(tr_peer_stat_t)*n_rhs);
/* remove it from the tr_peer_stat list */
g_memmove (peer, peer+1, sizeof(tr_peer_stat)*n_rhs);
--n_peers;
}
else if (!gtk_tree_store_remove (store, &iter))
@ -511,7 +511,7 @@ static GtkWidget* peer_page_new ( TrTorrent * gtor )
guint i;
GtkTreeModel *m;
GtkWidget *h, *v, *w, *ret, *da, *sw, *l, *vbox, *hbox;
tr_torrent_t * tor = tr_torrent_handle (gtor);
tr_torrent * tor = tr_torrent_handle (gtor);
PeerData * p = g_new (PeerData, 1);
char name[64];
@ -714,7 +714,7 @@ static GtkWidget* peer_page_new ( TrTorrent * gtor )
***** INFO TAB
****/
static GtkWidget* info_page_new (tr_torrent_t * tor)
static GtkWidget* info_page_new (tr_torrent * tor)
{
int row = 0;
GtkWidget *t = hig_workarea_create ();
@ -725,8 +725,8 @@ static GtkWidget* info_page_new (tr_torrent_t * tor)
char name[128];
const char * namefmt = "%s:";
GtkTextBuffer * b;
tr_tracker_info_t * track;
const tr_info_t* info = tr_torrentInfo(tor);
tr_tracker_info * track;
const tr_info * info = tr_torrentInfo(tor);
hig_workarea_add_section_title (t, &row, _("Torrent Information"));
hig_workarea_add_section_spacer (t, row, 5);
@ -833,7 +833,7 @@ static void
refresh_activity (GtkWidget * top)
{
Activity * a = (Activity*) g_object_get_data (G_OBJECT(top), "activity-data");
const tr_stat_t * stat = tr_torrent_stat( a->gtor );
const tr_stat * stat = tr_torrent_stat( a->gtor );
guint64 size;
char *pch;
@ -1005,12 +1005,12 @@ stringToPriority( const char* str )
}
static void
parsepath( const tr_torrent_t * tor,
GtkTreeStore * store,
GtkTreeIter * ret,
const char * path,
int index,
uint64_t size )
parsepath( const tr_torrent * tor,
GtkTreeStore * store,
GtkTreeIter * ret,
const char * path,
int index,
uint64_t size )
{
GtkTreeModel * model;
GtkTreeIter * parent, start, iter;
@ -1117,7 +1117,7 @@ static void
updateprogress( GtkTreeModel * model,
GtkTreeStore * store,
GtkTreeIter * parent,
tr_file_stat_t * fileStats,
tr_file_stat * fileStats,
guint64 * setmeGotSize,
guint64 * setmeTotalSize)
{
@ -1206,10 +1206,10 @@ refreshPriorityActions( GtkTreeSelection * sel )
}
static void
set_files_enabled( GtkTreeStore * store,
GtkTreeIter * iter,
tr_torrent_t * tor,
gboolean enabled )
set_files_enabled( GtkTreeStore * store,
GtkTreeIter * iter,
tr_torrent * tor,
gboolean enabled )
{
int index;
GtkTreeIter child;
@ -1228,7 +1228,7 @@ static void
set_priority (GtkTreeSelection * selection,
GtkTreeStore * store,
GtkTreeIter * iter,
tr_torrent_t * tor,
tr_torrent * tor,
int priority_val,
const char * priority_str)
{
@ -1257,7 +1257,7 @@ priority_changed_cb (GtkCellRendererText * cell UNUSED,
FileData * d = (FileData*) file_data;
if (gtk_tree_model_get_iter_from_string (d->model, &iter, path))
{
tr_torrent_t * tor = tr_torrent_handle( d->gtor );
tr_torrent * tor = tr_torrent_handle( d->gtor );
const tr_priority_t priority = stringToPriority( value );
set_priority( d->selection, d->store, &iter, tor, priority, value );
}
@ -1288,8 +1288,7 @@ set_selected_file_priority ( tr_priority_t priority_val )
if( popupView && GTK_IS_TREE_VIEW(popupView) )
{
GtkTreeView * view = GTK_TREE_VIEW( popupView );
tr_torrent_t * tor = (tr_torrent_t*)
g_object_get_data (G_OBJECT(view), "torrent-handle");
tr_torrent * tor = g_object_get_data (G_OBJECT(view), "torrent-handle");
const char * priority_str = priorityToString( priority_val );
GtkTreeModel * model;
GtkTreeIter iter;
@ -1328,8 +1327,8 @@ file_page_new ( TrTorrent * gtor )
{
GtkWidget * ret;
FileData * data;
const tr_info_t * inf;
tr_torrent_t * tor;
const tr_info * inf;
tr_torrent * tor;
GtkTreeStore * store;
int ii;
GtkWidget * view, * scroll;
@ -1451,8 +1450,8 @@ refresh_files (GtkWidget * top)
guint64 foo, bar;
int fileCount = 0;
FileData * data = (FileData*) g_object_get_data (G_OBJECT(top), "file-data");
tr_torrent_t * tor = tr_torrent_handle( data->gtor );
tr_file_stat_t * fileStats = tr_torrentFiles( tor, &fileCount );
tr_torrent * tor = tr_torrent_handle( data->gtor );
tr_file_stat * fileStats = tr_torrentFiles( tor, &fileCount );
updateprogress (data->model, data->store, NULL, fileStats, &foo, &bar);
tr_torrentFilesFree( fileStats, fileCount );
}
@ -1465,7 +1464,7 @@ refresh_files (GtkWidget * top)
static void
speed_toggled_cb( GtkToggleButton * tb, gpointer gtor, int up_or_down )
{
tr_torrent_t * tor = tr_torrent_handle (gtor);
tr_torrent * tor = tr_torrent_handle (gtor);
gboolean b = gtk_toggle_button_get_active(tb);
tr_torrentSetSpeedMode( tor, up_or_down, b ? TR_SPEEDLIMIT_SINGLE
: TR_SPEEDLIMIT_GLOBAL );
@ -1499,7 +1498,7 @@ sensitize_from_check_cb (GtkToggleButton *toggle, gpointer w)
static void
setSpeedLimit( GtkSpinButton* spin, gpointer gtor, int up_or_down )
{
tr_torrent_t * tor = tr_torrent_handle (gtor);
tr_torrent * tor = tr_torrent_handle (gtor);
int KiB_sec = gtk_spin_button_get_value_as_int (spin);
tr_torrentSetSpeedLimit( tor, up_or_down, KiB_sec );
}
@ -1528,7 +1527,7 @@ options_page_new ( TrTorrent * gtor )
gboolean b;
GtkAdjustment *a;
GtkWidget *t, *w, *tb;
tr_torrent_t * tor = tr_torrent_handle (gtor);
tr_torrent * tor = tr_torrent_handle (gtor);
row = 0;
t = hig_workarea_create ();
@ -1624,8 +1623,8 @@ torrent_inspector_new ( GtkWindow * parent, TrTorrent * gtor )
guint tag;
char *size, *pch;
GtkWidget *d, *n, *w;
tr_torrent_t * tor = tr_torrent_handle (gtor);
const tr_info_t * info = tr_torrent_info (gtor);
tr_torrent * tor = tr_torrent_handle (gtor);
const tr_info * info = tr_torrent_info (gtor);
/* create the dialog */
pch = g_strdup_printf ("%s: %s",

View File

@ -292,7 +292,7 @@ tr_core_model( TrCore * self )
return self->disposed ? NULL : self->model;
}
tr_handle_t *
tr_handle *
tr_core_handle( TrCore * self )
{
g_return_val_if_fail (TR_IS_CORE(self), NULL);
@ -328,7 +328,7 @@ tr_core_shutdown( TrCore * self )
gboolean
tr_core_quiescent( TrCore * self )
{
const tr_handle_status_t * hstat;
const tr_handle_status * hstat;
TR_IS_CORE( self );
g_assert( self->quitting );
@ -407,7 +407,7 @@ tr_core_load( TrCore * self, gboolean forcepaused )
int i;
int flags;
int count = 0;
tr_torrent_t ** torrents;
tr_torrent ** torrents;
const char * destination;
TR_IS_CORE( self );
@ -561,7 +561,7 @@ void
tr_core_insert( TrCore * self, TrTorrent * tor )
{
GtkTreeIter iter;
const tr_info_t * inf;
const tr_info * inf;
gtk_list_store_append( GTK_LIST_STORE( self->model ), &iter );
inf = tr_torrent_info( tor );
@ -581,7 +581,7 @@ tr_core_update( TrCore * self )
{
GtkTreeIter iter;
TrTorrent * tor;
const tr_stat_t * st;
const tr_stat * st;
TR_IS_CORE( self );

View File

@ -58,12 +58,12 @@ typedef struct _TrCoreClass TrCoreClass;
/* treat the contents of this structure as private */
struct _TrCore
{
GObject parent;
GtkTreeModel * model;
tr_handle_t * handle;
int nextid;
gboolean quitting;
gboolean disposed;
GObject parent;
GtkTreeModel * model;
tr_handle * handle;
int nextid;
gboolean quitting;
gboolean disposed;
};
struct _TrCoreClass
@ -106,7 +106,7 @@ GtkTreeModel *
tr_core_model( TrCore * self );
/* Returns the libtransmission handle */
tr_handle_t *
tr_handle *
tr_core_handle( TrCore * self );
/* Try to politely stop all torrents and nat traversal */

View File

@ -225,7 +225,7 @@ tr_torrent_sever( TrTorrent * self )
}
}
tr_torrent_t *
tr_torrent *
tr_torrent_handle(TrTorrent *tor)
{
g_assert( TR_IS_TORRENT(tor) );
@ -233,7 +233,7 @@ tr_torrent_handle(TrTorrent *tor)
return tor->severed ? NULL : tor->handle;
}
static tr_stat_t*
static tr_stat*
refreshStat( TrTorrent * tor )
{
tor->lastStatTime= time( NULL );
@ -241,7 +241,7 @@ refreshStat( TrTorrent * tor )
return &tor->stat;
}
const tr_stat_t *
const tr_stat *
tr_torrent_stat(TrTorrent *tor)
{
g_assert( TR_IS_TORRENT(tor) );
@ -252,7 +252,7 @@ tr_torrent_stat(TrTorrent *tor)
return &tor->stat;
}
const tr_info_t *
const tr_info *
tr_torrent_info(TrTorrent *tor) {
TR_IS_TORRENT(tor);
@ -281,7 +281,7 @@ tr_torrent_stop( TrTorrent * self )
}
static TrTorrent *
maketorrent( tr_torrent_t * handle )
maketorrent( tr_torrent * handle )
{
tr_torrentDisablePex( handle,
!tr_prefs_get_bool_with_default( PREF_ID_PEX ) );
@ -292,18 +292,18 @@ maketorrent( tr_torrent_t * handle )
}
TrTorrent*
tr_torrent_new_preexisting( tr_torrent_t * tor )
tr_torrent_new_preexisting( tr_torrent * tor )
{
return maketorrent( tor );
}
TrTorrent *
tr_torrent_new( tr_handle_t * back, const char *torrent, const char *dir,
tr_torrent_new( tr_handle * back, const char *torrent, const char *dir,
enum tr_torrent_action act, gboolean paused, char **err )
{
TrTorrent *ret;
tr_torrent_t *handle;
tr_torrent *handle;
int errcode, flags;
g_assert(NULL != dir);
@ -342,12 +342,12 @@ tr_torrent_new( tr_handle_t * back, const char *torrent, const char *dir,
}
TrTorrent *
tr_torrent_new_with_data( tr_handle_t * back, uint8_t * data, size_t size,
tr_torrent_new_with_data( tr_handle * back, uint8_t * data, size_t size,
const char * dir, gboolean paused, char ** err )
{
tr_torrent_t * handle;
int errcode;
int flags;
tr_torrent * handle;
int errcode;
int flags;
g_assert( NULL != dir );
@ -381,11 +381,11 @@ tr_torrent_new_with_data( tr_handle_t * back, uint8_t * data, size_t size,
}
TrTorrent *
tr_torrent_new_with_state( tr_handle_t * back, benc_val_t * state,
tr_torrent_new_with_state( tr_handle * back, benc_val_t * state,
gboolean forcedpause, char ** err )
{
TrTorrent * ret;
tr_torrent_t * handle;
tr_torrent * handle;
int ii, errcode;
int flags;
benc_val_t *name, *data;
@ -455,7 +455,7 @@ tr_torrent_new_with_state( tr_handle_t * back, benc_val_t * state,
gboolean
tr_torrent_get_state( TrTorrent * tor, benc_val_t * state )
{
const tr_info_t * inf;
const tr_info * inf;
TR_IS_TORRENT( tor );
@ -526,7 +526,7 @@ tr_torrent_set_folder(TrTorrent *tor) {
void
tr_torrent_check_seeding_cap ( TrTorrent *gtor)
{
const tr_stat_t * st = tr_torrent_stat( gtor );
const tr_stat * st = tr_torrent_stat( gtor );
if ((gtor->seeding_cap_enabled) && (st->ratio >= gtor->seeding_cap))
tr_torrent_stop (gtor);
}
@ -548,7 +548,7 @@ tr_torrent_status_str ( TrTorrent * gtor )
{
char * top = 0;
const tr_stat_t * st = tr_torrent_stat( gtor );
const tr_stat * st = tr_torrent_stat( gtor );
const int tpeers = MAX (st->peersConnected, 0);
const int upeers = MAX (st->peersGettingFromUs, 0);

View File

@ -30,7 +30,7 @@
#include <libtransmission/bencode.h>
#include "util.h"
/* boxed type for tr_tracker_info_t */
/* boxed type for tr_tracker_info */
#define TR_TRACKER_BOXED_TYPE (tr_tracker_boxed_get_type ())
GType
tr_tracker_boxed_get_type( void );
@ -53,10 +53,10 @@ typedef struct _TrTorrentClass TrTorrentClass;
/* treat the contents of this structure as private */
struct _TrTorrent {
GObject parent;
tr_torrent_t *handle;
tr_torrent *handle;
char *dir;
char *delfile;
tr_stat_t stat;
tr_stat stat;
time_t lastStatTime;
/* FIXME: hm, are these heavyweight enough to deserve their own properties? */
@ -73,13 +73,13 @@ struct _TrTorrentClass {
GType
tr_torrent_get_type(void);
tr_torrent_t *
tr_torrent *
tr_torrent_handle(TrTorrent *tor);
const tr_stat_t *
const tr_stat *
tr_torrent_stat(TrTorrent *tor);
const tr_info_t *
const tr_info *
tr_torrent_info(TrTorrent *tor);
void
@ -99,18 +99,18 @@ void
tr_torrent_set_seeding_cap_enabled ( TrTorrent*, gboolean );
TrTorrent *
tr_torrent_new_preexisting( tr_torrent_t * tor );
tr_torrent_new_preexisting( tr_torrent * tor );
TrTorrent *
tr_torrent_new( tr_handle_t * handle, const char * path, const char * dir,
tr_torrent_new( tr_handle * handle, const char * path, const char * dir,
enum tr_torrent_action act, gboolean paused, char ** err);
TrTorrent *
tr_torrent_new_with_data( tr_handle_t * handle, uint8_t * data, size_t size,
tr_torrent_new_with_data( tr_handle * handle, uint8_t * data, size_t size,
const char * dir, gboolean paused, char ** err );
TrTorrent *
tr_torrent_new_with_state( tr_handle_t * handle, benc_val_t * state,
tr_torrent_new_with_state( tr_handle * handle, benc_val_t * state,
gboolean forcepaused, char ** err );
gboolean

View File

@ -1,35 +0,0 @@
/******************************************************************************
* $Id$
*
* Copyright (c) 2006 Transmission authors and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
#ifndef TR_CHOKING_H
#define TR_CHOKING_H
typedef struct tr_choking_s tr_choking_t;
tr_choking_t * tr_chokingInit( tr_handle_t * );
void tr_chokingSetLimit( tr_choking_t *, int );
void tr_chokingPulse( tr_choking_t * );
void tr_chokingClose( tr_choking_t * );
#endif /* TR_CHOKING_H */

View File

@ -93,7 +93,7 @@ static void
tr_cpEnsureDoneValid( const tr_completion * ccp )
{
const tr_torrent * tor = ccp->tor;
const tr_info_t * info = &tor->info;
const tr_info * info = &tor->info;
uint64_t have=0, total=0;
int i;
tr_completion * cp ;
@ -294,7 +294,7 @@ tr_cpDownloadedValid( const tr_completion * cp )
{
uint64_t b = 0;
const tr_torrent * tor = cp->tor;
const tr_info_t * info = &tor->info;
const tr_info * info = &tor->info;
int i;
for( i=0; i<info->pieceCount; ++i )

View File

@ -223,7 +223,7 @@ static int gotmsg ( struct ipc_info *, benc_val_t *, benc_val_t *,
static int msgcmp ( struct msg *, struct msg * );
static int infcmp ( struct inf *, struct inf * );
static struct msg * msglookup ( const char * );
static int filltracker( benc_val_t *, const tr_tracker_info_t * );
static int filltracker( benc_val_t *, const tr_tracker_info * );
static int handlercmp ( struct msgfunc *, struct msgfunc * );
RB_GENERATE_STATIC( msgtree, msg, link, msgcmp )
@ -1308,7 +1308,7 @@ msglookup( const char * name )
}
static int
filltracker( benc_val_t * val, const tr_tracker_info_t * tk )
filltracker( benc_val_t * val, const tr_tracker_info * tk )
{
tr_bencInit( val, TYPE_DICT );
if( tr_bencDictReserve( val, ( NULL == tk->scrape ? 3 : 4 ) ) )

View File

@ -98,18 +98,18 @@ bestPieceSize( uint64_t totalSize )
static int
builderFileCompare ( const void * va, const void * vb)
{
const tr_metainfo_builder_file_t * a = (const tr_metainfo_builder_file_t*) va;
const tr_metainfo_builder_file_t * b = (const tr_metainfo_builder_file_t*) vb;
const tr_metainfo_builder_file * a = va;
const tr_metainfo_builder_file * b = vb;
return strcmp( a->filename, b->filename );
}
tr_metainfo_builder_t*
tr_metaInfoBuilderCreate( tr_handle_t * handle, const char * topFile )
tr_metainfo_builder*
tr_metaInfoBuilderCreate( tr_handle * handle, const char * topFile )
{
int i;
struct FileList * files;
struct FileList * walk;
tr_metainfo_builder_t * ret = tr_new0( tr_metainfo_builder_t, 1 );
tr_metainfo_builder * ret = tr_new0( tr_metainfo_builder, 1 );
ret->top = tr_strdup( topFile );
ret->handle = handle;
if (1) {
@ -134,12 +134,12 @@ tr_metaInfoBuilderCreate( tr_handle_t * handle, const char * topFile )
for( walk=files; walk!=NULL; walk=walk->next )
++ret->fileCount;
ret->files = tr_new0( tr_metainfo_builder_file_t, ret->fileCount );
ret->files = tr_new0( tr_metainfo_builder_file, ret->fileCount );
for( i=0, walk=files; walk!=NULL; ++i )
{
struct FileList * tmp = walk;
tr_metainfo_builder_file_t * file = &ret->files[i];
tr_metainfo_builder_file * file = &ret->files[i];
walk = walk->next;
file->filename = tmp->filename;
file->size = tmp->size;
@ -149,7 +149,7 @@ tr_metaInfoBuilderCreate( tr_handle_t * handle, const char * topFile )
qsort( ret->files,
ret->fileCount,
sizeof(tr_metainfo_builder_file_t),
sizeof(tr_metainfo_builder_file),
builderFileCompare );
ret->pieceSize = bestPieceSize( ret->totalSize );
@ -163,7 +163,7 @@ tr_metaInfoBuilderCreate( tr_handle_t * handle, const char * topFile )
}
void
tr_metaInfoBuilderFree( tr_metainfo_builder_t * builder )
tr_metaInfoBuilderFree( tr_metainfo_builder * builder )
{
if( builder != NULL )
{
@ -184,7 +184,7 @@ tr_metaInfoBuilderFree( tr_metainfo_builder_t * builder )
****/
static uint8_t*
getHashInfo ( tr_metainfo_builder_t * b )
getHashInfo ( tr_metainfo_builder * b )
{
int fileIndex = 0;
uint8_t *ret = tr_new0( uint8_t, SHA_DIGEST_LENGTH * b->pieceCount );
@ -253,10 +253,10 @@ getHashInfo ( tr_metainfo_builder_t * b )
}
static void
getFileInfo( const char * topFile,
const tr_metainfo_builder_file_t * file,
benc_val_t * uninitialized_length,
benc_val_t * uninitialized_path )
getFileInfo( const char * topFile,
const tr_metainfo_builder_file * file,
benc_val_t * uninitialized_length,
benc_val_t * uninitialized_path )
{
benc_val_t *sub;
const char *pch, *prev;
@ -294,7 +294,7 @@ getFileInfo( const char * topFile,
static void
makeFilesList( benc_val_t * list,
const tr_metainfo_builder_t * builder )
const tr_metainfo_builder * builder )
{
int i = 0;
@ -314,8 +314,8 @@ makeFilesList( benc_val_t * list,
}
static void
makeInfoDict ( benc_val_t * dict,
tr_metainfo_builder_t * builder )
makeInfoDict ( benc_val_t * dict,
tr_metainfo_builder * builder )
{
uint8_t * pch;
benc_val_t * val;
@ -350,7 +350,7 @@ makeInfoDict ( benc_val_t * dict,
tr_bencInitInt( val, builder->isPrivate ? 1 : 0 );
}
static void tr_realMakeMetaInfo ( tr_metainfo_builder_t * builder )
static void tr_realMakeMetaInfo ( tr_metainfo_builder * builder )
{
int n = 5;
benc_val_t top, *val;
@ -407,11 +407,11 @@ static void tr_realMakeMetaInfo ( tr_metainfo_builder_t * builder )
****
***/
static tr_metainfo_builder_t * queue = NULL;
static tr_metainfo_builder * queue = NULL;
static tr_thread * workerThread = NULL;
static tr_lock* getQueueLock( tr_handle_t * h )
static tr_lock* getQueueLock( tr_handle * h )
{
static tr_lock * lock = NULL;
@ -425,11 +425,11 @@ static tr_lock* getQueueLock( tr_handle_t * h )
static void workerFunc( void * user_data )
{
tr_handle_t * handle = (tr_handle_t *) user_data;
tr_handle * handle = (tr_handle *) user_data;
for (;;)
{
tr_metainfo_builder_t * builder = NULL;
tr_metainfo_builder * builder = NULL;
/* find the next builder to process */
tr_lock * lock = getQueueLock ( handle );
@ -451,11 +451,11 @@ static void workerFunc( void * user_data )
}
void
tr_makeMetaInfo( tr_metainfo_builder_t * builder,
const char * outputFile,
const char * announce,
const char * comment,
int isPrivate )
tr_makeMetaInfo( tr_metainfo_builder * builder,
const char * outputFile,
const char * announce,
const char * comment,
int isPrivate )
{
tr_lock * lock;

View File

@ -13,14 +13,14 @@
#ifndef TR_MAKEMETA_H
#define TR_MAKEMETA_H 1
typedef struct tr_metainfo_builder_file_s
typedef struct tr_metainfo_builder_file
{
char * filename;
uint64_t size;
}
tr_metainfo_builder_file_t;
tr_metainfo_builder_file;
typedef struct tr_metainfo_builder_s
typedef struct tr_metainfo_builder
{
/**
*** These are set by tr_makeMetaInfoBuilderCreate()
@ -28,13 +28,13 @@ typedef struct tr_metainfo_builder_s
**/
char * top;
tr_metainfo_builder_file_t * files;
tr_metainfo_builder_file * files;
uint64_t totalSize;
int fileCount;
int pieceSize;
int pieceCount;
int isSingleFile;
tr_handle_t * handle;
tr_handle * handle;
/**
*** These are set inside tr_makeMetaInfo()
@ -64,19 +64,17 @@ typedef struct tr_metainfo_builder_s
*** The client should never use these fields.
**/
struct tr_metainfo_builder_s * nextBuilder;
struct tr_metainfo_builder * nextBuilder;
}
tr_metainfo_builder_t;
tr_metainfo_builder;
tr_metainfo_builder_t*
tr_metaInfoBuilderCreate( tr_handle_t * handle,
const char * topFile );
tr_metainfo_builder*
tr_metaInfoBuilderCreate( tr_handle * handle,
const char * topFile );
void
tr_metaInfoBuilderFree( tr_metainfo_builder_t* );
tr_metaInfoBuilderFree( tr_metainfo_builder* );
/**
* 'outputFile' if NULL, builder->top + ".torrent" will be used.
@ -89,11 +87,11 @@ tr_metaInfoBuilderFree( tr_metainfo_builder_t* );
* the caller must pass the builder to tr_metaInfoBuilderFree().
*/
void
tr_makeMetaInfo( tr_metainfo_builder_t * builder,
const char * outputFile,
const char * announce,
const char * comment,
int isPrivate );
tr_makeMetaInfo( tr_metainfo_builder * builder,
const char * outputFile,
const char * announce,
const char * comment,
int isPrivate );
#endif

View File

@ -1075,7 +1075,7 @@ tr_torrentSwiftPulse ( tr_torrent * tor )
tr_torrentWriterUnlock( tor );
}
void
tr_swiftPulse( tr_handle_t * h )
tr_swiftPulse( tr_handle * h )
{
static time_t lastPulseTime = 0;

View File

@ -62,6 +62,6 @@ void tr_peerBlame ( tr_peer_t *, int piece, int success );
struct in_addr * tr_peerAddress ( tr_peer_t * );
int tr_peerGetConnectable ( const struct tr_torrent *, uint8_t ** );
void tr_swiftPulse ( tr_handle_t * );
void tr_swiftPulse ( tr_handle * );
#endif

View File

@ -37,7 +37,6 @@
#include "inout.h"
#include "metainfo.h"
#include "net.h" /* tr_netNtop */
#include "peer.h"
#include "peer-mgr.h"
#include "platform.h"
#include "ratecontrol.h"
@ -280,10 +279,10 @@ recheckDoneCB( tr_torrent * tor )
}
static void
torrentRealInit( tr_handle_t * h,
tr_torrent * tor,
const char * destination,
int flags )
torrentRealInit( tr_handle * h,
tr_torrent * tor,
const char * destination,
int flags )
{
uint64_t loaded;
uint64_t t;
@ -415,9 +414,9 @@ torrentRealInit( tr_handle_t * h,
}
static int
pathIsInUse ( const tr_handle_t * h,
const char * destination,
const char * name )
pathIsInUse ( const tr_handle * h,
const char * destination,
const char * name )
{
const tr_torrent * tor;
@ -430,8 +429,8 @@ pathIsInUse ( const tr_handle_t * h,
}
static int
hashExists( const tr_handle_t * h,
const uint8_t * hash )
hashExists( const tr_handle * h,
const uint8_t * hash )
{
const tr_torrent * tor;
@ -443,8 +442,8 @@ hashExists( const tr_handle_t * h,
}
static int
infoCanAdd( const tr_handle_t * h,
const char * destination,
infoCanAdd( const tr_handle * h,
const char * destination,
const tr_info * info )
{
if( hashExists( h, info->hash ) )
@ -457,9 +456,9 @@ infoCanAdd( const tr_handle_t * h,
}
int
tr_torrentParse( const tr_handle_t * h,
const char * path,
const char * destination,
tr_torrentParse( const tr_handle * h,
const char * path,
const char * destination,
tr_info * setme_info )
{
int ret, doFree;
@ -482,11 +481,11 @@ tr_torrentParse( const tr_handle_t * h,
}
tr_torrent *
tr_torrentInit( tr_handle_t * h,
const char * path,
const char * destination,
int flags,
int * error )
tr_torrentInit( tr_handle * h,
const char * path,
const char * destination,
int flags,
int * error )
{
int val;
int tmpError;
@ -508,9 +507,9 @@ tr_torrentInit( tr_handle_t * h,
}
int
tr_torrentParseHash( const tr_handle_t * h,
const char * hashStr,
const char * destination,
tr_torrentParseHash( const tr_handle * h,
const char * hashStr,
const char * destination,
tr_info * setme_info )
{
int ret, doFree;
@ -533,11 +532,11 @@ tr_torrentParseHash( const tr_handle_t * h,
}
tr_torrent *
tr_torrentInitSaved( tr_handle_t * h,
const char * hashStr,
const char * destination,
int flags,
int * error )
tr_torrentInitSaved( tr_handle * h,
const char * hashStr,
const char * destination,
int flags,
int * error )
{
int val;
int tmpError;
@ -559,10 +558,10 @@ tr_torrentInitSaved( tr_handle_t * h,
}
static int
tr_torrentParseData( const tr_handle_t * h,
const uint8_t * data,
size_t size,
const char * destination,
tr_torrentParseData( const tr_handle * h,
const uint8_t * data,
size_t size,
const char * destination,
tr_info * setme_info )
{
int ret, doFree;
@ -585,7 +584,7 @@ tr_torrentParseData( const tr_handle_t * h,
}
tr_torrent *
tr_torrentInitData( tr_handle_t * h,
tr_torrentInitData( tr_handle * h,
const uint8_t * data,
size_t size,
const char * destination,
@ -1003,7 +1002,7 @@ static void
tr_torrentFree( tr_torrent * tor )
{
tr_torrent * t;
tr_handle_t * h = tor->handle;
tr_handle * h = tor->handle;
tr_info * inf = &tor->info;
fprintf( stderr, "closing torrent %s\n", tor->info.name );

View File

@ -62,7 +62,7 @@
typedef struct
{
tr_handle_t * handle;
tr_handle * handle;
tr_ptrArray * torrents;
tr_ptrArray * scraping;

View File

@ -103,12 +103,12 @@ tr_setEncryptionMode( tr_handle * handle, tr_encryption_mode mode )
/***********************************************************************
* tr_init
***********************************************************************
* Allocates a tr_handle_t structure and initializes a few things
* Allocates a tr_handle structure and initializes a few things
**********************************************************************/
tr_handle_t * tr_init( const char * tag )
tr_handle * tr_init( const char * tag )
{
tr_handle_t * h;
int i;
tr_handle * h;
int i;
#ifndef WIN32
/* Don't exit when writing on a broken socket */
@ -117,7 +117,7 @@ tr_handle_t * tr_init( const char * tag )
tr_msgInit();
h = tr_new0( tr_handle_t, 1 );
h = tr_new0( tr_handle, 1 );
if( !h )
return NULL;
@ -158,27 +158,27 @@ tr_handle_t * tr_init( const char * tag )
***********************************************************************
*
**********************************************************************/
void tr_setBindPort( tr_handle_t * h, int port )
void tr_setBindPort( tr_handle * h, int port )
{
h->isPortSet = 1;
tr_sharedSetPort( h->shared, port );
}
int
tr_getPublicPort( const tr_handle_t * h )
tr_getPublicPort( const tr_handle * h )
{
assert( h != NULL );
return tr_sharedGetPublicPort( h->shared );
}
void tr_natTraversalEnable( tr_handle_t * h, int enable )
void tr_natTraversalEnable( tr_handle * h, int enable )
{
tr_sharedLock( h->shared );
tr_sharedTraversalEnable( h->shared, enable );
tr_sharedUnlock( h->shared );
}
tr_handle_status * tr_handleStatus( tr_handle_t * h )
tr_handle_status * tr_handleStatus( tr_handle * h )
{
tr_handle_status * s;
@ -200,9 +200,9 @@ tr_handle_status * tr_handleStatus( tr_handle_t * h )
***/
void
tr_setUseGlobalSpeedLimit( tr_handle_t * h,
int up_or_down,
int use_flag )
tr_setUseGlobalSpeedLimit( tr_handle * h,
int up_or_down,
int use_flag )
{
char * ch = up_or_down==TR_UP ? &h->useUploadLimit
: &h->useDownloadLimit;
@ -210,9 +210,9 @@ tr_setUseGlobalSpeedLimit( tr_handle_t * h,
}
void
tr_setGlobalSpeedLimit( tr_handle_t * h,
int up_or_down,
int KiB_sec )
tr_setGlobalSpeedLimit( tr_handle * h,
int up_or_down,
int KiB_sec )
{
if( up_or_down == TR_DOWN )
tr_rcSetLimit( h->download, KiB_sec );
@ -221,9 +221,9 @@ tr_setGlobalSpeedLimit( tr_handle_t * h,
}
void
tr_getGlobalSpeedLimit( tr_handle_t * h,
int up_or_down,
int * setme_enabled,
tr_getGlobalSpeedLimit( tr_handle * h,
int up_or_down,
int * setme_enabled,
int * setme_KiBsec )
{
if( setme_enabled != NULL )
@ -235,7 +235,7 @@ tr_getGlobalSpeedLimit( tr_handle_t * h,
}
void tr_torrentRates( tr_handle_t * h, float * dl, float * ul )
void tr_torrentRates( tr_handle * h, float * dl, float * ul )
{
tr_torrent * tor;
@ -253,12 +253,12 @@ void tr_torrentRates( tr_handle_t * h, float * dl, float * ul )
tr_sharedUnlock( h->shared );
}
int tr_torrentCount( tr_handle_t * h )
int tr_torrentCount( tr_handle * h )
{
return h->torrentCount;
}
void tr_torrentIterate( tr_handle_t * h, tr_callback_t func, void * d )
void tr_torrentIterate( tr_handle * h, tr_callback_t func, void * d )
{
tr_torrent * tor, * next;
@ -272,7 +272,7 @@ void tr_torrentIterate( tr_handle_t * h, tr_callback_t func, void * d )
static void
tr_closeImpl( void * vh )
{
tr_handle_t * h = vh;
tr_handle * h = vh;
fprintf( stderr, "in tr_closeImpl\n" );
tr_peerMgrFree( h->peerMgr );
fprintf( stderr, "calling mgr free\n" );
@ -289,7 +289,7 @@ fprintf( stderr, "setting h->closed to TRUE\n" );
h->isClosed = TRUE;
}
void
tr_close( tr_handle_t * h )
tr_close( tr_handle * h )
{
fprintf( stderr, "torrentCount is %d\n", h->torrentCount );
assert( tr_torrentCount( h ) == 0 );
@ -310,10 +310,10 @@ fprintf( stderr, "here I am in tr_close...\n" );
}
tr_torrent **
tr_loadTorrents ( tr_handle_t * h,
const char * destination,
int flags,
int * setmeCount )
tr_loadTorrents ( tr_handle * h,
const char * destination,
int flags,
int * setmeCount )
{
int i, n = 0;
struct stat sb;

View File

@ -103,12 +103,10 @@ extern "C" {
**********************************************************************/
typedef struct tr_handle tr_handle;
typedef struct tr_handle tr_handle_t;
tr_handle * tr_init( const char * tag );
typedef struct tr_tracker_info tr_tracker_info;
typedef struct tr_tracker_info tr_tracker_info_t;
/**
***
@ -142,7 +140,6 @@ int tr_getMessageLevel( void );
* Enable or disable message queuing
**********************************************************************/
typedef struct tr_msg_list tr_msg_list;
typedef struct tr_msg_list tr_msg_list_t;
void tr_setMessageQueuing( int );
/***********************************************************************
@ -185,7 +182,6 @@ void tr_natTraversalEnable( tr_handle *, int enable );
* Returns some status info for the given handle.
**********************************************************************/
typedef struct tr_handle_status tr_handle_status;
typedef struct tr_handle_status tr_handle_status_t;
tr_handle_status * tr_handleStatus( tr_handle * );
@ -203,7 +199,6 @@ int tr_torrentCount( tr_handle * h );
* Iterates on open torrents
**********************************************************************/
typedef struct tr_torrent tr_torrent;
typedef struct tr_torrent tr_torrent_t;
typedef void (*tr_callback_t) ( tr_torrent *, void * );
void tr_torrentIterate( tr_handle *, tr_callback_t, void * );
@ -342,7 +337,6 @@ tr_torrent * tr_torrentInit( tr_handle * handle,
int * setme_error );
typedef struct tr_info tr_info;
typedef struct tr_info tr_info_t;
/**
* Parses the specified metainfo file.
@ -485,19 +479,16 @@ int tr_torrentCanManualUpdate( const tr_torrent * );
* to update itself.
**********************************************************************/
typedef struct tr_stat tr_stat;
typedef struct tr_stat tr_stat_t;
const tr_stat * tr_torrentStat( tr_torrent * );
/***********************************************************************
* tr_torrentPeers
***********************************************************************/
typedef struct tr_peer_stat tr_peer_stat;
typedef struct tr_peer_stat tr_peer_stat_t;
tr_peer_stat * tr_torrentPeers( const tr_torrent *, int * peerCount );
void tr_torrentPeersFree( tr_peer_stat *, int peerCount );
typedef struct tr_file_stat tr_file_stat;
typedef struct tr_file_stat tr_file_stat_t;
tr_file_stat * tr_torrentFiles( const tr_torrent *, int * fileCount );
void tr_torrentFilesFree( tr_file_stat *, int fileCount );

View File

@ -44,7 +44,7 @@
typedef struct tr_event_handle
{
tr_lock * lock;
tr_handle_t * h;
tr_handle * h;
tr_thread * thread;
tr_list * commands;
struct event_base * base;
@ -223,7 +223,7 @@ fprintf( stderr, "w00t!!!!!!!!!!!!!!!!!!!\n" );
}
void
tr_eventInit( tr_handle_t * handle )
tr_eventInit( tr_handle * handle )
{
tr_event_handle * eh;
@ -235,7 +235,7 @@ tr_eventInit( tr_handle_t * handle )
}
void
tr_eventClose( tr_handle_t * handle )
tr_eventClose( tr_handle * handle )
{
tr_event_handle * eh = handle->events;
@ -261,7 +261,7 @@ pushList( struct tr_event_handle * eh, struct tr_event_command * command )
}
void
tr_evhttp_make_request (tr_handle_t * handle,
tr_evhttp_make_request (tr_handle * handle,
struct evhttp_connection * evcon,
struct evhttp_request * req,
enum evhttp_cmd_type type,
@ -282,7 +282,7 @@ tr_evhttp_make_request (tr_handle_t * handle,
}
void
tr_bufferevent_write( tr_handle_t * handle,
tr_bufferevent_write( tr_handle * handle,
struct bufferevent * bufev,
const void * buf,
size_t buflen )