63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
typedef bool (^of_stream_async_read_line_block_t)(OFStream *stream,
OFString *_Nullable line, id _Nullable exception);
/*!
* @brief A block which is called when data was written to the stream.
*
* @param stream The stream to which data was written
* @param buffer The buffer which was written to the stream
* @param bytesWritten The number of bytes which have been written. This
* matches the length specified on the asynchronous write
* if no exception was encountered.
* @param exception An exception which occurred while reading or `nil` on
* success
* @return The length to repeat the write with or 0 if it should not repeat.
* The buffer may be changed, so that every time a new buffer and length
* can be specified while the callback stays the same.
*/
typedef size_t (^of_stream_async_write_block_t)(OFStream *stream,
const void *_Nonnull *_Nonnull buffer, size_t bytesWritten,
|
|
>
>
|
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
typedef bool (^of_stream_async_read_line_block_t)(OFStream *stream,
OFString *_Nullable line, id _Nullable exception);
/*!
* @brief A block which is called when data was written to the stream.
*
* @param stream The stream to which data was written
* @param buffer A pointer to the buffer which was written to the stream. This
* can be changed to point to a different buffer to be used on the
* next write.
* @param bytesWritten The number of bytes which have been written. This
* matches the length specified on the asynchronous write
* if no exception was encountered.
* @param exception An exception which occurred while writing or `nil` on
* success
* @return The length to repeat the write with or 0 if it should not repeat.
* The buffer may be changed, so that every time a new buffer and length
* can be specified while the callback stays the same.
*/
typedef size_t (^of_stream_async_write_block_t)(OFStream *stream,
const void *_Nonnull *_Nonnull buffer, size_t bytesWritten,
|
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
|
* @param target The target on which the selector should be called when the
* data has been written. The method should return the length for
* the next write with the same callback or 0 if it should not
* repeat. The buffer may be changed, so that every time a new
* buffer and length can be specified while the callback stays
* the same.
* @param selector The selector to call on the target. The signature must be
* `bool (OFStream *stream, const void *buffer,
* size_t bytesWritten, id context, id exception)`.
* @param context A context object to pass along to the target
*/
- (void)asyncWriteBuffer: (const void *)buffer
length: (size_t)length
target: (id)target
selector: (SEL)selector
|
|
|
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
|
* @param target The target on which the selector should be called when the
* data has been written. The method should return the length for
* the next write with the same callback or 0 if it should not
* repeat. The buffer may be changed, so that every time a new
* buffer and length can be specified while the callback stays
* the same.
* @param selector The selector to call on the target. The signature must be
* `size_t (OFStream *stream, const void *buffer,
* size_t bytesWritten, id context, id exception)`.
* @param context A context object to pass along to the target
*/
- (void)asyncWriteBuffer: (const void *)buffer
length: (size_t)length
target: (id)target
selector: (SEL)selector
|