qbuf_push   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/stream.xtm

Implementation

(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))


Back to Index

Similar Entries