tevent  0.9.31
Functions
The tevent helper functions

Functions

int tevent_timeval_compare (const struct timeval *tv1, const struct timeval *tv2)
 Compare two timeval values. More...
 
struct timeval tevent_timeval_zero (void)
 Get a zero timeval value. More...
 
struct timeval tevent_timeval_current (void)
 Get a timeval value for the current time. More...
 
struct timeval tevent_timeval_set (uint32_t secs, uint32_t usecs)
 Get a timeval structure with the given values. More...
 
struct timeval tevent_timeval_until (const struct timeval *tv1, const struct timeval *tv2)
 Get the difference between two timeval values. More...
 
bool tevent_timeval_is_zero (const struct timeval *tv)
 Check if a given timeval structure is zero. More...
 
struct timeval tevent_timeval_add (const struct timeval *tv, uint32_t secs, uint32_t usecs)
 Add the given amount of time to a timeval structure. More...
 
struct timeval tevent_timeval_current_ofs (uint32_t secs, uint32_t usecs)
 Get a timeval in the future with a specified offset from now. More...
 

Detailed Description

Todo:
description

Function Documentation

§ tevent_timeval_add()

struct timeval tevent_timeval_add ( const struct timeval *  tv,
uint32_t  secs,
uint32_t  usecs 
)

Add the given amount of time to a timeval structure.

Parameters
[in]tvThe timeval structure to add the time.
[in]secsThe seconds to add to the timeval.
[in]usecsThe microseconds to add to the timeval.
Returns
The timeval structure with the new time.

§ tevent_timeval_compare()

int tevent_timeval_compare ( const struct timeval *  tv1,
const struct timeval *  tv2 
)

Compare two timeval values.

Parameters
[in]tv1The first timeval value to compare.
[in]tv2The second timeval value to compare.
Returns
0 if they are equal. 1 if the first time is greater than the second. -1 if the first time is smaller than the second.

Compare two timeval values.

Return -1 if tv1 < tv2 Return 0 if tv1 == tv2 Return 1 if tv1 > tv2

§ tevent_timeval_current()

struct timeval tevent_timeval_current ( void  )

Get a timeval value for the current time.

Returns
A timeval value with the current time.

Get a timeval value for the current time.

§ tevent_timeval_current_ofs()

struct timeval tevent_timeval_current_ofs ( uint32_t  secs,
uint32_t  usecs 
)

Get a timeval in the future with a specified offset from now.

Parameters
[in]secsThe seconds of the offset from now.
[in]usecsThe microseconds of the offset from now.
Returns
A timval with the given offset in the future.

Get a timeval in the future with a specified offset from now.

§ tevent_timeval_is_zero()

bool tevent_timeval_is_zero ( const struct timeval *  tv)

Check if a given timeval structure is zero.

Parameters
[in]tvThe timeval to check if it is zero.
Returns
True if it is zero, false otherwise.

Check if a given timeval structure is zero.

§ tevent_timeval_set()

struct timeval tevent_timeval_set ( uint32_t  secs,
uint32_t  usecs 
)

Get a timeval structure with the given values.

Parameters
[in]secsThe seconds to set.
[in]usecsThe microseconds to set.
Returns
A timeval structure with the given values.

Get a timeval structure with the given values.

§ tevent_timeval_until()

struct timeval tevent_timeval_until ( const struct timeval *  tv1,
const struct timeval *  tv2 
)

Get the difference between two timeval values.

Parameters
[in]tv1The first timeval.
[in]tv2The second timeval.
Returns
A timeval structure with the difference between the first and the second value.

Get the difference between two timeval values.

§ tevent_timeval_zero()

struct timeval tevent_timeval_zero ( void  )

Get a zero timeval value.

Returns
A zero timeval value.

Get a zero timeval value.