Changeset 6500 for trunk/licq
- Timestamp:
- 08/27/08 01:04:27 (3 months ago)
- Location:
- trunk/licq
- Files:
-
- 3 modified
-
include/licq_icqd.h (modified) (16 diffs)
-
src/fifo.cpp (modified) (2 diffs)
-
src/icqd.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/licq/include/licq_icqd.h
r6467 r6500 87 87 // Accessors 88 88 //! Total number of events. 89 unsigned long Total() { return m_nTotal; }89 unsigned long Total() const { return m_nTotal; } 90 90 //! Total number of events for the current day only. 91 unsigned long Today() { return m_nTotal - m_nOriginal; }91 unsigned long Today() const { return m_nTotal - m_nOriginal; } 92 92 //! Name of the kind of statistic. 93 const char *Name(){ return m_szName; }93 const char* Name() const { return m_szName; } 94 94 95 95 protected: … … 97 97 CDaemonStats(const char *, const char *); 98 98 99 bool Dirty() { return m_nLastSaved != m_nTotal; }99 bool Dirty() const { return m_nLastSaved != m_nTotal; } 100 100 void ClearDirty() { m_nLastSaved = m_nTotal; } 101 101 … … 129 129 public: 130 130 bool HasUser(const char *sz); 131 bool IsEmpty() { return m_vUsers.size() == 0; }132 int NumUsers() { return m_vUsers.size(); }133 134 int Socket() { return m_nSocket; }135 unsigned long CID() { return m_nCID; }136 137 std::string GetUser(int n) { return m_vUsers[n]; }131 bool IsEmpty() const { return m_vUsers.size() == 0; } 132 int NumUsers() const { return m_vUsers.size(); } 133 134 int Socket() const { return m_nSocket; } 135 unsigned long CID() const { return m_nCID; } 136 137 std::string GetUser(int n) const { return m_vUsers[n]; } 138 138 139 139 private: … … 197 197 void UnregisterPlugin(); 198 198 bool Start(); 199 const char *Version();199 const char* Version() const; 200 200 pthread_t *Shutdown(); 201 201 void SaveConf(); … … 534 534 int RegisterProtoPlugin(); 535 535 void UnregisterProtoPlugin(); 536 c har *ProtoPluginName(unsigned long);537 538 EDaemonStatus Status() { return m_eStatus; }536 const char* ProtoPluginName(unsigned long ppid) const; 537 538 EDaemonStatus Status() const { return m_eStatus; } 539 539 540 540 void PluginUIViewEvent(const char *szId, unsigned long nPPID ) { … … 566 566 567 567 // NOT MT SAFE 568 const char *getUrlViewer();568 const char* getUrlViewer() const; 569 569 void setUrlViewer(const char *s); 570 570 … … 572 572 573 573 // ICQ Server options 574 const char *ICQServer() { return m_szICQServer;}574 const char* ICQServer() const { return m_szICQServer; } 575 575 void SetICQServer(const char *s) { SetString(&m_szICQServer, s); } 576 unsigned short ICQServerPort() { return m_nICQServerPort;}576 unsigned short ICQServerPort() const { return m_nICQServerPort; } 577 577 void SetICQServerPort(unsigned short p) { m_nICQServerPort = p; } 578 578 579 579 // Firewall options 580 bool TCPEnabled() { return m_bTCPEnabled; }580 bool TCPEnabled() const { return m_bTCPEnabled; } 581 581 void SetTCPEnabled(bool b) { m_bTCPEnabled = b; SetDirectMode(); } 582 bool Firewall() { return m_bFirewall; }582 bool Firewall() const { return m_bFirewall; } 583 583 void SetFirewall(bool b) { m_bFirewall = b; SetDirectMode(); } 584 584 void SetDirectMode(); … … 587 587 void InitProxy(); 588 588 ProxyServer *CreateProxy(); 589 bool ProxyEnabled() { return m_bProxyEnabled;}589 bool ProxyEnabled() const { return m_bProxyEnabled; } 590 590 ProxyServer *GetProxy() { return m_xProxy; } 591 591 void SetProxyEnabled(bool b) { m_bProxyEnabled = b; } 592 unsigned short ProxyType() { return m_nProxyType;}592 unsigned short ProxyType() const { return m_nProxyType; } 593 593 void SetProxyType(unsigned short t) { m_nProxyType = t; } 594 const char *ProxyHost() { return m_szProxyHost;}594 const char* ProxyHost() const { return m_szProxyHost; } 595 595 void SetProxyHost(const char *s) { SetString(&m_szProxyHost, s); } 596 unsigned short ProxyPort() { return m_nProxyPort;}596 unsigned short ProxyPort() const { return m_nProxyPort; } 597 597 void SetProxyPort(unsigned short p) { m_nProxyPort = p; } 598 bool ProxyAuthEnabled() { return m_bProxyAuthEnabled;}598 bool ProxyAuthEnabled() const { return m_bProxyAuthEnabled; } 599 599 void SetProxyAuthEnabled(bool b) { m_bProxyAuthEnabled = b; } 600 const char *ProxyLogin() { return m_szProxyLogin;}600 const char* ProxyLogin() const { return m_szProxyLogin; } 601 601 void SetProxyLogin(const char *s) { SetString(&m_szProxyLogin, s); } 602 const char *ProxyPasswd() { return m_szProxyPasswd;}602 const char* ProxyPasswd() const { return m_szProxyPasswd; } 603 603 void SetProxyPasswd(const char *s) { SetString(&m_szProxyPasswd, s); } 604 604 605 unsigned short TCPPortsLow() { return m_nTCPPortsLow; }606 unsigned short TCPPortsHigh() { return m_nTCPPortsHigh; }605 unsigned short TCPPortsLow() const { return m_nTCPPortsLow; } 606 unsigned short TCPPortsHigh() const { return m_nTCPPortsHigh; } 607 607 void SetTCPPorts(unsigned short p, unsigned short r); 608 608 static bool CryptoEnabled(); 609 609 610 bool AutoUpdateInfo() { return m_bAutoUpdateInfo; }611 bool AutoUpdateInfoPlugins() { return m_bAutoUpdateInfoPlugins; }612 bool AutoUpdateStatusPlugins() { return m_bAutoUpdateStatusPlugins; }610 bool AutoUpdateInfo() const { return m_bAutoUpdateInfo; } 611 bool AutoUpdateInfoPlugins() const { return m_bAutoUpdateInfoPlugins; } 612 bool AutoUpdateStatusPlugins() const { return m_bAutoUpdateStatusPlugins; } 613 613 614 614 void SetAutoUpdateInfo(bool b) { m_bAutoUpdateInfo = b; } … … 616 616 void SetAutoUpdateStatusPlugins(bool b) { m_bAutoUpdateStatusPlugins = b; } 617 617 618 const char *Terminal(); 618 // NOT MT SAFE 619 const char* Terminal() const { return m_szTerminal; } 619 620 void SetTerminal(const char *s); 620 bool Ignore(unsigned short n) { return m_nIgnoreTypes & n; }621 bool Ignore(unsigned short n) const { return m_nIgnoreTypes & n; } 621 622 void SetIgnore(unsigned short, bool); 622 623 623 624 COnEventManager *OnEventManager() { return &m_xOnEventManager; } 624 bool AlwaysOnlineNotify(); 625 // NOT MT SAFE 626 bool AlwaysOnlineNotify() const { return m_bAlwaysOnlineNotify; } 625 627 void SetAlwaysOnlineNotify(bool); 626 628 CICQSignal *PopPluginSignal(); … … 629 631 630 632 // ICQ options 631 bool UseServerContactList() { return m_bUseSS; }632 bool UseServerSideBuddyIcons() { return m_bUseBART; }633 bool SendTypingNotification() { return m_bSendTN; }633 bool UseServerContactList() const { return m_bUseSS; } 634 bool UseServerSideBuddyIcons() const { return m_bUseBART; } 635 bool SendTypingNotification() const { return m_bSendTN; } 634 636 635 637 void SetUseServerContactList(bool b) { m_bUseSS = b; } … … 638 640 639 641 // Misc functions 640 bool ReconnectAfterUinClash() { return m_bReconnectAfterUinClash; }642 bool ReconnectAfterUinClash() const { return m_bReconnectAfterUinClash; } 641 643 void setReconnectAfterUinClash(bool b) { m_bReconnectAfterUinClash = b; } 642 644 bool AddProtocolPlugins(); … … 647 649 CDaemonStats *Stats(unsigned short n) { return n < 3 ? &m_sStats[n] : NULL; } 648 650 DaemonStatsList &AllStats() { return m_sStats; } 649 time_t ResetTime() { return m_nResetTime; }650 time_t StartTime() { return m_nStartTime; }651 time_t Uptime() { return time(NULL) - m_nStartTime; }651 time_t ResetTime() const { return m_nResetTime; } 652 time_t StartTime() const { return m_nStartTime; } 653 time_t Uptime() const { return time(NULL) - m_nStartTime; } 652 654 void ResetStats(); 653 655 … … 811 813 812 814 std::list <ICQEvent *> m_lxRunningEvents; 813 pthread_mutex_t mutex_runningevents;815 mutable pthread_mutex_t mutex_runningevents; 814 816 std::list <ICQEvent *> m_lxExtendedEvents; 815 817 pthread_mutex_t mutex_extendedevents; … … 853 855 ICQEvent *DoneExtendedEvent(ICQEvent *, EventResult); 854 856 ICQEvent *DoneExtendedEvent(unsigned long tag, EventResult _eResult); 855 bool hasServerEvent(unsigned long );857 bool hasServerEvent(unsigned long subSequence) const; 856 858 void ProcessDoneEvent(ICQEvent *); 857 859 void PushEvent(ICQEvent *); … … 896 898 bool ProcessTcpPacket(TCPSocket *); 897 899 bool ProcessTcpHandshake(TCPSocket *); 898 void ProcessFifo(c har *);900 void ProcessFifo(const char* buf); 899 901 900 902 static bool Handshake_Send(TCPSocket *, const char* id, unsigned short, … … 956 958 // Helper functions for the daemon 957 959 bool ParseFE(char *szBuffer, char ***szSubStr, int nMaxSubStr); 958 unsigned long StringToStatus(c har *_szStatus);960 unsigned long StringToStatus(const char* status); 959 961 unsigned short VersionToUse(unsigned short); 960 962 -
trunk/licq/src/fifo.cpp
r6467 r6500 153 153 static int process_tok(const command_t *table,const char *tok); 154 154 155 unsigned long 156 StringToStatus(char *_szStatus) 155 unsigned long StringToStatus(const char* _szStatus) 157 156 { 158 157 const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); … … 919 918 } 920 919 921 void CICQDaemon::ProcessFifo(c har *_szBuf)920 void CICQDaemon::ProcessFifo(const char* _szBuf) 922 921 { 923 922 #ifdef USE_FIFO -
trunk/licq/src/icqd.cpp
r6467 r6500 670 670 } 671 671 672 c har *CICQDaemon::ProtoPluginName(unsigned long _nPPID)672 const char* CICQDaemon::ProtoPluginName(unsigned long _nPPID) const 673 673 { 674 674 ProtoPluginsListIter it; 675 c har *p = 0;675 const char* p = 0; 676 676 677 677 pthread_mutex_lock(&licq->mutex_protoplugins); … … 682 682 if ((*it)->PPID() == _nPPID) 683 683 { 684 p = ( char *)(*it)->Name();684 p = (*it)->Name(); 685 685 break; 686 686 } … … 705 705 //---Version------------------------------------------------------------------- 706 706 /*! \brief Returns the version of Licq */ 707 const char *CICQDaemon::Version()707 const char* CICQDaemon::Version() const 708 708 { 709 709 return licq->Version(); … … 888 888 //++++++NOT MT SAFE+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 889 889 890 const char *CICQDaemon::Terminal() { return m_szTerminal; }891 890 void CICQDaemon::SetTerminal(const char *s) { SetString(&m_szTerminal, s); } 892 bool CICQDaemon::AlwaysOnlineNotify() { return m_bAlwaysOnlineNotify; }893 891 void CICQDaemon::SetAlwaysOnlineNotify(bool b) { m_bAlwaysOnlineNotify = b; } 894 892 895 const char *CICQDaemon::getUrlViewer()893 const char* CICQDaemon::getUrlViewer() const 896 894 { 897 895 if ((strcmp(m_szUrlViewer, "none") == 0) || (strlen(m_szUrlViewer) == 0)) … … 1605 1603 * Search the running event queue for a specific event by subsequence. 1606 1604 */ 1607 bool CICQDaemon::hasServerEvent(unsigned long _nSubSequence) 1605 bool CICQDaemon::hasServerEvent(unsigned long _nSubSequence) const 1608 1606 { 1609 1607 bool hasEvent = false; 1610 1608 pthread_mutex_lock(&mutex_runningevents); 1611 list<ICQEvent *>::iterator iter;1609 list<ICQEvent*>::const_iterator iter; 1612 1610 for (iter = m_lxRunningEvents.begin(); iter != m_lxRunningEvents.end(); ++iter) 1613 1611 {
