Ignore:
Timestamp:
Jul 4, 2010, 6:07:21 AM (11 years ago)
Author:
charles
Message:

(trunk) #3045 "speed units" -- change the public API of libtransmission based on feedback from livings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r10931 r10937  
    15831583
    15841584char*
    1585 tr_formatter_size( char * buf, uint64_t bytes, size_t buflen )
     1585tr_formatter_size_B( char * buf, uint64_t bytes, size_t buflen )
    15861586{
    15871587    return formatter_get_size_str( &size_units, buf, bytes, buflen );
     
    15891589
    15901590static struct formatter_units speed_units;
     1591
     1592unsigned int tr_speed_K = 0u;
    15911593
    15921594void
     
    15951597                         const char * mb, const char * gb )
    15961598{
     1599    tr_speed_K = kilo;
    15971600    formatter_init( &speed_units, kilo, b, kb, mb, gb );
    15981601}
    15991602
    16001603char*
    1601 tr_formatter_speed( char * buf, uint64_t bytes_per_second, size_t buflen )
    1602 {
    1603     return formatter_get_size_str( &speed_units, buf, bytes_per_second, buflen );
    1604 }
    1605 
    1606 unsigned int
    1607 tr_formatter_speed_k( void )
    1608 {
    1609     return speed_units.units[TR_FMT_KB].value;
     1604tr_formatter_speed_Bps( char * buf, uint64_t bytes_per_second, size_t buflen )
     1605{
     1606    formatter_get_size_str( &speed_units, buf, bytes_per_second, buflen );
     1607    return buf;
    16101608}
    16111609
    16121610static struct formatter_units mem_units;
    16131611
     1612unsigned int tr_mem_K = 0u;
     1613 
    16141614void
    16151615tr_formatter_mem_init( unsigned int kilo,
     
    16171617                       const char * mb, const char * gb )
    16181618{
     1619    tr_mem_K = kilo;
    16191620    formatter_init( &mem_units, kilo, b, kb, mb, gb );
    16201621}
    16211622
    16221623char*
    1623 tr_formatter_mem( char * buf, uint64_t bytes_per_second, size_t buflen )
     1624tr_formatter_mem_B( char * buf, uint64_t bytes_per_second, size_t buflen )
    16241625{
    16251626    return formatter_get_size_str( &mem_units, buf, bytes_per_second, buflen );
Note: See TracChangeset for help on using the changeset viewer.