EXTERNAL / PUBLIC. More...
Defines | |
#define | MESHIFLIST_ITERATOR_START(__interface) |
A convenience macro to safely iterate the list of mesh interfaces. | |
#define | MESHIFLIST_ITERATOR_STOP } pthread_rwlock_unlock(&dessert_cfglock) |
A convenience macro to safely iterate the list of mesh interfaces. | |
#define | TIMEVAL_ADD(__tv, __sec, __usec) |
A convenience macro to safely add __sec seconds and __usec microseconds to the struct timeval __tv in an invariant respecting manner. | |
#define | likely(x) (__builtin_expect((x),1)) |
#define | unlikely(x) (__builtin_expect((x),0)) |
#define | __dessert_assert(func, file, line, e) ((void)_dessert_log(LOG_EMERG, func, file, line, "assertion `%s' failed!\n", e), abort) |
#define | assert(e) (__builtin_expect(!(e), 0) ? __dessert_assert(__FUNCTION__, __FILE__, __LINE__, #e) : (void)0) |
EXTERNAL / PUBLIC.
#define MESHIFLIST_ITERATOR_START | ( | __interface | ) |
pthread_rwlock_rdlock(&dessert_cfglock); \ DL_FOREACH(dessert_meshiflist_get(), __interface) {
A convenience macro to safely iterate the list of mesh interfaces.
__interface | pointer to a temporal dessert_meshif_t |
dessert_meshif_t *iface; MESHIFLIST_ITERATOR_START(iface) do_something(iface); // do something to every iface MESHIFLIST_ITERATOR_STOP;
#define MESHIFLIST_ITERATOR_STOP } pthread_rwlock_unlock(&dessert_cfglock) |
A convenience macro to safely iterate the list of mesh interfaces.
#define TIMEVAL_ADD | ( | __tv, | |||
__sec, | |||||
__usec | ) |
do { \ (__tv)->tv_sec += __sec; \ (__tv)->tv_usec += __usec; \ if((__tv)->tv_usec >= 1000000) { \ ++(__tv)->tv_sec; \ (__tv)->tv_usec -= 1000000; \ } \ } while(0)
A convenience macro to safely add __sec seconds and __usec microseconds to the struct
timeval
__tv in an invariant respecting manner.
__tv | the struct timeval to add to | |
__sec | the number of seconds to add up to __tv->tv_sec | |
__usec | the number of microseconds to add up to __tv.->tv_usec |
DESCRIPTION:
The GNU C Library Documentation states about the tv_usec
member of the struct
timeval:
This is the rest of the elapsed time (a fraction of a second), represented as the number of microseconds. It is always less than one million.