EDCS Reference Manual
Functions
EDCS CompareCountIntervals
extern int
EDCS_CompareCountIntervals
(
constEDCS_Count_Interval *a_ptr,1
constEDCS_Count_Interval *b_ptr2
);

Definition

Compares two EDCS_Count_Intervals. This function's signature is compatible with qsort.

The comparison compares lower bounds, then uses upper bounds to break any ties. If the lower bound and upper bound values match, closed bounds are considered less than open bounds.

In this instance, the compare operation is as follows. Note that it does not behave differently if either interval is invalid; it is the user's responsibility to check for valid input.

  1. If either argument is NULL, then the result is based on comparing the pointers.

  2. If the two lower bounds are unequal, the comparison of the lower bound values determines the result of the compare operation on the intervals

  3. If the two lower bounds are equal, then

         3.1) If the interval types are equal, then the comparison of the
              upper bounds determines the interval comparison result.
    
         3.2) If the interval types are not equal, and if one interval
              has a closed lower bound but the other does not, the
              interval with the closed lower bound is determined to be
              "less than" the interval with the open lower bound.
    
         3.3) Otherwise,
    
              3.3.1) If the upper bound values are unequal, then
                     the comparison of the upper bound values determines
                     the result
    


Returns

-1 if *a_ptr is NULL and *b_ptr is non-NULL, or *a_ptr < *b_ptr
0 if both arguments are NULL, or *a_ptr == *b_ptr
1 if *b_ptr is NULL and *a_ptr is non-NULL, or *a_ptr > *b_ptr

Parameters Notes

1 handle to 1st EDCS_Count_Interval to be compared

2 handle to 2nd EDCS_Count_Interval to be compared


Prev: EDCS_CompareCharacters. Next: EDCS_CompareCountValues. Up:Index.

Last updated: July 26, 2006 Copyright © 2006 SEDRIS