Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

SOFIAPUBFUN long su_time_cmp ( su_time_t const   t1,
su_time_t const   t2 

Compare two timestamps.

The function su_time_cmp() compares two su_time_t timestamps.

t1 first NTP timestamp in su_time_t structure
t2 second NTP timestamp in su_time_t structure
Return values:
Negative,if t1 is before t2,
Zero,if t1 is same as t2, or
Positive,if t1 is after t2.

Definition at line 86 of file su_time.c.

References su_time_cmp(), su_time_s::tv_sec, and su_time_s::tv_usec.

Referenced by su_time_cmp(), tport_base_timer(), tport_keepalive_timer(), tport_next_keepalive(), tport_next_recv_timeout(), tport_recv_timeout_timer(), and tport_set_secondary_timer().

  long retval = 0;

  if (t1.tv_sec > t2.tv_sec) 
    retval = 1;
  else if (t1.tv_sec < t2.tv_sec) 
    retval = -1;
  else {
    if (t1.tv_usec > t2.tv_usec) 
      retval = 1;
    else if (t1.tv_usec < t2.tv_usec) 
      retval = -1;

  return retval;

Generated by  Doxygen 1.6.0   Back to index