Changeset 2328


Ignore:
Timestamp:
Jul 12, 2007, 5:51:45 PM (15 years ago)
Author:
charles
Message:

clean up #includes a bit.

Location:
trunk/libtransmission
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r2311 r2328  
    2323 *****************************************************************************/
    2424
    25 #include <ctype.h> /* for isdigit */
     25#include <ctype.h> /* isdigit, isprint */
     26#include <stdarg.h>
    2627#include "transmission.h"
    2728#include "bencode.h"
  • trunk/libtransmission/clients.c

    r1895 r2328  
    2323 *****************************************************************************/
    2424
     25#include <ctype.h> /* isprint */
    2526#include "transmission.h"
    2627
  • trunk/libtransmission/fastresume.c

    r2321 r2328  
    4242 **********************************************************************/
    4343
     44#include <sys/types.h>
     45#include <sys/stat.h>
     46#include <unistd.h>
    4447#include "transmission.h"
    4548#include "fastresume.h"
  • trunk/libtransmission/fdlimit.c

    r2154 r2328  
    2323 *****************************************************************************/
    2424
     25#include <fcntl.h>
     26#include <unistd.h>
    2527#include "transmission.h"
    2628
  • trunk/libtransmission/http.c

    r2325 r2328  
    2323 *****************************************************************************/
    2424
     25#include <stdarg.h>
    2526#include "transmission.h"
    2627#include "http.h"
  • trunk/libtransmission/inout.c

    r2315 r2328  
    99 */
    1010
     11#include <sys/types.h>
     12#include <sys/stat.h>
     13#include <unistd.h>
    1114#include "transmission.h"
    1215#include "fastresume.h"
  • trunk/libtransmission/internal.h

    r2311 r2328  
    3333#endif
    3434#include <stdio.h>
    35 #include <stdarg.h>
    3635#ifdef SYS_BEOS
    3736/* BeOS doesn't declare vasprintf in its headers, but actually
     
    4140#include <stdlib.h>
    4241#include <string.h>
    43 #include <unistd.h>
    44 #include <ctype.h>
    4542#include <errno.h>
    46 #include <limits.h>
    47 #include <signal.h>
    4843#include <time.h>
    49 #include <sys/time.h>
    50 #include <sys/types.h>
    51 #include <sys/stat.h>
    5244#ifndef __AMIGAOS4__
    5345#include <sys/resource.h>
    5446#endif
    55 #include <netdb.h>
    56 #include <sys/socket.h>
    57 #include <netinet/in.h>
    58 #include <fcntl.h>
    5947#include <assert.h>
    6048#ifdef SYS_BEOS
  • trunk/libtransmission/ipcparse.c

    r2259 r2328  
    2525#include <assert.h>
    2626#include <errno.h>
     27#include <limits.h>
    2728#include <stdio.h>
    2829#include <stdlib.h>
  • trunk/libtransmission/metainfo.c

    r2311 r2328  
    2323 *****************************************************************************/
    2424
     25#include <sys/types.h>
     26#include <sys/stat.h>
     27#include <unistd.h> /* unlink, stat */
    2528#include "transmission.h"
    2629#include "bencode.h"
    27 #include "http.h" /* for tr_httpParseUrl */
     30#include "http.h" /* tr_httpParseUrl */
    2831#include "metainfo.h"
    2932
  • trunk/libtransmission/net.c

    r2311 r2328  
    2323 *****************************************************************************/
    2424
     25#include <netdb.h>
     26#include <sys/socket.h>
     27#include <netinet/in.h>
     28#include <fcntl.h>
    2529#include "transmission.h"
    2630#include "fdlimit.h"
  • trunk/libtransmission/peer.c

    r2314 r2328  
    2323 *****************************************************************************/
    2424
     25#include <stdarg.h>
    2526#include "transmission.h"
    2627#include "bencode.h"
  • trunk/libtransmission/platform.c

    r2323 r2328  
    2929#include <sys/types.h>
    3030#include <dirent.h>
    31 
     31#include <fcntl.h>
     32#include <unistd.h> /* getuid getpid close */
    3233#include "transmission.h"
    3334
  • trunk/libtransmission/ratecontrol.h

    r2303 r2328  
    2323 *****************************************************************************/
    2424
     25#ifndef _TR_RATECONTROL_H_
     26#define _TR_RATECONTROL_H_
     27
    2528typedef struct tr_ratecontrol_s tr_ratecontrol_t;
    2629
     
    3235void               tr_rcReset( tr_ratecontrol_t * );
    3336void               tr_rcClose( tr_ratecontrol_t * );
     37
     38#endif
  • trunk/libtransmission/transmission.c

    r2325 r2328  
    2323 *****************************************************************************/
    2424
     25#include <signal.h>
    2526#include "transmission.h"
    2627#include "fdlimit.h"
  • trunk/libtransmission/upnp.c

    r2311 r2328  
    2323 *****************************************************************************/
    2424
     25#include <stdarg.h>
    2526#include "transmission.h"
    2627#include "http.h"
  • trunk/libtransmission/utils.c

    r2297 r2328  
    2424
    2525#include <ctype.h>
     26#include <stdarg.h>
     27#include <sys/time.h>
     28#include <sys/types.h>
     29#include <sys/stat.h>
     30#include <unistd.h> /* usleep, stat */
    2631#include "transmission.h"
    2732
     
    594599    return ret;
    595600}
     601
     602/***
     603****
     604***/
     605
     606uint64_t
     607tr_date( void )
     608{
     609    struct timeval tv;
     610    gettimeofday( &tv, NULL );
     611    return (uint64_t) tv.tv_sec * 1000 + ( tv.tv_usec / 1000 );
     612}
     613
     614void
     615tr_wait( uint64_t delay_msec )
     616{
     617#ifdef SYS_BEOS
     618    snooze( 1000 * delay_msec );
     619#else
     620    usleep( 1000 * delay_msec );
     621#endif
     622}
  • trunk/libtransmission/utils.h

    r2231 r2328  
    7777char * tr_errorString( int code );
    7878
    79 /***********************************************************************
    80  * tr_date
    81  ***********************************************************************
    82  * Returns the current date in milliseconds
    83  **********************************************************************/
    84 static inline uint64_t tr_date()
    85 {
    86     struct timeval tv;
    87     gettimeofday( &tv, NULL );
    88     return (uint64_t) tv.tv_sec * 1000 + ( tv.tv_usec / 1000 );
    89 }
    90 
    91 /***********************************************************************
    92  * tr_wait
    93  ***********************************************************************
    94  * Wait 'delay' milliseconds
    95  **********************************************************************/
    96 static inline void tr_wait( uint64_t delay )
    97 {
    98 #ifdef SYS_BEOS
    99     snooze( 1000 * delay );
    100 #else
    101     usleep( 1000 * delay );
    102 #endif
    103 }
    104 
     79/* return the current date in milliseconds */
     80uint64_t tr_date( void );
     81
     82/* wait the specified number of milliseconds */
     83void tr_wait( uint64_t delay_milliseconds );
    10584
    10685#define tr_blockPiece(a) _tr_blockPiece(tor,a)
Note: See TracChangeset for help on using the changeset viewer.