curl_write_callback   xtlang


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

Implementation

(bind-func curl_write_callback
  (let ((cdat:curl_dat* null)
        (cdat_current_ptr (lambda () (pref-ptr (tref cdat 0) (tref cdat 1))))
        ;; define your own custom callback to change MAX_BUFFER_SIZE
        (MAX_BUFFER_SIZE 1000000))
    (lambda (ptr:i8* size:size_t nmemb:size_t dat:i8*)
      (let ((total_bytes (* size nmemb)))
        (set! cdat (cast dat curl_dat*))
        (if (> (+ (tref cdat 1) total_bytes)
               MAX_BUFFER_SIZE)
            (begin (printf "curl_write_callback buffer overflow!\n") 0)
            (begin
              (memcpy (cdat_current_ptr) ptr total_bytes)
              (tset! cdat 1 (+ (tref cdat 1) total_bytes))
              total_bytes))))))


Back to Index

Similar Entries

  • PaStreamCallbackTimeInfo_print    xtlang
  • PaStreamCallbackTimeInfo_toString    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • audio_callback:PaStreamCallback    xtlang
  • callback    scheme
  • callback-adapter    scheme
  • callback-test2-helper    xtlang
  • callback_goodbye_world    xtlang
  • callback_hello_world    xtlang
  • clock_scheduler_main_callback    xtlang
  • curl    macro
  • curl_perform_request    xtlang
  • curl_print_version    xtlang
  • curl_request    xtlang
  • curl_request_with_auth    xtlang
  • curl_request_with_header    xtlang
  • curl_setopts_authenticate    xtlang
  • curl_setopts_basic    xtlang
  • curl_setopts_header    xtlang
  • curl_setup    xtlang
  • glfw_char_callback:GLFWcharfun    xtlang
  • glfw_cursor_position_callback:GLFWcursorposfun    xtlang
  • glfw_error_callback:GLFWerrorfun    xtlang
  • glfw_key_callback:GLFWkeyfun    xtlang
  • glfw_mouse_button_callback:GLFWmousebuttonfun    xtlang
  • glfw_window_focus_callback:GLFWwindowfocusfun    xtlang
  • glfw_window_position_callback:GLFWwindowposfun    xtlang
  • gui_window_size_callback    xtlang
  • impc:ir:compiler:callback    scheme
  • impc:ti:callback    scheme
  • impc:ti:callback-check    scheme
  • listener-callback    scheme
  • ocv_VideoWriter    xtlang
  • ocv_VideoWriter    xtlang
  • ocv_VideoWriter    scheme
  • ocv_VideoWriter1    xtlang
  • ocv_imwrite    xtlang
  • ocv_imwrite    xtlang
  • ocv_imwrite    scheme
  • ocv_imwrite1    xtlang
  • ocv_imwrite2    xtlang
  • ocv_write    xtlang
  • pm_write    xtlang
  • read_and_write_frame    xtlang
  • rtmidi_default_callback:RtMidiCCallback    xtlang
  • rtmidi_register_callback    xtlang
  • sys_file_write    xtlang
  • write    xtlang
  • write_colour    xtlang
  • xtmdoc-write-alist-args-as-json    scheme
  • xtmdoc-write-alist-as-json    scheme