Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.

My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static inline uintptr_t RINGBUF_ADD(uintptr_t p, unsigned int v)
{
    return (((p)+(v))<buffer_len ? (p)+(v) : (p)+(v)-buffer_len);
}
//#define RINGBUF_ADD(p,v) (((p)+(v))<buffer_len ? (p)+(v) : (p)+(v)-buffer_len)
/* Buffer pointer (p) minus value (v), wrapped if necessary */
static inline uintptr_t RINGBUF_SUB(uintptr_t p, unsigned int v)
{
    return ((p>=v) ? (p)-(v) : (p)+buffer_len-(v));
}

//#define RINGBUF_SUB(p,v) ((p>=v) ? (p)-(v) : (p)+buffer_len-(v))
/* How far value (v) plus buffer pointer (p1) will cross buffer pointer (p2) */
static inline intptr_t RINGBUF_ADD_CROSS(uintptr_t p1, int v, uintptr_t p2)
{
    return ((p1<p2) ? (int)((p1)+(v))-(int)(p2) : (int)((p1)+(v)-(p2))-(int)buffer_len);
}
/* #define RINGBUF_ADD_CROSS(p1,v,p2) \
((p1<p2) ? (int)((p1)+(v))-(int)(p2) : (int)((p1)+(v)-(p2))-(int)buffer_len) */
/* Bytes available in the buffer */
#define BUF_USED RINGBUF_SUB(buf_widx, buf_ridx)