libqb  1.9.0
Macros
qbdefs.h File Reference

These are some convience macros and defines. More...

This graph shows which files directly or indirectly include this file:

Macros

#define QB_ROUNDUP(x, y)   ((((x) + ((y) - 1)) / (y)) * (y))
 
#define QB_ABS(i)   (((i) < 0) ? -(i) : (i))
 
#define QB_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define QB_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define QB_FALSE   0
 
#define QB_TRUE   (!QB_FALSE)
 
#define qb_bit_value(bit)   (1U << (bit))
 
#define qb_bit_set(barray, bit)   (barray |= qb_bit_value(bit))
 
#define qb_bit_clear(barray, bit)   (barray &= ~(qb_bit_value(bit)))
 
#define qb_bit_is_set(barray, bit)   (barray & qb_bit_value(bit))
 
#define qb_bit_is_clear(barray, bit)   (!(barray & qb_bit_value(bit)))
 
#define QB_PP_JOIN_(a, b)   a##b
 
#define QB_PP_JOIN(a, b)   QB_PP_JOIN_(a, b)
 
#define QB_PP_STRINGIFY_(arg)   #arg
 
#define QB_PP_STRINGIFY(arg)   QB_PP_STRINGIFY_(arg)
 
#define HZ   100 /* 10ms */
 
#define QB_TIME_MS_IN_SEC   1000ULL
 
#define QB_TIME_US_IN_SEC   1000000ULL
 
#define QB_TIME_NS_IN_SEC   1000000000ULL
 
#define QB_TIME_US_IN_MSEC   1000ULL
 
#define QB_TIME_NS_IN_MSEC   1000000ULL
 
#define QB_TIME_NS_IN_USEC   1000ULL
 
#define QB_GNUC_DEPRECATED
 
#define QB_GNUC_DEPRECATED_FOR(f)   QB_GNUC_DEPRECATED
 
#define QB_GNUC_MAY_ALIAS
 

Detailed Description

These are some convience macros and defines.

Author
Angus Salkeld asalk.nosp@m.eld@.nosp@m.redha.nosp@m.t.co.nosp@m.m

Macro Definition Documentation

◆ HZ

#define HZ   100 /* 10ms */

◆ QB_ABS

#define QB_ABS (   i)    (((i) < 0) ? -(i) : (i))

◆ qb_bit_clear

#define qb_bit_clear (   barray,
  bit 
)    (barray &= ~(qb_bit_value(bit)))
Examples
simplelog.c.

◆ qb_bit_is_clear

#define qb_bit_is_clear (   barray,
  bit 
)    (!(barray & qb_bit_value(bit)))

◆ qb_bit_is_set

#define qb_bit_is_set (   barray,
  bit 
)    (barray & qb_bit_value(bit))
Examples
simplelog.c.

◆ qb_bit_set

#define qb_bit_set (   barray,
  bit 
)    (barray |= qb_bit_value(bit))
Examples
simplelog.c.

◆ qb_bit_value

#define qb_bit_value (   bit)    (1U << (bit))

◆ QB_FALSE

#define QB_FALSE   0

◆ QB_GNUC_DEPRECATED

#define QB_GNUC_DEPRECATED

◆ QB_GNUC_DEPRECATED_FOR

#define QB_GNUC_DEPRECATED_FOR (   f)    QB_GNUC_DEPRECATED

◆ QB_GNUC_MAY_ALIAS

#define QB_GNUC_MAY_ALIAS

◆ QB_MAX

#define QB_MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

◆ QB_MIN

#define QB_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))
Examples
simplelog.c.

◆ QB_PP_JOIN

#define QB_PP_JOIN (   a,
 
)    QB_PP_JOIN_(a, b)

◆ QB_PP_JOIN_

#define QB_PP_JOIN_ (   a,
 
)    a##b

◆ QB_PP_STRINGIFY

#define QB_PP_STRINGIFY (   arg)    QB_PP_STRINGIFY_(arg)

◆ QB_PP_STRINGIFY_

#define QB_PP_STRINGIFY_ (   arg)    #arg

◆ QB_ROUNDUP

#define QB_ROUNDUP (   x,
 
)    ((((x) + ((y) - 1)) / (y)) * (y))

◆ QB_TIME_MS_IN_SEC

#define QB_TIME_MS_IN_SEC   1000ULL

◆ QB_TIME_NS_IN_MSEC

#define QB_TIME_NS_IN_MSEC   1000000ULL

◆ QB_TIME_NS_IN_SEC

#define QB_TIME_NS_IN_SEC   1000000000ULL

◆ QB_TIME_NS_IN_USEC

#define QB_TIME_NS_IN_USEC   1000ULL

◆ QB_TIME_US_IN_MSEC

#define QB_TIME_US_IN_MSEC   1000ULL

◆ QB_TIME_US_IN_SEC

#define QB_TIME_US_IN_SEC   1000000ULL

◆ QB_TRUE

#define QB_TRUE   (!QB_FALSE)