Changeset 6948
- Timestamp:
- Oct 22, 2008, 6:42:37 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/actions.c
r6870 r6948 21 21 #include "lock.h" 22 22 #include "logo.h" 23 24 #define UNUSED G_GNUC_UNUSED25 23 26 24 static TrCore * myCore = NULL; -
trunk/libtransmission/Makefile.am
r6924 r6948 89 89 tracker.h \ 90 90 tr-getopt.h \ 91 tr-gnuc.h \ 91 92 transmission.h \ 92 93 trevent.h \ -
trunk/libtransmission/blocklist.h
r6795 r6948 14 14 #define TR_BLOCKLIST_H 15 15 16 #include "tr-gnuc.h" 17 16 18 struct in_addr; 17 19 typedef struct tr_blocklist tr_blocklist; 18 20 19 21 tr_blocklist* _tr_blocklistNew( const char * filename, 20 int isEnabled ) ;22 int isEnabled ) TR_GNUC_MALLOC; 21 23 22 int _tr_blocklistExists ( const tr_blocklist *);24 int _tr_blocklistExists ( const tr_blocklist * blocklist ); 23 25 24 const char* _tr_blocklistGetFilename ( const tr_blocklist *);26 const char* _tr_blocklistGetFilename ( const tr_blocklist * blocklist ); 25 27 26 int _tr_blocklistGetRuleCount( const tr_blocklist *);28 int _tr_blocklistGetRuleCount( const tr_blocklist * blocklist ); 27 29 28 void _tr_blocklistFree ( tr_blocklist *);30 void _tr_blocklistFree ( tr_blocklist * blocklist ); 29 31 30 int _tr_blocklistIsEnabled ( tr_blocklist *);32 int _tr_blocklistIsEnabled ( tr_blocklist * blocklist ); 31 33 32 void _tr_blocklistSetEnabled ( tr_blocklist *,33 intisEnabled );34 void _tr_blocklistSetEnabled ( tr_blocklist * blocklist, 35 int isEnabled ); 34 36 35 int _tr_blocklistHasAddress( 36 tr_blocklist *, 37 const struct 38 in_addr * addr ); 37 int _tr_blocklistHasAddress ( tr_blocklist * blocklist, 38 const struct in_addr * addr ); 39 39 40 int _tr_blocklistSetContent( 41 tr_blocklist *, 42 const char * filename ); 40 int _tr_blocklistSetContent ( tr_blocklist * blocklist, 41 const char * filename ); 43 42 44 43 #endif -
trunk/libtransmission/handshake.h
r6795 r6948 30 30 tr_encryption_mode encryptionMode, 31 31 handshakeDoneCB doneCB, 32 void * doneUserData ); 32 void * doneUserData ) 33 TR_GNUC_MALLOC; 33 34 34 35 const struct in_addr * tr_handshakeGetAddr( 35 const struct tr_handshake * handshake, 36 uint16_t 37 * setme_port ); 36 const struct tr_handshake * handshake, 37 uint16_t * setme_port ); 38 38 39 39 void tr_handshakeAbort( tr_handshake * handshake ); -
trunk/libtransmission/peer-io.h
r6795 r6948 18 18 **/ 19 19 20 #include "tr-gnuc.h" 21 20 22 struct in_addr; 21 23 struct evbuffer; … … 29 31 **/ 30 32 31 tr_peerIo* tr_peerIoNewOutgoing(32 struct tr_handle * session,33 const struct in_addr * addr,34 int port,35 const uint8_t *36 torrentHash ); 37 38 tr_peerIo* tr_peerIoNewIncoming( struct tr_handle * session,39 const struct in_addr * addr,40 uint16_t port,41 int socket );33 tr_peerIo* tr_peerIoNewOutgoing( struct tr_handle * session, 34 const struct in_addr * addr, 35 int port, 36 const uint8_t * torrentHash ) 37 TR_GNUC_MALLOC; 38 39 tr_peerIo* tr_peerIoNewIncoming( struct tr_handle * session, 40 const struct in_addr * addr, 41 uint16_t port, 42 int socket ) 43 TR_GNUC_MALLOC; 42 44 43 45 void tr_peerIoFree( tr_peerIo * io ); … … 69 71 70 72 const struct in_addr*tr_peerIoGetAddress( const tr_peerIo * io, 71 uint16_t* port );73 uint16_t * port ); 72 74 73 75 const uint8_t* tr_peerIoGetTorrentHash( tr_peerIo * io ); … … 75 77 int tr_peerIoHasTorrentHash( const tr_peerIo * io ); 76 78 77 void tr_peerIoSetTorrentHash( tr_peerIo *io,79 void tr_peerIoSetTorrentHash( tr_peerIo * io, 78 80 const uint8_t * hash ); 79 81 … … 122 124 tr_direction ); 123 125 124 #if 0125 void tr_peerIoTryRead( tr_peerIo * io );126 127 #endif128 129 126 void tr_peerIoWrite( tr_peerIo * io, 130 127 const void * writeme, -
trunk/libtransmission/peer-mgr.h
r6931 r6948 16 16 #include <inttypes.h> /* uint16_t */ 17 17 18 #ifdef WIN32 19 #include <winsock2.h> /* struct in_addr */ 20 #else 21 #include <netinet/in.h> /* struct in_addr */ 22 #endif 18 #include "net.h" /* struct in_addr */ 19 #include "tr-gnuc.h" 23 20 24 21 struct in_addr; … … 47 44 int tr_pexCompare( const void * a, const void * b ); 48 45 49 tr_peerMgr* tr_peerMgrNew( struct tr_handle * ) ;46 tr_peerMgr* tr_peerMgrNew( struct tr_handle * ) TR_GNUC_MALLOC; 50 47 51 48 void tr_peerMgrFree( tr_peerMgr * manager ); -
trunk/libtransmission/session.h
r6842 r6948 28 28 #define TR_NAME "Transmission" 29 29 30 #ifndef UNUSED 31 #ifdef __GNUC__ 32 #define UNUSED __attribute__ ( ( unused ) ) 33 #else 34 #define UNUSED 35 #endif 36 #endif 30 #include "tr-gnuc.h" 37 31 38 32 enum … … 48 42 typedef enum { TR_NET_OK, TR_NET_ERROR, TR_NET_WAIT } tr_tristate_t; 49 43 50 uint8_t* tr_peerIdNew( void ) ;44 uint8_t* tr_peerIdNew( void ) TR_GNUC_MALLOC; 51 45 52 46 const uint8_t* tr_getPeerId( void ); -
trunk/libtransmission/transmission.h
r6946 r6948 37 37 #endif 38 38 39 #include "tr-gnuc.h" 39 40 #include "version.h" 40 41 … … 728 729 struct tr_benc; 729 730 730 tr_ctor* tr_ctorNew( const tr_handle * handle ) ;731 tr_ctor* tr_ctorNew( const tr_handle * handle ) TR_GNUC_MALLOC; 731 732 732 733 void tr_ctorFree( tr_ctor * ctor ); … … 810 811 tr_torrent * tr_torrentNew( tr_handle * handle, 811 812 const tr_ctor * ctor, 812 int * setmeError ) ;813 int * setmeError ) TR_GNUC_MALLOC; 813 814 814 815 /** @} */ -
trunk/libtransmission/utils.h
r6946 r6948 48 48 #endif 49 49 50 #ifndef UNUSED 51 #ifdef __GNUC__ 52 #define UNUSED __attribute__ ( ( unused ) ) 53 #else 54 #define UNUSED 55 #endif 56 #endif 57 58 #ifndef TR_GNUC_PRINTF 59 #ifdef __GNUC__ 60 #define TR_GNUC_PRINTF( fmt,\ 61 args ) __attribute__ ( ( format ( printf, fmt,\ 62 args ) ) ) 63 #else 64 #define TR_GNUC_PRINTF( fmt, args ) 65 #endif 66 #endif 67 68 #ifndef TR_GNUC_NULL_TERMINATED 69 #if __GNUC__ >= 4 70 #define TR_GNUC_NULL_TERMINATED __attribute__ ( ( __sentinel__ ) ) 71 #else 72 #define TR_GNUC_NULL_TERMINATED 73 #endif 74 #endif 75 76 #if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 ) 77 #define TR_GNUC_PURE __attribute__ ( ( __pure__ ) ) 78 #define TR_GNUC_MALLOC __attribute__ ( ( __malloc__ ) ) 79 #else 80 #define TR_GNUC_PURE 81 #define TR_GNUC_MALLOC 82 #endif 83 50 #include "tr-gnuc.h" 84 51 85 52 /*** … … 193 160 194 161 /* return the current date in milliseconds */ 195 uint64_t tr_date( void ) ;162 uint64_t tr_date( void ) TR_GNUC_CONST; 196 163 197 164 /* wait the specified number of milliseconds */ 198 void tr_wait( uint64_t delay_milliseconds ) ;165 void tr_wait( uint64_t delay_milliseconds ) TR_GNUC_CONST; 199 166 200 167 /*** … … 263 230 ... ) TR_GNUC_PRINTF( 3, 4 ); 264 231 265 const char* tr_strerror( int ) ;232 const char* tr_strerror( int ) TR_GNUC_CONST; 266 233 267 234 char* tr_strstrip( char * str ); … … 360 327 361 328 double tr_getRatio( double numerator, 362 double denominator ) ;329 double denominator ) TR_GNUC_CONST; 363 330 364 331 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.