Type Definition proj_sys::proj_network_open_cbk_type

source ·
pub type proj_network_open_cbk_type = Option<unsafe extern "C" fn(ctx: *mut PJ_CONTEXT, url: *const c_char, offset: c_ulonglong, size_to_read: usize, buffer: *mut c_void, out_size_read: *mut usize, error_string_max_size: usize, out_error_string: *mut c_char, user_data: *mut c_void) -> *mut PROJ_NETWORK_HANDLE>;
Expand description

Network access: open callback

Should try to read the size_to_read first bytes at the specified offset of the file given by URL url, and write them to buffer. *out_size_read should be updated with the actual amount of bytes read (== size_to_read if the file is larger than size_to_read). During this read, the implementation should make sure to store the HTTP headers from the server response to be able to respond to proj_network_get_header_value_cbk_type callback.

error_string_max_size should be the maximum size that can be written into the out_error_string buffer (including terminating nul character).

@return a non-NULL opaque handle in case of success.