Changeset 11614


Ignore:
Timestamp:
Dec 31, 2010, 1:30:35 AM (11 years ago)
Author:
charles
Message:

(trunk libT) since messageLevel is a global variable, giving it a unique "tr_" prefix is a nice safeguard

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.h

    r11599 r11614  
    757757void tr_setMessageLevel( tr_msg_level );
    758758
    759 tr_msg_level tr_getMessageLevel( void );
    760 
    761759typedef struct tr_msg_list
    762760{
  • trunk/libtransmission/utils.c

    r11599 r11614  
    6464
    6565
    66 time_t transmission_now = 0;
    67 
    68 tr_msg_level messageLevel = TR_MSG_ERR;
     66time_t       __tr_current_time  = 0;
     67tr_msg_level __tr_message_level  = TR_MSG_ERR;
     68
    6969static tr_bool        messageQueuing = FALSE;
    7070static tr_msg_list *  messageQueue = NULL;
     
    125125tr_setMessageLevel( tr_msg_level level )
    126126{
    127     messageLevel = level;
    128 }
    129 
    130 tr_msg_level
    131 tr_getMessageLevel( void )
    132 {
    133     return messageLevel;
     127    __tr_message_level = level;
    134128}
    135129
  • trunk/libtransmission/utils.h

    r11599 r11614  
    117117#define TR_MAX_MSG_LOG 10000
    118118
    119 extern tr_msg_level messageLevel;
     119extern tr_msg_level __tr_message_level;
     120
     121static inline tr_msg_level tr_getMessageLevel( void )
     122{
     123    return __tr_message_level;
     124}
    120125
    121126static inline tr_bool tr_msgLoggingIsActive( tr_msg_level level )
    122127{
    123     return messageLevel >= level;
     128    return tr_getMessageLevel() >= level;
    124129}
    125130
     
    532537
    533538/** @brief Private libtransmission variable that's visible only for inlining in tr_time() */
    534 extern time_t transmission_now;
     539extern time_t __tr_current_time;
    535540
    536541/**
     
    544549 * isn't needed
    545550 */
    546 static inline time_t tr_time( void ) { return transmission_now; }
     551static inline time_t tr_time( void ) { return __tr_current_time; }
    547552
    548553/** @brief Private libtransmission function to update tr_time()'s counter */
    549 static inline void tr_timeUpdate( time_t now ) { transmission_now = now; }
     554static inline void tr_timeUpdate( time_t now ) { __tr_current_time = now; }
    550555
    551556/** @brief Portability wrapper for realpath() that uses the system implementation if available */
Note: See TracChangeset for help on using the changeset viewer.