(bind-func qbuf_push:[void,QBuffer*,!a]*
(lambda (buf x)
(if (>= (tref buf 1) (+ (tref buf 0) (tref buf 2)))
(println "Writing over unread data!"))
(pset! (tref buf 3)
(% (tref buf 1) (tref buf 2))
x)
(tset! buf 1 (+ (tref buf 1) 1))
void))