Show
Ignore:
Timestamp:
12/17/07 05:43:26 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1197870206 +0000
git-parent:

[cd1ab55918856e8682710ede8ef2e44377887173]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1197870206 +0000
Message:

more work... fleshing out the eventer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_defines.h

    r01751d3 rb62cf2b  
    66#define API_EXPORT(type) extern type 
    77 
     8static inline int compare_timeval(struct timeval a, struct timeval b) { 
     9  if (a.tv_sec < b.tv_sec) return -1; 
     10  if (a.tv_sec > b.tv_sec) return 1; 
     11  if (a.tv_usec < b.tv_usec) return -1; 
     12  if (a.tv_usec > b.tv_usec) return 1; 
     13  return 0; 
     14} 
     15 
     16static inline void sub_timeval(struct timeval a, struct timeval b, 
     17                               struct timeval *out) 
     18{ 
     19  out->tv_usec = a.tv_usec - b.tv_usec; 
     20  if (out->tv_usec < 0L) { 
     21    a.tv_sec--; 
     22    out->tv_usec += 1000000L; 
     23  } 
     24  out->tv_sec = a.tv_sec - b.tv_sec; 
     25  if (out->tv_sec < 0L) { 
     26    out->tv_sec++; 
     27    out->tv_usec -= 1000000L; 
     28  } 
     29} 
     30 
    831#endif