Struct pdfium_render::bindgen::FPDF_FILEHANDLER_
source · [−]#[repr(C)]pub struct FPDF_FILEHANDLER_ {
pub clientData: *mut c_void,
pub Release: Option<unsafe extern "C" fn(clientData: *mut c_void)>,
pub GetSize: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_DWORD>,
pub ReadBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>,
pub WriteBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *const c_void, size: FPDF_DWORD) -> FPDF_RESULT>,
pub Flush: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_RESULT>,
pub Truncate: Option<unsafe extern "C" fn(clientData: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>,
}Expand description
Structure for file reading or writing (I/O).
Note: This is a handler and should be implemented by callers, and is only used from XFA.
Fields
clientData: *mut c_voidUser-defined data. Note: Callers can use this field to track controls.
Release: Option<unsafe extern "C" fn(clientData: *mut c_void)>Callback function to release the current file stream object.
Parameters: clientData - Pointer to user-defined data. Returns: None.
GetSize: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_DWORD>Callback function to retrieve the current file stream size.
Parameters: clientData - Pointer to user-defined data. Returns: Size of file stream.
ReadBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>Callback function to read data from the current file stream.
Parameters: clientData - Pointer to user-defined data. offset - Offset position starts from the beginning of file stream. This parameter indicates reading position. buffer - Memory buffer to store data which are read from file stream. This parameter should not be NULL. size - Size of data which should be read from file stream, in bytes. The buffer indicated by |buffer| must be large enough to store specified data. Returns: 0 for success, other value for failure.
WriteBlock: Option<unsafe extern "C" fn(clientData: *mut c_void, offset: FPDF_DWORD, buffer: *const c_void, size: FPDF_DWORD) -> FPDF_RESULT>Callback function to write data into the current file stream.
Parameters: clientData - Pointer to user-defined data. offset - Offset position starts from the beginning of file stream. This parameter indicates writing position. buffer - Memory buffer contains data which is written into file stream. This parameter should not be NULL. size - Size of data which should be written into file stream, in bytes. Returns: 0 for success, other value for failure.
Flush: Option<unsafe extern "C" fn(clientData: *mut c_void) -> FPDF_RESULT>Callback function to flush all internal accessing buffers.
Parameters: clientData - Pointer to user-defined data. Returns: 0 for success, other value for failure.
Truncate: Option<unsafe extern "C" fn(clientData: *mut c_void, size: FPDF_DWORD) -> FPDF_RESULT>Callback function to change file size.
Description: This function is called under writing mode usually. Implementer can determine whether to realize it based on application requests. Parameters: clientData - Pointer to user-defined data. size - New size of file stream, in bytes. Returns: 0 for success, other value for failure.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FPDF_FILEHANDLER_
impl !Send for FPDF_FILEHANDLER_
impl !Sync for FPDF_FILEHANDLER_
impl Unpin for FPDF_FILEHANDLER_
impl UnwindSafe for FPDF_FILEHANDLER_
Blanket Implementations
Mutably borrows from an owned value. Read more