Logo Search packages:      
Sourcecode: icu version File versions

U_STABLE int32_t U_EXPORT2 u_compareVersions ( UVersionInfo  v1,
UVersionInfo  v2 
)

Compare two version numbers, v1 and v2, numerically. Returns 0 if v1 == v2 Returns -1 if v1 < v2 (v1 is older, v2 is newer) Returns +1 if v1 > v2 (v1 is newer, v2 is older)

Parameters:
v1 version to compare
v2 version to compare
Returns:
comparison result ICU 4.2

Definition at line 1854 of file putil.c.

References NULL, and U_MAX_VERSION_LENGTH.

                                                    {
    int n;
    if(v1==NULL||v2==NULL) return 0;
    for(n=0;n<U_MAX_VERSION_LENGTH;n++) {
      if(v1[n]<v2[n]) {
        return -1;
      } else if(v1[n]>v2[n]) {
        return  1;
      }
    }
    return 0; /* no difference */
}


Generated by  Doxygen 1.6.0   Back to index