Initial import of libucore

This commit is contained in:
Nils O. Selåsdal
2012-10-29 23:07:32 +01:00
commit ed3866e49a
79 changed files with 6181 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef SEQ_H_
#define SEQ_H_
#include <stdint.h>
// Check if a is before b, taking care of wrap arounds
static inline int seq_before(uint32_t a, uint32_t b)
{
return (int32_t)(a - b) < 0;
}
// check if a is before b, taking care of wrap arounds
#define seq_after(a, b) before(b, a)
//check if a is between b or c
static inline int seqbetween(uint32_t a, uint32_t b, uint32_t c)
{
return c - b >= a - b;
}
#endif