GhosttyReaderFn typedef
Read bytes from a source.
The callback must set @p out_read to a value no greater than @p capacity when returning true. A positive value reports progress; it may be less than capacity and does not indicate end-of-file. A zero value is definitive end-of-file. It must not be used to report temporary input starvation or a would-block condition.
Returning false reports a fatal read error and the value of @p out_read is ignored. The library does not inspect or modify errno.
All pointer arguments are borrowed and valid only for the duration of the callback. The callback is invoked synchronously on the calling thread.
@param userdata Opaque userdata from GhosttyReader
@param buffer Destination for read bytes; always non-NULL
@param capacity Writable capacity of @p buffer; always greater than zero
@paramout out_read Number of bytes read when returning true; non-NULL
@return true for a successful read or end-of-file, false for a fatal error
Implementation
typedef GhosttyReaderFn =
ffi.Pointer<ffi.NativeFunction<GhosttyReaderFnFunction>>;