mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
added g_timeval_cmp()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@904 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a01275959d
commit
e7bfb7fe88
@ -94,6 +94,17 @@ int g_input_add(int source, int condition,
|
|||||||
function, data);
|
function, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2)
|
||||||
|
{
|
||||||
|
if (tv1->tv_sec < tv2->tv_sec)
|
||||||
|
return -1;
|
||||||
|
if (tv1->tv_sec > tv2->tv_sec)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return tv1->tv_usec < tv2->tv_usec ? -1 :
|
||||||
|
tv1->tv_usec > tv2->tv_usec ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2)
|
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2)
|
||||||
{
|
{
|
||||||
long secs, usecs;
|
long secs, usecs;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
typedef void* (*FOREACH_FIND_FUNC) (void *item, void *data);
|
typedef void* (*FOREACH_FIND_FUNC) (void *item, void *data);
|
||||||
|
|
||||||
|
int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2);
|
||||||
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2);
|
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2);
|
||||||
|
|
||||||
/* find `item' from a space separated `list' */
|
/* find `item' from a space separated `list' */
|
||||||
|
Loading…
Reference in New Issue
Block a user