Ignore:
Timestamp:
Aug 20, 2006, 6:15:25 PM (15 years ago)
Author:
joshe
Message:

Allow frontend to change message output level.
Rename tr_setErrorFunction() to tr_setMessageFunction()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r626 r798  
    2525#include "transmission.h"
    2626
    27 static void (*errorFunc)( const char * );
     27static void (*messageFunc)( const char * );
    2828
    29 void tr_setErrorFunction( void (*func)( const char * ) )
     29static int verboseLevel = 0;
     30
     31void tr_setMessageFunction( void (*func)( const char * ) )
    3032{
    31     errorFunc = func;
     33    messageFunc = func;
     34}
     35
     36void tr_setMessageLevel( int level )
     37{
     38    verboseLevel = level;
     39}
     40
     41int tr_getMessageLevel( void )
     42{
     43    return verboseLevel;
    3244}
    3345
     
    3648    char         string[256];
    3749    va_list      args;
    38     static int   verboseLevel = 0;
    3950
    4051    if( !verboseLevel )
     
    5970    va_end( args );
    6071
    61     if( NULL == errorFunc )
     72    if( NULL == messageFunc )
    6273    {
    6374        fprintf( stderr, "%s\n", string );
     
    6576    else
    6677    {
    67         errorFunc( string );
     78        messageFunc( string );
    6879    }
    6980}
Note: See TracChangeset for help on using the changeset viewer.