WYRDTEK Home Features Reference Downloads About


struct es_wb is an opaque data structure representing a write-buffer. A write-buffer is used for buffered writing to a file descriptor. It is meant to be used as a wrapper over the write() system call:

It is inefficient to make repeated calls to write() in order to write many small items of data. It is more efficient to write incrementally to a buffer and then flush the contents of that buffer in a single call to write().

The write-buffer facilitates this by presenting a write()-like interface that can be called repeatedly for small items of data but which, under the covers, is buffering most of these writes and only occasionally flushing the buffer via a write() system call.
es_wb_new Construct a new wriite-buffer with respect to a file-descriptor.
es_wb_delete Destroy a write-buffer.
es_wb_write Write data to write-buffer from user-supplied buffer.
es_wb_flush Explicitly flush buffer contents to file descriptor via a write() system call.
es_wb_reset Reset and switch write-buffer to write to a new file-descriptor.

[Back To Reference]