Changeset 6500 for trunk/licq

Show
Ignore:
Timestamp:
08/27/08 01:04:27 (3 months ago)
Author:
flynd
Message:

Added missing 'const' in licq_icqd.h.

Location:
trunk/licq
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/include/licq_icqd.h

    r6467 r6500  
    8787  // Accessors 
    8888  //! Total number of events. 
    89   unsigned long Total() { return m_nTotal; } 
     89  unsigned long Total() const   { return m_nTotal; } 
    9090  //! 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; } 
    9292  //! Name of the kind of statistic. 
    93   const char *Name()    { return m_szName; } 
     93  const char* Name() const      { return m_szName; } 
    9494 
    9595protected: 
     
    9797  CDaemonStats(const char *, const char *); 
    9898 
    99   bool Dirty() { return m_nLastSaved != m_nTotal; } 
     99  bool Dirty() const            { return m_nLastSaved != m_nTotal; } 
    100100  void ClearDirty() { m_nLastSaved = m_nTotal; } 
    101101 
     
    129129public: 
    130130  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]; } 
    138138 
    139139private: 
     
    197197  void UnregisterPlugin(); 
    198198  bool Start(); 
    199   const char *Version(); 
     199  const char* Version() const; 
    200200  pthread_t *Shutdown(); 
    201201  void SaveConf(); 
     
    534534  int RegisterProtoPlugin(); 
    535535  void UnregisterProtoPlugin(); 
    536   char *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; } 
    539539 
    540540  void PluginUIViewEvent(const char *szId, unsigned long nPPID ) { 
     
    566566 
    567567  // NOT MT SAFE 
    568   const char *getUrlViewer(); 
     568  const char* getUrlViewer() const; 
    569569  void setUrlViewer(const char *s); 
    570570 
     
    572572 
    573573  // ICQ Server options 
    574   const char *ICQServer() {  return m_szICQServer; } 
     574  const char* ICQServer() const                 { return m_szICQServer; } 
    575575  void SetICQServer(const char *s) {  SetString(&m_szICQServer, s);  } 
    576   unsigned short ICQServerPort() {  return m_nICQServerPort; } 
     576  unsigned short ICQServerPort() const          { return m_nICQServerPort; } 
    577577  void SetICQServerPort(unsigned short p) {  m_nICQServerPort = p; } 
    578578 
    579579  // Firewall options 
    580   bool TCPEnabled() { return m_bTCPEnabled; } 
     580  bool TCPEnabled() const                       { return m_bTCPEnabled; } 
    581581  void SetTCPEnabled(bool b) { m_bTCPEnabled = b; SetDirectMode(); } 
    582   bool Firewall() { return m_bFirewall; } 
     582  bool Firewall() const                         { return m_bFirewall; } 
    583583  void SetFirewall(bool b) { m_bFirewall = b; SetDirectMode(); } 
    584584  void SetDirectMode(); 
     
    587587  void InitProxy(); 
    588588  ProxyServer *CreateProxy(); 
    589   bool ProxyEnabled() {  return m_bProxyEnabled; } 
     589  bool ProxyEnabled() const                     { return m_bProxyEnabled; } 
    590590  ProxyServer *GetProxy() {  return m_xProxy;  } 
    591591  void SetProxyEnabled(bool b) {  m_bProxyEnabled = b;  } 
    592   unsigned short ProxyType() {  return m_nProxyType; } 
     592  unsigned short ProxyType() const              { return m_nProxyType; } 
    593593  void SetProxyType(unsigned short t) {  m_nProxyType = t;  } 
    594   const char *ProxyHost() {  return m_szProxyHost; } 
     594  const char* ProxyHost() const                 { return m_szProxyHost; } 
    595595  void SetProxyHost(const char *s) {  SetString(&m_szProxyHost, s);  } 
    596   unsigned short ProxyPort() {  return m_nProxyPort; } 
     596  unsigned short ProxyPort() const              { return m_nProxyPort; } 
    597597  void SetProxyPort(unsigned short p) {  m_nProxyPort = p;  } 
    598   bool ProxyAuthEnabled() {  return m_bProxyAuthEnabled; } 
     598  bool ProxyAuthEnabled() const                 { return m_bProxyAuthEnabled; } 
    599599  void SetProxyAuthEnabled(bool b) {  m_bProxyAuthEnabled = b;  } 
    600   const char *ProxyLogin() {  return m_szProxyLogin; } 
     600  const char* ProxyLogin() const                { return m_szProxyLogin; } 
    601601  void SetProxyLogin(const char *s) {  SetString(&m_szProxyLogin, s);  } 
    602   const char *ProxyPasswd() {  return m_szProxyPasswd; } 
     602  const char* ProxyPasswd() const               { return m_szProxyPasswd; } 
    603603  void SetProxyPasswd(const char *s) {  SetString(&m_szProxyPasswd, s);  } 
    604604 
    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; } 
    607607  void SetTCPPorts(unsigned short p, unsigned short r); 
    608608  static bool CryptoEnabled(); 
    609609 
    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; } 
    613613 
    614614  void SetAutoUpdateInfo(bool b)          { m_bAutoUpdateInfo = b; } 
     
    616616  void SetAutoUpdateStatusPlugins(bool b) { m_bAutoUpdateStatusPlugins = b; } 
    617617 
    618   const char *Terminal(); 
     618  // NOT MT SAFE 
     619  const char* Terminal() const                  { return m_szTerminal; } 
    619620  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; } 
    621622  void SetIgnore(unsigned short, bool); 
    622623 
    623624  COnEventManager *OnEventManager()  { return &m_xOnEventManager; } 
    624   bool AlwaysOnlineNotify(); 
     625  // NOT MT SAFE 
     626  bool AlwaysOnlineNotify() const               { return m_bAlwaysOnlineNotify; } 
    625627  void SetAlwaysOnlineNotify(bool); 
    626628  CICQSignal *PopPluginSignal(); 
     
    629631 
    630632  // 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; } 
    634636 
    635637  void SetUseServerContactList(bool b)    { m_bUseSS = b; } 
     
    638640 
    639641  // Misc functions 
    640   bool ReconnectAfterUinClash()              { return m_bReconnectAfterUinClash; } 
     642  bool ReconnectAfterUinClash() const           { return m_bReconnectAfterUinClash; } 
    641643  void setReconnectAfterUinClash(bool b)     { m_bReconnectAfterUinClash = b; } 
    642644  bool AddProtocolPlugins(); 
     
    647649  CDaemonStats *Stats(unsigned short n) { return n < 3 ? &m_sStats[n] : NULL; } 
    648650  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; } 
    652654  void ResetStats(); 
    653655 
     
    811813 
    812814  std::list <ICQEvent *> m_lxRunningEvents; 
    813   pthread_mutex_t mutex_runningevents; 
     815  mutable pthread_mutex_t mutex_runningevents; 
    814816  std::list <ICQEvent *> m_lxExtendedEvents; 
    815817  pthread_mutex_t mutex_extendedevents; 
     
    853855  ICQEvent *DoneExtendedEvent(ICQEvent *, EventResult); 
    854856  ICQEvent *DoneExtendedEvent(unsigned long tag, EventResult _eResult); 
    855   bool hasServerEvent(unsigned long); 
     857  bool hasServerEvent(unsigned long subSequence) const; 
    856858  void ProcessDoneEvent(ICQEvent *); 
    857859  void PushEvent(ICQEvent *); 
     
    896898  bool ProcessTcpPacket(TCPSocket *); 
    897899  bool ProcessTcpHandshake(TCPSocket *); 
    898   void ProcessFifo(char *); 
     900  void ProcessFifo(const char* buf); 
    899901 
    900902  static bool Handshake_Send(TCPSocket *, const char* id, unsigned short, 
     
    956958// Helper functions for the daemon 
    957959bool ParseFE(char *szBuffer, char ***szSubStr, int nMaxSubStr); 
    958 unsigned long StringToStatus(char *_szStatus); 
     960unsigned long StringToStatus(const char* status); 
    959961unsigned short VersionToUse(unsigned short); 
    960962 
  • trunk/licq/src/fifo.cpp

    r6467 r6500  
    153153static int process_tok(const command_t *table,const char *tok); 
    154154 
    155 unsigned long 
    156 StringToStatus(char *_szStatus) 
     155unsigned long StringToStatus(const char* _szStatus) 
    157156{ 
    158157  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     
    919918} 
    920919 
    921 void CICQDaemon::ProcessFifo(char *_szBuf) 
     920void CICQDaemon::ProcessFifo(const char* _szBuf) 
    922921{ 
    923922#ifdef USE_FIFO 
  • trunk/licq/src/icqd.cpp

    r6467 r6500  
    670670} 
    671671 
    672 char *CICQDaemon::ProtoPluginName(unsigned long _nPPID) 
     672const char* CICQDaemon::ProtoPluginName(unsigned long _nPPID) const 
    673673{ 
    674674  ProtoPluginsListIter it; 
    675   char *p = 0; 
     675  const char* p = 0; 
    676676 
    677677  pthread_mutex_lock(&licq->mutex_protoplugins); 
     
    682682    if ((*it)->PPID() == _nPPID) 
    683683    { 
    684       p = (char *)(*it)->Name(); 
     684      p = (*it)->Name(); 
    685685      break; 
    686686    } 
     
    705705//---Version------------------------------------------------------------------- 
    706706/*! \brief Returns the version of Licq */ 
    707 const char *CICQDaemon::Version() 
     707const char* CICQDaemon::Version() const 
    708708{ 
    709709  return licq->Version(); 
     
    888888//++++++NOT MT SAFE+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    889889 
    890 const char *CICQDaemon::Terminal()       { return m_szTerminal; } 
    891890void CICQDaemon::SetTerminal(const char *s)  { SetString(&m_szTerminal, s); } 
    892 bool CICQDaemon::AlwaysOnlineNotify()  { return m_bAlwaysOnlineNotify; } 
    893891void CICQDaemon::SetAlwaysOnlineNotify(bool b)  { m_bAlwaysOnlineNotify = b; } 
    894892 
    895 const char *CICQDaemon::getUrlViewer() 
     893const char* CICQDaemon::getUrlViewer() const 
    896894{ 
    897895  if ((strcmp(m_szUrlViewer, "none") == 0) || (strlen(m_szUrlViewer) == 0)) 
     
    16051603 * Search the running event queue for a specific event by subsequence. 
    16061604 */ 
    1607 bool CICQDaemon::hasServerEvent(unsigned long _nSubSequence) 
     1605bool CICQDaemon::hasServerEvent(unsigned long _nSubSequence) const 
    16081606{ 
    16091607  bool hasEvent = false; 
    16101608  pthread_mutex_lock(&mutex_runningevents); 
    1611   list<ICQEvent *>::iterator iter; 
     1609  list<ICQEvent*>::const_iterator iter; 
    16121610  for (iter = m_lxRunningEvents.begin(); iter != m_lxRunningEvents.end(); ++iter) 
    16131611  {