Skip to main content

FPDF_FILEHANDLER

Type Alias FPDF_FILEHANDLER 

Source
pub type FPDF_FILEHANDLER = FPDF_FILEHANDLER_;
Expand description

Structure for file reading or writing (I/O).

C documentation:

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.

Aliased Type§

#[repr(C)]
pub struct FPDF_FILEHANDLER { pub clientData: *mut c_void, pub Release: Option<unsafe extern "C" fn(*mut c_void)>, pub GetSize: Option<unsafe extern "C" fn(*mut c_void) -> u64>, pub ReadBlock: Option<unsafe extern "C" fn(*mut c_void, u64, *mut c_void, u64) -> i32>, pub WriteBlock: Option<unsafe extern "C" fn(*mut c_void, u64, *const c_void, u64) -> i32>, pub Flush: Option<unsafe extern "C" fn(*mut c_void) -> i32>, pub Truncate: Option<unsafe extern "C" fn(*mut c_void, u64) -> i32>, }

Fields§

§clientData: *mut c_void

User-defined data.

C documentation:

User-defined data.
Note: Callers can use this field to track controls.
§Release: Option<unsafe extern "C" fn(*mut c_void)>

Callback function to release the current file stream object.

C documentation:

Callback function to release the current file stream object.

Parameters:
      clientData   -  Pointer to user-defined data.
Returns:
      None.
§GetSize: Option<unsafe extern "C" fn(*mut c_void) -> u64>

Callback function to retrieve the current file stream size.

C documentation:

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(*mut c_void, u64, *mut c_void, u64) -> i32>

Callback function to read data from the current file stream.

C documentation:

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(*mut c_void, u64, *const c_void, u64) -> i32>

Callback function to write data into the current file stream.

C documentation:

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(*mut c_void) -> i32>

Callback function to flush all internal accessing buffers.

C documentation:

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(*mut c_void, u64) -> i32>

Callback function to change file size.

C documentation:

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.