Logo Search packages:      
Sourcecode: libical version File versions  Download package

static int icaltimezone_compare_change_fn ( const void *  elem1,
const void *  elem2 
) [static]

A function to compare 2 icaltimezonechange elements, used for qsort().

Definition at line 729 of file icaltimezone.c.

Referenced by icaltimezone_find_nearby_change(), icaltimezone_get_utc_offset(), and icaltimezone_get_utc_offset_of_utc_time().

{
    const icaltimezonechange *change1, *change2;
    int retval;

    change1 = (const icaltimezonechange *)elem1;
    change2 = (const icaltimezonechange *)elem2;

    if (change1->year < change2->year)
      retval = -1;
    else if (change1->year > change2->year)
      retval = 1;

    else if (change1->month < change2->month)
      retval = -1;
    else if (change1->month > change2->month)
      retval = 1;

    else if (change1->day < change2->day)
      retval = -1;
    else if (change1->day > change2->day)
      retval = 1;

    else if (change1->hour < change2->hour)
      retval = -1;
    else if (change1->hour > change2->hour)
      retval = 1;

    else if (change1->minute < change2->minute)
      retval = -1;
    else if (change1->minute > change2->minute)
      retval = 1;

    else if (change1->second < change2->second)
      retval = -1;
    else if (change1->second > change2->second)
      retval = 1;

    else
      retval = 0;

    return retval;
}


Generated by  Doxygen 1.6.0   Back to index