Changeset 3111


Ignore:
Timestamp:
Sep 20, 2007, 8:14:13 PM (15 years ago)
Author:
charles
Message:

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

Location:
trunk
Files:
1 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/transmissioncli.c

    r2863 r3111  
    8585static int           natTraversal  = 0;
    8686static sig_atomic_t  gotsig        = 0;
    87 static tr_torrent_t  * tor;
     87static tr_torrent    * tor;
    8888
    8989static char          * finishCall   = NULL;
     
    110110{
    111111    int i, error;
    112     tr_handle_t  * h;
    113     const tr_stat_t    * s;
    114     tr_handle_status_t * hstat;
     112    tr_handle  * h;
     113    const tr_stat    * s;
     114    tr_handle_status * hstat;
    115115
    116116    printf( "Transmission %s - http://transmission.m0k.org/\n\n",
     
    157157    {
    158158        int ret;
    159         tr_metainfo_builder_t* builder = tr_metaInfoBuilderCreate( h, sourceFile );
     159        tr_metainfo_builder * builder = tr_metaInfoBuilderCreate( h, sourceFile );
    160160        tr_makeMetaInfo( builder, torrentPath, announce, comment, isPrivate );
    161161        while( !builder->isDone ) {
     
    178178    if( showInfo )
    179179    {
    180         const tr_info_t * info = tr_torrentInfo( tor );
     180        const tr_info * info = tr_torrentInfo( tor );
    181181
    182182        s = tr_torrentStat( tor );
  • trunk/daemon/server.c

    r2818 r3111  
    486486        if( TORRENT_ID_VALID( tor ) )
    487487        {
    488             const tr_info_t * inf = torrent_info( tor );
     488            const tr_info * inf = torrent_info( tor );
    489489            if( 0 > ipc_addinfo( added, tor, inf, 0 ) )
    490490            {
     
    545545    if( TORRENT_ID_VALID( tor ) )
    546546    {
    547         const tr_info_t * inf;
     547        const tr_info * inf;
    548548        val = ipc_initval( client->ipc, IPC_MSG_INFO, tag, &pk, TYPE_LIST );
    549549        if( NULL == val )
     
    756756addinfo( benc_val_t * list, int id, int types )
    757757{
    758     const tr_info_t * inf = torrent_info( id );
     758    const tr_info * inf = torrent_info( id );
    759759    return inf ? ipc_addinfo( list, id, inf, types ) : 0;
    760760}
     
    763763addstat( benc_val_t * list, int id, int types )
    764764{
    765     const tr_stat_t * st = torrent_stat( id );
     765    const tr_stat * st = torrent_stat( id );
    766766    return st ? ipc_addstat( list, id, st, types ) : 0;
    767767}
     
    863863    for( ii = 0; val->val.l.count > ii; ii++ )
    864864    {
    865         const tr_info_t * inf;
     865        const tr_info * inf;
    866866        hash = &val->val.l.vals[ii];
    867867        if( NULL == hash || TYPE_STR != hash->type ||
  • trunk/daemon/torrents.c

    r2974 r3111  
    5757    int             id;
    5858    uint8_t         hash[SHA_DIGEST_LENGTH];
    59     tr_torrent_t  * tor;
     59    tr_torrent    * tor;
    6060    int             pexset;
    6161    int             pex;
     
    8181
    8282static struct event_base * gl_base      = NULL;
    83 static tr_handle_t       * gl_handle    = NULL;
     83static tr_handle         * gl_handle    = NULL;
    8484static struct tortree      gl_tree      = RB_INITIALIZER( &gl_tree );
    8585static struct hashtree     gl_hashes    = RB_INITIALIZER( &gl_hashes );
     
    186186    if( tor != NULL )
    187187    {
    188         const tr_stat_t  * st = tr_torrentStat( tor->tor );
     188        const tr_stat  * st = tr_torrentStat( tor->tor );
    189189
    190190        if( TR_STATUS_INACTIVE & st->status )
     
    208208    if( tor != NULL )
    209209    {
    210         const tr_stat_t  * st = tr_torrentStat( tor->tor );
     210        const tr_stat  * st = tr_torrentStat( tor->tor );
    211211
    212212        if( TR_STATUS_ACTIVE & st->status )
     
    234234}
    235235
    236 const tr_info_t *
     236const tr_info *
    237237torrent_info( int id )
    238238{
     
    251251}
    252252
    253 const tr_stat_t *
     253const tr_stat *
    254254torrent_stat( int id )
    255255{
     
    474474    struct tor * tor, * found;
    475475    int          errcode;
    476     const tr_info_t  * inf;
     476    const tr_info  * inf;
    477477
    478478    assert( ( NULL != path && NULL == hash && NULL == data ) ||
     
    624624timerfunc( int fd UNUSED, short event UNUSED, void * arg UNUSED )
    625625{
    626     struct tor         * tor, * next;
    627     tr_handle_status_t * hs;
    628     int                  stillmore;
    629     struct timeval       tv;
     626    struct tor       * tor, * next;
     627    tr_handle_status * hs;
     628    int                stillmore;
     629    struct timeval     tv;
    630630
    631631    /* true if we've still got live torrents... */
     
    828828    RB_FOREACH( ii, tortree, &gl_tree )
    829829    {
    830         const tr_info_t * inf;
    831         const tr_stat_t * st;
     830        const tr_info * inf;
     831        const tr_stat * st;
    832832        tor = tr_bencListAdd( list );
    833833        assert( NULL != tor );
  • trunk/daemon/torrents.h

    r2400 r3111  
    3838void         torrent_stop                ( int );
    3939void         torrent_remove              ( int );
    40 const tr_info_t  * torrent_info          ( int );
    41 const tr_stat_t  * torrent_stat          ( int );
     40const tr_info  * torrent_info          ( int );
     41const tr_stat  * torrent_stat          ( int );
    4242int          torrent_lookup              ( const uint8_t * );
    4343void       * torrent_iter                ( void *, int * );
  • trunk/gtk/dialogs.c

    r2558 r3111  
    8181    struct
    8282    {
    83         tr_tracker_info_t * track;
     83        tr_tracker_info  * track;
    8484        GtkLabel          * trackwid;
    8585        GtkLabel          * annwid;
  • trunk/gtk/ipc.c

    r2425 r3111  
    818818    if( IPC_MSG_INFO == msgid )
    819819    {
    820         const tr_info_t * inf = tr_torrent_info( tor );
     820        const tr_info * inf = tr_torrent_info( tor );
    821821        return ipc_addinfo( val, torid, inf, types );
    822822    }
    823823    else
    824824    {
    825         const tr_stat_t * st = tr_torrent_stat( tor );
     825        const tr_stat * st = tr_torrent_stat( tor );
    826826        return ipc_addstat( val, torid, st, types );
    827827    }
     
    837837    int                    ii, torid;
    838838    TrTorrent            * tor;
    839     const tr_info_t      * inf;
     839    const tr_info        * inf;
    840840    uint8_t              * buf;
    841841    size_t                 size;
     
    982982    uint8_t              * buf;
    983983    size_t                 size;
    984     tr_handle_status_t   * hstat;
     984    tr_handle_status     * hstat;
    985985    const char           * pref;
    986986    int                    num;
  • trunk/gtk/main.c

    r3105 r3111  
    159159prefschanged( TrCore * core, int id, gpointer data );
    160160static void
    161 setpex( tr_torrent_t * tor, void * arg );
     161setpex( tr_torrent * tor, void * arg );
    162162static gboolean
    163163updatemodel(gpointer gdata);
     
    768768{
    769769    struct cbdata * cbdata = data;
    770     tr_handle_t   * tr     = tr_core_handle( cbdata->core );
     770    tr_handle     * tr     = tr_core_handle( cbdata->core );
    771771    gboolean        boolval;
    772772
     
    830830
    831831void
    832 setpex( tr_torrent_t * tor, void * arg )
     832setpex( tr_torrent * tor, void * arg )
    833833{
    834834    gboolean * val;
  • trunk/gtk/makemeta-ui.c

    r2851 r3111  
    3636    GtkWidget * dialog;
    3737    GtkWidget * progress_dialog;
    38     tr_metainfo_builder_t * builder;
    39     tr_handle_t * handle;
     38    tr_metainfo_builder * builder;
     39    tr_handle * handle;
    4040}
    4141MakeMetaUI;
     
    218218
    219219GtkWidget*
    220 make_meta_ui( GtkWindow * parent, tr_handle_t * handle )
     220make_meta_ui( GtkWindow * parent, tr_handle * handle )
    221221{
    222222    int row = 0;
  • trunk/gtk/makemeta-ui.h

    r2849 r3111  
    1717#include <libtransmission/transmission.h>
    1818
    19 GtkWidget* make_meta_ui( GtkWindow * parent, tr_handle_t * handle );
     19GtkWidget* make_meta_ui( GtkWindow * parent, tr_handle * handle );
    2020
    2121#endif
  • trunk/gtk/msgwin.c

    r2425 r3111  
    9191msgwin_update( void )
    9292{
    93   tr_msg_list_t * msgs, * ii;
     93  tr_msg_list * msgs, * ii;
    9494
    9595  g_assert( textbuf != NULL );
  • trunk/gtk/torrent-inspector.c

    r3105 r3111  
    7979refresh_pieces (GtkWidget * da, GdkEventExpose * event UNUSED, gpointer gtor)
    8080{
    81   tr_torrent_t * tor = tr_torrent_handle( TR_TORRENT(gtor) );
    82   const tr_info_t * info = tr_torrent_info( TR_TORRENT(gtor) );
     81  tr_torrent * tor = tr_torrent_handle( TR_TORRENT(gtor) );
     82  const tr_info * info = tr_torrent_info( TR_TORRENT(gtor) );
    8383  int mode = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(da), "draw-mode"));
    8484
     
    262262static int compare_peers (const void * a, const void * b)
    263263{
    264   const tr_peer_stat_t * pa = (const tr_peer_stat_t *) a;
    265   const tr_peer_stat_t * pb = (const tr_peer_stat_t *) b;
     264  const tr_peer_stat * pa = a;
     265  const tr_peer_stat * pb = b;
    266266  return strcmp (pa->addr, pb->addr);
    267267}
     
    269269{
    270270  const char * addr = (const char *) a;
    271   const tr_peer_stat_t * peer = (const tr_peer_stat_t *) b;
     271  const tr_peer_stat * peer = b;
    272272  return strcmp (addr, peer->addr);
    273273}
    274274
    275275static void
    276 peer_row_set (GtkTreeStore          * store,
    277               GtkTreeIter           * iter,
    278               const tr_peer_stat_t  * peer)
     276peer_row_set (GtkTreeStore        * store,
     277              GtkTreeIter         * iter,
     278              const tr_peer_stat  * peer)
    279279{
    280280  const char * client = peer->client;
     
    298298
    299299static void
    300 append_peers_to_model (GtkTreeStore          * store,
    301                        const tr_peer_stat_t  * peers,
    302                        int                     n_peers)
     300append_peers_to_model (GtkTreeStore        * store,
     301                       const tr_peer_stat  * peers,
     302                       int                   n_peers)
    303303{
    304304  int i;
     
    311311
    312312static GtkTreeModel*
    313 peer_model_new (tr_torrent_t * tor)
     313peer_model_new (tr_torrent * tor)
    314314{
    315315  GtkTreeStore * m = gtk_tree_store_new (N_PEER_COLS,
     
    326326
    327327  int n_peers = 0;
    328   tr_peer_stat_t * peers = tr_torrentPeers (tor, &n_peers);
    329   qsort (peers, n_peers, sizeof(tr_peer_stat_t), compare_peers);
     328  tr_peer_stat * peers = tr_torrentPeers (tor, &n_peers);
     329  qsort (peers, n_peers, sizeof(tr_peer_stat), compare_peers);
    330330  append_peers_to_model (m, peers, n_peers);
    331331  tr_torrentPeersFree( peers, 0 );
     
    450450  GtkTreeIter iter;
    451451  PeerData * p = (PeerData*) g_object_get_data (G_OBJECT(top), "peer-data");
    452   tr_torrent_t * tor = tr_torrent_handle ( p->gtor );
     452  tr_torrent * tor = tr_torrent_handle ( p->gtor );
    453453  GtkTreeModel * model = p->model;
    454454  GtkTreeStore * store = p->store;
    455   tr_peer_stat_t * peers;
    456   const tr_stat_t * stat = tr_torrent_stat( p->gtor );
     455  tr_peer_stat * peers;
     456  const tr_stat * stat = tr_torrent_stat( p->gtor );
    457457
    458458  /**
     
    466466  n_peers = 0;
    467467  peers = tr_torrentPeers (tor, &n_peers);
    468   qsort (peers, n_peers, sizeof(tr_peer_stat_t), compare_peers);
     468  qsort (peers, n_peers, sizeof(tr_peer_stat), compare_peers);
    469469
    470470  i = 0;
     
    472472  {
    473473    char * addr = NULL;
    474     tr_peer_stat_t * peer = NULL;
     474    tr_peer_stat * peer = NULL;
    475475    gtk_tree_model_get (model, &iter, PEER_COL_ADDRESS, &addr, -1);
    476     peer = bsearch (addr, peers, n_peers, sizeof(tr_peer_stat_t),
     476    peer = bsearch (addr, peers, n_peers, sizeof(tr_peer_stat),
    477477                    compare_addr_to_peer);
    478478    g_free (addr);
     
    486486      peer_row_set (store, &iter, peer);
    487487
    488       /* remove it from the tr_peer_stat_t list */
    489       g_memmove (peer, peer+1, sizeof(tr_peer_stat_t)*n_rhs);
     488      /* remove it from the tr_peer_stat list */
     489      g_memmove (peer, peer+1, sizeof(tr_peer_stat)*n_rhs);
    490490      --n_peers;
    491491    }
     
    512512  GtkTreeModel *m;
    513513  GtkWidget *h, *v, *w, *ret, *da, *sw, *l, *vbox, *hbox;
    514   tr_torrent_t * tor = tr_torrent_handle (gtor);
     514  tr_torrent * tor = tr_torrent_handle (gtor);
    515515  PeerData * p = g_new (PeerData, 1);
    516516  char name[64];
     
    715715****/
    716716
    717 static GtkWidget* info_page_new (tr_torrent_t * tor)
     717static GtkWidget* info_page_new (tr_torrent * tor)
    718718{
    719719  int row = 0;
     
    726726  const char * namefmt = "%s:";
    727727  GtkTextBuffer * b;
    728   tr_tracker_info_t * track;
    729   const tr_info_t* info = tr_torrentInfo(tor);
     728  tr_tracker_info * track;
     729  const tr_info * info = tr_torrentInfo(tor);
    730730
    731731  hig_workarea_add_section_title (t, &row, _("Torrent Information"));
     
    834834{
    835835  Activity * a = (Activity*) g_object_get_data (G_OBJECT(top), "activity-data");
    836   const tr_stat_t * stat = tr_torrent_stat( a->gtor );
     836  const tr_stat * stat = tr_torrent_stat( a->gtor );
    837837  guint64 size;
    838838  char *pch;
     
    10061006
    10071007static void
    1008 parsepath( const tr_torrent_t  * tor,
    1009            GtkTreeStore        * store,
    1010            GtkTreeIter         * ret,
    1011            const char          * path,
    1012            int                   index,
    1013            uint64_t              size )
     1008parsepath( const tr_torrent  * tor,
     1009           GtkTreeStore      * store,
     1010           GtkTreeIter       * ret,
     1011           const char        * path,
     1012           int                 index,
     1013           uint64_t            size )
    10141014{
    10151015    GtkTreeModel * model;
     
    11181118                GtkTreeStore   * store,
    11191119                GtkTreeIter    * parent,
    1120                 tr_file_stat_t * fileStats,
     1120                tr_file_stat  * fileStats,
    11211121                guint64        * setmeGotSize,
    11221122                guint64        * setmeTotalSize)
     
    12071207
    12081208static void
    1209 set_files_enabled( GtkTreeStore     * store,
    1210                    GtkTreeIter      * iter,
    1211                    tr_torrent_t     * tor,
    1212                    gboolean           enabled )
     1209set_files_enabled( GtkTreeStore   * store,
     1210                   GtkTreeIter    * iter,
     1211                   tr_torrent     * tor,
     1212                   gboolean         enabled )
    12131213{
    12141214    int index;
     
    12291229              GtkTreeStore * store,
    12301230              GtkTreeIter * iter,
    1231               tr_torrent_t * tor,
     1231              tr_torrent * tor,
    12321232              int priority_val,
    12331233              const char * priority_str)
     
    12581258  if (gtk_tree_model_get_iter_from_string (d->model, &iter, path))
    12591259  {
    1260     tr_torrent_t  * tor = tr_torrent_handle( d->gtor );
     1260    tr_torrent  * tor = tr_torrent_handle( d->gtor );
    12611261    const tr_priority_t priority = stringToPriority( value );
    12621262    set_priority( d->selection, d->store, &iter, tor, priority, value );
     
    12891289    {
    12901290        GtkTreeView * view = GTK_TREE_VIEW( popupView );
    1291         tr_torrent_t * tor = (tr_torrent_t*)
    1292             g_object_get_data (G_OBJECT(view), "torrent-handle");
     1291        tr_torrent * tor = g_object_get_data (G_OBJECT(view), "torrent-handle");
    12931292        const char * priority_str = priorityToString( priority_val );
    12941293        GtkTreeModel * model;
     
    13291328    GtkWidget           * ret;
    13301329    FileData            * data;
    1331     const tr_info_t     * inf;
    1332     tr_torrent_t        * tor;
     1330    const tr_info       * inf;
     1331    tr_torrent          * tor;
    13331332    GtkTreeStore        * store;
    13341333    int                   ii;
     
    14521451    int fileCount = 0;
    14531452    FileData * data = (FileData*) g_object_get_data (G_OBJECT(top), "file-data");
    1454     tr_torrent_t * tor = tr_torrent_handle( data->gtor );
    1455     tr_file_stat_t * fileStats = tr_torrentFiles( tor, &fileCount );
     1453    tr_torrent * tor = tr_torrent_handle( data->gtor );
     1454    tr_file_stat * fileStats = tr_torrentFiles( tor, &fileCount );
    14561455    updateprogress (data->model, data->store, NULL, fileStats, &foo, &bar);
    14571456    tr_torrentFilesFree( fileStats, fileCount );
     
    14661465speed_toggled_cb( GtkToggleButton * tb, gpointer gtor, int up_or_down )
    14671466{
    1468   tr_torrent_t * tor = tr_torrent_handle (gtor);
     1467  tr_torrent * tor = tr_torrent_handle (gtor);
    14691468  gboolean b = gtk_toggle_button_get_active(tb);
    14701469  tr_torrentSetSpeedMode( tor, up_or_down, b ? TR_SPEEDLIMIT_SINGLE
     
    15001499setSpeedLimit( GtkSpinButton* spin, gpointer gtor, int up_or_down )
    15011500{
    1502   tr_torrent_t * tor = tr_torrent_handle (gtor);
     1501  tr_torrent * tor = tr_torrent_handle (gtor);
    15031502  int KiB_sec = gtk_spin_button_get_value_as_int (spin);
    15041503  tr_torrentSetSpeedLimit( tor, up_or_down, KiB_sec );
     
    15291528  GtkAdjustment *a;
    15301529  GtkWidget *t, *w, *tb;
    1531   tr_torrent_t * tor = tr_torrent_handle (gtor);
     1530  tr_torrent * tor = tr_torrent_handle (gtor);
    15321531
    15331532  row = 0;
     
    16251624  char *size, *pch;
    16261625  GtkWidget *d, *n, *w;
    1627   tr_torrent_t * tor = tr_torrent_handle (gtor);
    1628   const tr_info_t * info = tr_torrent_info (gtor);
     1626  tr_torrent * tor = tr_torrent_handle (gtor);
     1627  const tr_info * info = tr_torrent_info (gtor);
    16291628
    16301629  /* create the dialog */
  • trunk/gtk/tr_core.c

    r2615 r3111  
    293293}
    294294
    295 tr_handle_t *
     295tr_handle *
    296296tr_core_handle( TrCore * self )
    297297{
     
    329329tr_core_quiescent( TrCore * self )
    330330{
    331     const tr_handle_status_t * hstat;
     331    const tr_handle_status * hstat;
    332332
    333333    TR_IS_CORE( self );
     
    408408    int flags;
    409409    int count = 0;
    410     tr_torrent_t ** torrents;
     410    tr_torrent ** torrents;
    411411    const char * destination;
    412412
     
    562562{
    563563    GtkTreeIter iter;
    564     const tr_info_t * inf;
     564    const tr_info * inf;
    565565
    566566    gtk_list_store_append( GTK_LIST_STORE( self->model ), &iter );
     
    582582    GtkTreeIter iter;
    583583    TrTorrent * tor;
    584     const tr_stat_t * st;
     584    const tr_stat * st;
    585585
    586586    TR_IS_CORE( self );
  • trunk/gtk/tr_core.h

    r2463 r3111  
    5959struct _TrCore
    6060{
    61     GObject             parent;
    62     GtkTreeModel      * model;
    63     tr_handle_t       * handle;
    64     int                 nextid;
    65     gboolean            quitting;
    66     gboolean            disposed;
     61    GObject           parent;
     62    GtkTreeModel    * model;
     63    tr_handle       * handle;
     64    int               nextid;
     65    gboolean          quitting;
     66    gboolean          disposed;
    6767};
    6868
     
    107107
    108108/* Returns the libtransmission handle */
    109 tr_handle_t *
     109tr_handle *
    110110tr_core_handle( TrCore * self );
    111111
  • trunk/gtk/tr_torrent.c

    r2474 r3111  
    226226}
    227227
    228 tr_torrent_t *
     228tr_torrent *
    229229tr_torrent_handle(TrTorrent *tor)
    230230{
     
    234234}
    235235
    236 static tr_stat_t*
     236static tr_stat*
    237237refreshStat( TrTorrent * tor )
    238238{
     
    242242}
    243243
    244 const tr_stat_t *
     244const tr_stat *
    245245tr_torrent_stat(TrTorrent *tor)
    246246{
     
    253253}
    254254
    255 const tr_info_t *
     255const tr_info *
    256256tr_torrent_info(TrTorrent *tor) {
    257257  TR_IS_TORRENT(tor);
     
    282282
    283283static TrTorrent *
    284 maketorrent( tr_torrent_t * handle )
     284maketorrent( tr_torrent * handle )
    285285{
    286286    tr_torrentDisablePex( handle,
     
    293293
    294294TrTorrent*
    295 tr_torrent_new_preexisting( tr_torrent_t * tor )
     295tr_torrent_new_preexisting( tr_torrent * tor )
    296296{
    297297    return maketorrent( tor );
     
    300300
    301301TrTorrent *
    302 tr_torrent_new( tr_handle_t * back, const char *torrent, const char *dir,
     302tr_torrent_new( tr_handle * back, const char *torrent, const char *dir,
    303303                enum tr_torrent_action act, gboolean paused, char **err )
    304304{
    305305  TrTorrent *ret;
    306   tr_torrent_t *handle;
     306  tr_torrent *handle;
    307307  int errcode, flags;
    308308
     
    343343
    344344TrTorrent *
    345 tr_torrent_new_with_data( tr_handle_t * back, uint8_t * data, size_t size,
     345tr_torrent_new_with_data( tr_handle * back, uint8_t * data, size_t size,
    346346                          const char * dir, gboolean paused, char ** err )
    347347{
    348     tr_torrent_t * handle;
    349     int            errcode;
    350     int            flags;
     348    tr_torrent * handle;
     349    int          errcode;
     350    int          flags;
    351351
    352352    g_assert( NULL != dir );
     
    382382
    383383TrTorrent *
    384 tr_torrent_new_with_state( tr_handle_t * back, benc_val_t * state,
     384tr_torrent_new_with_state( tr_handle * back, benc_val_t * state,
    385385                           gboolean forcedpause, char ** err )
    386386{
    387387  TrTorrent * ret;
    388   tr_torrent_t * handle;
     388  tr_torrent * handle;
    389389  int ii, errcode;
    390390  int flags;
     
    456456tr_torrent_get_state( TrTorrent * tor, benc_val_t * state )
    457457{
    458     const tr_info_t * inf;
     458    const tr_info * inf;
    459459
    460460    TR_IS_TORRENT( tor );
     
    527527tr_torrent_check_seeding_cap ( TrTorrent *gtor)
    528528{
    529   const tr_stat_t * st = tr_torrent_stat( gtor );
     529  const tr_stat * st = tr_torrent_stat( gtor );
    530530  if ((gtor->seeding_cap_enabled) && (st->ratio >= gtor->seeding_cap))
    531531    tr_torrent_stop (gtor);
     
    549549    char * top = 0;
    550550
    551     const tr_stat_t * st = tr_torrent_stat( gtor );
     551    const tr_stat * st = tr_torrent_stat( gtor );
    552552
    553553    const int tpeers = MAX (st->peersConnected, 0);
  • trunk/gtk/tr_torrent.h

    r2463 r3111  
    3131#include "util.h"
    3232
    33 /* boxed type for tr_tracker_info_t */
     33/* boxed type for tr_tracker_info */
    3434#define TR_TRACKER_BOXED_TYPE (tr_tracker_boxed_get_type ())
    3535GType
     
    5454struct _TrTorrent {
    5555  GObject parent;
    56   tr_torrent_t *handle;
     56  tr_torrent *handle;
    5757  char *dir;
    5858  char *delfile;
    59   tr_stat_t stat;
     59  tr_stat stat;
    6060  time_t lastStatTime;
    6161
     
    7474tr_torrent_get_type(void);
    7575
    76 tr_torrent_t *
     76tr_torrent *
    7777tr_torrent_handle(TrTorrent *tor);
    7878
    79 const tr_stat_t *
     79const tr_stat *
    8080tr_torrent_stat(TrTorrent *tor);
    8181
    82 const tr_info_t *
     82const tr_info *
    8383tr_torrent_info(TrTorrent *tor);
    8484
     
    100100
    101101TrTorrent *
    102 tr_torrent_new_preexisting( tr_torrent_t * tor );
     102tr_torrent_new_preexisting( tr_torrent * tor );
    103103
    104104TrTorrent *
    105 tr_torrent_new( tr_handle_t * handle, const char * path, const char * dir,
     105tr_torrent_new( tr_handle * handle, const char * path, const char * dir,
    106106                enum tr_torrent_action act, gboolean paused, char ** err);
    107107
    108108TrTorrent *
    109 tr_torrent_new_with_data( tr_handle_t * handle, uint8_t * data, size_t size,
     109tr_torrent_new_with_data( tr_handle * handle, uint8_t * data, size_t size,
    110110                          const char * dir, gboolean paused, char ** err );
    111111
    112112TrTorrent *
    113 tr_torrent_new_with_state( tr_handle_t * handle, benc_val_t * state,
     113tr_torrent_new_with_state( tr_handle * handle, benc_val_t * state,
    114114                           gboolean forcepaused, char ** err );
    115115
  • trunk/libtransmission/completion.c

    r3105 r3111  
    9494{
    9595    const tr_torrent * tor = ccp->tor;
    96     const tr_info_t * info = &tor->info;
     96    const tr_info * info = &tor->info;
    9797    uint64_t have=0, total=0;
    9898    int i;
     
    295295    uint64_t b = 0;
    296296    const tr_torrent * tor = cp->tor;
    297     const tr_info_t * info = &tor->info;
     297    const tr_info * info = &tor->info;
    298298    int i;
    299299
  • trunk/libtransmission/ipcparse.c

    r3105 r3111  
    224224static int          infcmp     ( struct inf *, struct inf * );
    225225static struct msg * msglookup  ( const char * );
    226 static int          filltracker( benc_val_t *, const tr_tracker_info_t * );
     226static int          filltracker( benc_val_t *, const tr_tracker_info * );
    227227static int          handlercmp ( struct msgfunc *, struct msgfunc * );
    228228
     
    13091309
    13101310static int
    1311 filltracker( benc_val_t * val, const tr_tracker_info_t * tk )
     1311filltracker( benc_val_t * val, const tr_tracker_info * tk )
    13121312{
    13131313    tr_bencInit( val, TYPE_DICT );
  • trunk/libtransmission/makemeta.c

    r3105 r3111  
    9999builderFileCompare ( const void * va, const void * vb)
    100100{
    101     const tr_metainfo_builder_file_t * a = (const tr_metainfo_builder_file_t*) va;
    102     const tr_metainfo_builder_file_t * b = (const tr_metainfo_builder_file_t*) vb;
     101    const tr_metainfo_builder_file * a = va;
     102    const tr_metainfo_builder_file * b = vb;
    103103    return strcmp( a->filename, b->filename );
    104104}
    105105
    106 tr_metainfo_builder_t*
    107 tr_metaInfoBuilderCreate( tr_handle_t * handle, const char * topFile )
     106tr_metainfo_builder*
     107tr_metaInfoBuilderCreate( tr_handle * handle, const char * topFile )
    108108{
    109109    int i;
    110110    struct FileList * files;
    111111    struct FileList * walk;
    112     tr_metainfo_builder_t * ret = tr_new0( tr_metainfo_builder_t, 1 );
     112    tr_metainfo_builder * ret = tr_new0( tr_metainfo_builder, 1 );
    113113    ret->top = tr_strdup( topFile );
    114114    ret->handle = handle;
     
    135135        ++ret->fileCount;
    136136
    137     ret->files = tr_new0( tr_metainfo_builder_file_t, ret->fileCount );
     137    ret->files = tr_new0( tr_metainfo_builder_file, ret->fileCount );
    138138
    139139    for( i=0, walk=files; walk!=NULL; ++i )
    140140    {
    141141        struct FileList * tmp = walk;
    142         tr_metainfo_builder_file_t * file = &ret->files[i];
     142        tr_metainfo_builder_file * file = &ret->files[i];
    143143        walk = walk->next;
    144144        file->filename = tmp->filename;
     
    150150    qsort( ret->files,
    151151           ret->fileCount,
    152            sizeof(tr_metainfo_builder_file_t),
     152           sizeof(tr_metainfo_builder_file),
    153153           builderFileCompare );
    154154
     
    164164
    165165void
    166 tr_metaInfoBuilderFree( tr_metainfo_builder_t * builder )
     166tr_metaInfoBuilderFree( tr_metainfo_builder * builder )
    167167{
    168168    if( builder != NULL )
     
    185185
    186186static uint8_t*
    187 getHashInfo ( tr_metainfo_builder_t * b )
     187getHashInfo ( tr_metainfo_builder * b )
    188188{
    189189    int fileIndex = 0;
     
    254254
    255255static void
    256 getFileInfo( const char                        * topFile,
    257              const tr_metainfo_builder_file_t  * file,
    258              benc_val_t                        * uninitialized_length,
    259              benc_val_t                        * uninitialized_path )
     256getFileInfo( const char                      * topFile,
     257             const tr_metainfo_builder_file  * file,
     258             benc_val_t                      * uninitialized_length,
     259             benc_val_t                      * uninitialized_path )
    260260{
    261261    benc_val_t *sub;
     
    295295static void
    296296makeFilesList( benc_val_t                 * list,
    297                const tr_metainfo_builder_t  * builder )
     297               const tr_metainfo_builder  * builder )
    298298{
    299299    int i = 0;
     
    315315
    316316static void
    317 makeInfoDict ( benc_val_t             * dict,
    318                tr_metainfo_builder_t  * builder )
     317makeInfoDict ( benc_val_t           * dict,
     318               tr_metainfo_builder  * builder )
    319319{
    320320    uint8_t * pch;
     
    351351}
    352352
    353 static void tr_realMakeMetaInfo ( tr_metainfo_builder_t * builder )
     353static void tr_realMakeMetaInfo ( tr_metainfo_builder * builder )
    354354{
    355355    int n = 5;
     
    408408***/
    409409
    410 static tr_metainfo_builder_t * queue = NULL;
     410static tr_metainfo_builder * queue = NULL;
    411411
    412412static tr_thread * workerThread = NULL;
    413413
    414 static tr_lock* getQueueLock( tr_handle_t * h )
     414static tr_lock* getQueueLock( tr_handle * h )
    415415{
    416416    static tr_lock * lock = NULL;
     
    426426static void workerFunc( void * user_data )
    427427{
    428     tr_handle_t * handle = (tr_handle_t *) user_data;
     428    tr_handle * handle = (tr_handle *) user_data;
    429429
    430430    for (;;)
    431431    {
    432         tr_metainfo_builder_t * builder = NULL;
     432        tr_metainfo_builder * builder = NULL;
    433433
    434434        /* find the next builder to process */
     
    452452
    453453void
    454 tr_makeMetaInfo( tr_metainfo_builder_t  * builder,
    455                  const char             * outputFile,
    456                  const char             * announce,
    457                  const char             * comment,
    458                  int                      isPrivate )
     454tr_makeMetaInfo( tr_metainfo_builder  * builder,
     455                 const char           * outputFile,
     456                 const char           * announce,
     457                 const char           * comment,
     458                 int                    isPrivate )
    459459{
    460460    tr_lock * lock;
  • trunk/libtransmission/makemeta.h

    r2849 r3111  
    1414#define TR_MAKEMETA_H 1
    1515
    16 typedef struct tr_metainfo_builder_file_s
     16typedef struct tr_metainfo_builder_file
    1717{
    1818    char * filename;
    1919    uint64_t size;
    2020}
    21 tr_metainfo_builder_file_t;
     21tr_metainfo_builder_file;
    2222
    23 typedef struct tr_metainfo_builder_s
     23typedef struct tr_metainfo_builder
    2424{
    2525    /**
     
    2929
    3030    char * top;
    31     tr_metainfo_builder_file_t * files;
     31    tr_metainfo_builder_file * files;
    3232    uint64_t totalSize;
    3333    int fileCount;
     
    3535    int pieceCount;
    3636    int isSingleFile;
    37     tr_handle_t * handle;
     37    tr_handle * handle;
    3838
    3939    /**
     
    6565    **/
    6666
    67     struct tr_metainfo_builder_s * nextBuilder;
     67    struct tr_metainfo_builder * nextBuilder;
    6868}
    69 tr_metainfo_builder_t;
     69tr_metainfo_builder;
    7070
    7171
    72 
    73 
    74 tr_metainfo_builder_t*
    75 tr_metaInfoBuilderCreate( tr_handle_t  * handle,
    76                           const char   * topFile );
     72tr_metainfo_builder*
     73tr_metaInfoBuilderCreate( tr_handle   * handle,
     74                          const char  * topFile );
    7775
    7876void
    79 tr_metaInfoBuilderFree( tr_metainfo_builder_t* );
     77tr_metaInfoBuilderFree( tr_metainfo_builder* );
    8078
    8179/**
     
    9088 */
    9189void
    92 tr_makeMetaInfo( tr_metainfo_builder_t  * builder,
    93                  const char             * outputFile,
    94                  const char             * announce,
    95                  const char             * comment,
    96                  int                      isPrivate );
     90tr_makeMetaInfo( tr_metainfo_builder  * builder,
     91                 const char           * outputFile,
     92                 const char           * announce,
     93                 const char           * comment,
     94                 int                    isPrivate );
    9795
    9896
  • trunk/libtransmission/peer.c

    r3105 r3111  
    10761076}
    10771077void
    1078 tr_swiftPulse( tr_handle_t * h )
     1078tr_swiftPulse( tr_handle * h )
    10791079{
    10801080    static time_t lastPulseTime = 0;
  • trunk/libtransmission/peer.h

    r3105 r3111  
    6363int         tr_peerGetConnectable  ( const struct tr_torrent *, uint8_t ** );
    6464
    65 void        tr_swiftPulse          ( tr_handle_t * );
     65void        tr_swiftPulse          ( tr_handle * );
    6666
    6767#endif
  • trunk/libtransmission/torrent.c

    r3105 r3111  
    3838#include "metainfo.h"
    3939#include "net.h" /* tr_netNtop */
    40 #include "peer.h"
    4140#include "peer-mgr.h"
    4241#include "platform.h"
     
    281280
    282281static void
    283 torrentRealInit( tr_handle_t * h,
    284                  tr_torrent  * tor,
    285                  const char  * destination,
    286                  int           flags )
     282torrentRealInit( tr_handle  * h,
     283                 tr_torrent * tor,
     284                 const char * destination,
     285                 int          flags )
    287286{
    288287    uint64_t loaded;
     
    416415
    417416static int
    418 pathIsInUse ( const tr_handle_t   * h,
    419               const char          * destination,
    420               const char          * name )
     417pathIsInUse ( const tr_handle   * h,
     418              const char        * destination,
     419              const char        * name )
    421420{
    422421    const tr_torrent * tor;
     
    431430
    432431static int
    433 hashExists( const tr_handle_t   * h,
    434             const uint8_t       * hash )
     432hashExists( const tr_handle   * h,
     433            const uint8_t     * hash )
    435434{
    436435    const tr_torrent * tor;
     
    444443
    445444static int
    446 infoCanAdd( const tr_handle_t   * h,
    447             const char          * destination,
     445infoCanAdd( const tr_handle   * h,
     446            const char        * destination,
    448447            const tr_info     * info )
    449448{
     
    458457
    459458int
    460 tr_torrentParse( const tr_handle_t  * h,
    461                  const char         * path,
    462                  const char         * destination,
     459tr_torrentParse( const tr_handle  * h,
     460                 const char       * path,
     461                 const char       * destination,
    463462                 tr_info          * setme_info )
    464463{
     
    483482 
    484483tr_torrent *
    485 tr_torrentInit( tr_handle_t   * h,
    486                 const char    * path,
    487                 const char    * destination,
    488                 int             flags,
    489                 int           * error )
     484tr_torrentInit( tr_handle   * h,
     485                const char  * path,
     486                const char  * destination,
     487                int           flags,
     488                int         * error )
    490489{
    491490    int val;
     
    509508
    510509int
    511 tr_torrentParseHash( const tr_handle_t  * h,
    512                      const char         * hashStr,
    513                      const char         * destination,
     510tr_torrentParseHash( const tr_handle  * h,
     511                     const char       * hashStr,
     512                     const char       * destination,
    514513                     tr_info          * setme_info )
    515514{
     
    534533
    535534tr_torrent *
    536 tr_torrentInitSaved( tr_handle_t    * h,
    537                      const char     * hashStr,
    538                      const char     * destination,
    539                      int              flags,
    540                      int            * error )
     535tr_torrentInitSaved( tr_handle    * h,
     536                     const char   * hashStr,
     537                     const char   * destination,
     538                     int            flags,
     539                     int          * error )
    541540{
    542541    int val;
     
    560559
    561560static int
    562 tr_torrentParseData( const tr_handle_t  * h,
    563                      const uint8_t      * data,
    564                      size_t               size,
    565                      const char         * destination,
     561tr_torrentParseData( const tr_handle  * h,
     562                     const uint8_t    * data,
     563                     size_t             size,
     564                     const char       * destination,
    566565                     tr_info          * setme_info )
    567566{
     
    586585
    587586tr_torrent *
    588 tr_torrentInitData( tr_handle_t    * h,
     587tr_torrentInitData( tr_handle      * h,
    589588                    const uint8_t  * data,
    590589                    size_t           size,
     
    10041003{
    10051004    tr_torrent * t;
    1006     tr_handle_t * h = tor->handle;
     1005    tr_handle * h = tor->handle;
    10071006    tr_info * inf = &tor->info;
    10081007fprintf( stderr, "closing torrent %s\n", tor->info.name );
  • trunk/libtransmission/tracker.c

    r3105 r3111  
    6363typedef struct
    6464{
    65     tr_handle_t * handle;
     65    tr_handle * handle;
    6666
    6767    tr_ptrArray * torrents;
  • trunk/libtransmission/transmission.c

    r3105 r3111  
    104104 * tr_init
    105105 ***********************************************************************
    106  * Allocates a tr_handle_t structure and initializes a few things
     106 * Allocates a tr_handle structure and initializes a few things
    107107 **********************************************************************/
    108 tr_handle_t * tr_init( const char * tag )
    109 {
    110     tr_handle_t * h;
    111     int           i;
     108tr_handle * tr_init( const char * tag )
     109{
     110    tr_handle * h;
     111    int         i;
    112112
    113113#ifndef WIN32
     
    118118    tr_msgInit();
    119119
    120     h = tr_new0( tr_handle_t, 1 );
     120    h = tr_new0( tr_handle, 1 );
    121121    if( !h )
    122122        return NULL;
     
    159159 *
    160160 **********************************************************************/
    161 void tr_setBindPort( tr_handle_t * h, int port )
     161void tr_setBindPort( tr_handle * h, int port )
    162162{
    163163    h->isPortSet = 1;
     
    166166
    167167int
    168 tr_getPublicPort( const tr_handle_t * h )
     168tr_getPublicPort( const tr_handle * h )
    169169{
    170170    assert( h != NULL );
     
    172172}
    173173
    174 void tr_natTraversalEnable( tr_handle_t * h, int enable )
     174void tr_natTraversalEnable( tr_handle * h, int enable )
    175175{
    176176    tr_sharedLock( h->shared );
     
    179179}
    180180
    181 tr_handle_status * tr_handleStatus( tr_handle_t * h )
     181tr_handle_status * tr_handleStatus( tr_handle * h )
    182182{
    183183    tr_handle_status * s;
     
    201201
    202202void
    203 tr_setUseGlobalSpeedLimit( tr_handle_t  * h,
    204                            int            up_or_down,
    205                            int            use_flag )
     203tr_setUseGlobalSpeedLimit( tr_handle  * h,
     204                           int          up_or_down,
     205                           int          use_flag )
    206206{
    207207    char * ch = up_or_down==TR_UP ? &h->useUploadLimit
     
    211211
    212212void
    213 tr_setGlobalSpeedLimit( tr_handle_t  * h,
    214                         int            up_or_down,
    215                         int            KiB_sec )
     213tr_setGlobalSpeedLimit( tr_handle  * h,
     214                        int          up_or_down,
     215                        int          KiB_sec )
    216216{
    217217    if( up_or_down == TR_DOWN )
     
    222222
    223223void
    224 tr_getGlobalSpeedLimit( tr_handle_t  * h,
    225                         int            up_or_down,
    226                         int          * setme_enabled,
     224tr_getGlobalSpeedLimit( tr_handle  * h,
     225                        int          up_or_down,
     226                        int        * setme_enabled,
    227227                        int          * setme_KiBsec )
    228228{
     
    236236
    237237
    238 void tr_torrentRates( tr_handle_t * h, float * dl, float * ul )
     238void tr_torrentRates( tr_handle * h, float * dl, float * ul )
    239239{
    240240    tr_torrent * tor;
     
    254254}
    255255
    256 int tr_torrentCount( tr_handle_t * h )
     256int tr_torrentCount( tr_handle * h )
    257257{
    258258    return h->torrentCount;
    259259}
    260260
    261 void tr_torrentIterate( tr_handle_t * h, tr_callback_t func, void * d )
     261void tr_torrentIterate( tr_handle * h, tr_callback_t func, void * d )
    262262{
    263263    tr_torrent * tor, * next;
     
    273273tr_closeImpl( void * vh )
    274274{
    275     tr_handle_t * h = vh;
     275    tr_handle * h = vh;
    276276fprintf( stderr, "in tr_closeImpl\n" );
    277277    tr_peerMgrFree( h->peerMgr );
     
    290290}
    291291void
    292 tr_close( tr_handle_t * h )
     292tr_close( tr_handle * h )
    293293{
    294294    fprintf( stderr, "torrentCount is %d\n", h->torrentCount );
     
    311311
    312312tr_torrent **
    313 tr_loadTorrents ( tr_handle_t   * h,
    314                   const char    * destination,
    315                   int             flags,
    316                   int          * setmeCount )
     313tr_loadTorrents ( tr_handle   * h,
     314                  const char  * destination,
     315                  int           flags,
     316                  int         * setmeCount )
    317317{
    318318    int i, n = 0;
  • trunk/libtransmission/transmission.h

    r3105 r3111  
    104104
    105105typedef struct tr_handle tr_handle;
    106 typedef struct tr_handle tr_handle_t;
    107106
    108107tr_handle * tr_init( const char * tag );
    109108
    110109typedef struct tr_tracker_info tr_tracker_info;
    111 typedef struct tr_tracker_info tr_tracker_info_t;
    112110
    113111/**
     
    143141 **********************************************************************/
    144142typedef struct tr_msg_list tr_msg_list;
    145 typedef struct tr_msg_list tr_msg_list_t;
    146143void tr_setMessageQueuing( int );
    147144
     
    186183 **********************************************************************/
    187184typedef struct tr_handle_status tr_handle_status;
    188 typedef struct tr_handle_status tr_handle_status_t;
    189185tr_handle_status * tr_handleStatus( tr_handle * );
    190186
     
    204200 **********************************************************************/
    205201typedef struct tr_torrent tr_torrent;
    206 typedef struct tr_torrent tr_torrent_t;
    207202typedef void (*tr_callback_t) ( tr_torrent *, void * );
    208203void tr_torrentIterate( tr_handle *, tr_callback_t, void * );
     
    343338
    344339typedef struct tr_info tr_info;
    345 typedef struct tr_info tr_info_t;
    346340
    347341/**
     
    486480 **********************************************************************/
    487481typedef struct tr_stat tr_stat;
    488 typedef struct tr_stat tr_stat_t;
    489482const tr_stat * tr_torrentStat( tr_torrent * );
    490483
     
    493486 ***********************************************************************/
    494487typedef struct tr_peer_stat tr_peer_stat;
    495 typedef struct tr_peer_stat tr_peer_stat_t;
    496488tr_peer_stat * tr_torrentPeers( const tr_torrent *, int * peerCount );
    497489void tr_torrentPeersFree( tr_peer_stat *, int peerCount );
    498490
    499491typedef struct tr_file_stat tr_file_stat;
    500 typedef struct tr_file_stat tr_file_stat_t;
    501492tr_file_stat * tr_torrentFiles( const tr_torrent *, int * fileCount );
    502493void tr_torrentFilesFree( tr_file_stat *, int fileCount );
  • trunk/libtransmission/trevent.c

    r3105 r3111  
    4545{
    4646    tr_lock * lock;
    47     tr_handle_t * h;
     47    tr_handle * h;
    4848    tr_thread * thread;
    4949    tr_list * commands;
     
    224224
    225225void
    226 tr_eventInit( tr_handle_t * handle )
     226tr_eventInit( tr_handle * handle )
    227227{
    228228    tr_event_handle * eh;
     
    236236
    237237void
    238 tr_eventClose( tr_handle_t * handle )
     238tr_eventClose( tr_handle * handle )
    239239{
    240240    tr_event_handle * eh = handle->events;
     
    262262
    263263void
    264 tr_evhttp_make_request (tr_handle_t               * handle,
     264tr_evhttp_make_request (tr_handle                 * handle,
    265265                        struct evhttp_connection  * evcon,
    266266                        struct evhttp_request     * req,
     
    283283
    284284void
    285 tr_bufferevent_write( tr_handle_t           * handle,
     285tr_bufferevent_write( tr_handle             * handle,
    286286                      struct bufferevent    * bufev,
    287287                      const void            * buf,
Note: See TracChangeset for help on using the changeset viewer.