(file) Return to System.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/System.cpp between version 1.73.2.1 and 1.74.2.1

version 1.73.2.1, 2009/09/25 13:45:06 version 1.74.2.1, 2009/10/20 13:21:19
Line 44 
Line 44 
  
 #if defined(PEGASUS_OS_TYPE_WINDOWS) #if defined(PEGASUS_OS_TYPE_WINDOWS)
 # include "SystemWindows.cpp" # include "SystemWindows.cpp"
 #elif defined(PEGASUS_OS_TYPE_UNIX) || defined(PEGASUS_OS_VMS)  #elif defined(PEGASUS_OS_TYPE_UNIX)
 # include "SystemPOSIX.cpp" # include "SystemPOSIX.cpp"
   # include "SystemUnix.cpp"
   #elif defined(PEGASUS_OS_VMS)
   # include "SystemPOSIX.cpp"
   # include "SystemVms.cpp"
 #else #else
 # error "Unsupported platform" # error "Unsupported platform"
 #endif #endif
Line 132 
Line 136 
     return r;     return r;
 } }
  
   bool System::strncasecmp(
       const char* s1,
       size_t s1_l,
       const char* s2,
       size_t s2_l)
   {
       // Function is even faster than System::strcasecmp()
       if (s1_l != s2_l)
       {
           return false;
       }
       Uint8* p = (Uint8*)s1;
       Uint8* q = (Uint8*)s2;
       register int len = s1_l;
      // lets do a loop-unrolling optimized compare here
       while (len >= 8)
       {
           if ((_toLowerTable[p[0]]-_toLowerTable[q[0]]) ||
               (_toLowerTable[p[1]]-_toLowerTable[q[1]]) ||
               (_toLowerTable[p[2]]-_toLowerTable[q[2]]) ||
               (_toLowerTable[p[3]]-_toLowerTable[q[3]]) ||
               (_toLowerTable[p[4]]-_toLowerTable[q[4]]) ||
               (_toLowerTable[p[5]]-_toLowerTable[q[5]]) ||
               (_toLowerTable[p[6]]-_toLowerTable[q[6]]) ||
               (_toLowerTable[p[7]]-_toLowerTable[q[7]]))
           {
               return false;
           }
           len -= 8;
           p += 8;
           q += 8;
       }
       while (len >= 4)
       {
           if ((_toLowerTable[p[0]]-_toLowerTable[q[0]]) ||
               (_toLowerTable[p[1]]-_toLowerTable[q[1]]) ||
               (_toLowerTable[p[2]]-_toLowerTable[q[2]]) ||
               (_toLowerTable[p[3]]-_toLowerTable[q[3]]))
           {
               return false;
           }
           len -= 4;
           p += 4;
           q += 4;
       }
       while (len--)
       {
           if ((_toLowerTable[p[0]]-_toLowerTable[q[0]]))
           {
               return false;
           }
           p++;
           q++;
       }
       return true;
   }
   
   
 // Return the just the file name from the path into basename // Return the just the file name from the path into basename
 char *System::extract_file_name(const char *fullpath, char *basename) char *System::extract_file_name(const char *fullpath, char *basename)
 { {
Line 584 
Line 646 
 #ifdef PEGASUS_ENABLE_IPV6 #ifdef PEGASUS_ENABLE_IPV6
     struct in6_addr ip6 = PEGASUS_IPV6_LOOPBACK_INIT;     struct in6_addr ip6 = PEGASUS_IPV6_LOOPBACK_INIT;
 #endif #endif
       Uint32 ip4 = PEGASUS_IPV4_LOOPBACK_INIT;
     switch (af)     switch (af)
     {     {
 #ifdef PEGASUS_ENABLE_IPV6 #ifdef PEGASUS_ENABLE_IPV6
Line 595 
Line 658 
             Uint32 tmp;             Uint32 tmp;
             memcpy(&tmp, binIPAddress, sizeof(Uint32));             memcpy(&tmp, binIPAddress, sizeof(Uint32));
             Uint32 n = ntohl(tmp);             Uint32 n = ntohl(tmp);
             return n >= PEGASUS_IPV4_LOOPBACK_RANGE_START &&              return !memcmp(&ip4, &n, sizeof (ip4));
                 n <= PEGASUS_IPV4_LOOPBACK_RANGE_END;  
         }         }
     }     }
  


Legend:
Removed from v.1.73.2.1  
changed lines
  Added in v.1.74.2.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2