chunked_printf   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/curl.xtm

Implementation

(bind-func chunked_printf
  (let ((chunk_size 1000))
    (lambda (str:i8*)
      (if (< chunk_size (strlen str))
          (let ((tmpchar (pref str chunk_size)))
            (pset! str chunk_size 0)
            (printf "%s" str)
            (pset! str chunk_size tmpchar)
            (chunked_printf (pref-ptr str chunk_size)))
          (printf "%s\n" str)))))


Back to Index

Similar Entries