rstream: Rename RStream async flag to defer

The name `async` was not appropriate to describe the behavior enabled by the
flag.
This commit is contained in:
Thiago de Arruda
2014-06-17 10:01:51 -03:00
parent ac5fb407e4
commit 1843f0c2c6

View File

@@ -24,7 +24,7 @@ struct rstream {
uv_file fd;
rstream_cb cb;
size_t buffer_size, rpos, wpos, fpos;
bool reading, free_handle, async;
bool reading, free_handle, defer;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -38,21 +38,19 @@ struct rstream {
/// for reading with `rstream_read`
/// @param buffer_size Size in bytes of the internal buffer.
/// @param data Some state to associate with the `RStream` instance
/// @param async Flag that specifies if the callback should only be called
/// outside libuv event loop(When processing async events with
/// KE_EVENT). Only the RStream instance reading user input should set
/// this to false
/// @param defer Flag that specifies if callback invocation should be deferred
/// to vim main loop(as a KE_EVENT special key)
/// @return The newly-allocated `RStream` instance
RStream * rstream_new(rstream_cb cb,
size_t buffer_size,
void *data,
bool async)
bool defer)
{
RStream *rv = xmalloc(sizeof(RStream));
rv->buffer = xmalloc(buffer_size);
rv->buffer_size = buffer_size;
rv->data = data;
rv->async = async;
rv->defer = defer;
rv->cb = cb;
rv->rpos = rv->wpos = rv->fpos = 0;
rv->stream = NULL;
@@ -333,7 +331,7 @@ static void close_cb(uv_handle_t *handle)
static void emit_read_event(RStream *rstream, bool eof)
{
if (rstream->async) {
if (rstream->defer) {
Event event;
event.type = kEventRStreamData;