1 #define RB_FOREACH(x, name, head) \
2 for ((x) = RB_MIN(name, head); \
4 (x) = name##_RB_NEXT(x))
6 #define RB_FOREACH_SAFE(x, name, head, y) \
7 for ((x) = RB_MIN(name, head); \
8 ((x) != NULL) && ((y) = name##_RB_NEXT(x), 1); \
11 #define RB_FOREACH_REVERSE(x, name, head) \
12 for ((x) = RB_MAX(name, head); \
14 (x) = name##_RB_PREV(x))
16 #define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \
17 for ((x) = RB_MAX(name, head); \
18 ((x) != NULL) && ((y) = name##_RB_PREV(x), 1); \
23 #define TAILQ_END(head) NULL
26 #ifndef TAILQ_FOREACH_SAFE
27 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
28 for ((var) = TAILQ_FIRST(head); \
29 (var) != TAILQ_END(head) && \
30 ((tvar) = TAILQ_NEXT(var, field), 1); \
34 #define FMT_SCALED_STRSIZE 7 /* minus sign, 4 digits, suffix, null byte */
35 int fmt_scaled(long long number
, char *result
);
36 long long strtonum(const char *, long long, long long, const char **);