Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static cat_status error_state(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case '\n':
Expand Down Expand Up @@ -529,7 +529,7 @@ static cat_status parse_prefix(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case 'T':
Expand Down Expand Up @@ -695,7 +695,7 @@ static cat_status parse_command(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case '\n':
Expand Down Expand Up @@ -831,7 +831,7 @@ static cat_status wait_read_acknowledge(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case '\n':
Expand Down Expand Up @@ -896,7 +896,7 @@ static cat_status wait_test_acknowledge(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case '\n':
Expand Down Expand Up @@ -1862,7 +1862,7 @@ static cat_status parse_command_args(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case '\n':
Expand Down Expand Up @@ -1968,7 +1968,7 @@ static cat_status process_idle_state(struct cat_object *self)
assert(self != NULL);

if (read_cmd_char(self) == 0)
return CAT_STATUS_OK;
return CAT_STATUS_AGAIN;

switch (self->current_char) {
case 'A':
Expand Down Expand Up @@ -2463,7 +2463,7 @@ static cat_status process_io_write(struct cat_object *self)
}

if (self->io->write(ch) != 1)
return CAT_STATUS_BUSY;
return CAT_STATUS_AGAIN;

self->position++;
return CAT_STATUS_BUSY;
Expand Down Expand Up @@ -2493,7 +2493,7 @@ static cat_status unsolicited_process_io_write(struct cat_object *self)
}

if (self->io->write(ch) != 1)
return CAT_STATUS_BUSY;
return CAT_STATUS_AGAIN;

self->unsolicited_fsm.position++;
return CAT_STATUS_BUSY;
Expand Down
3 changes: 2 additions & 1 deletion src/cat.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ typedef enum {
CAT_STATUS_ERROR = -1,
CAT_STATUS_OK = 0,
CAT_STATUS_BUSY = 1,
CAT_STATUS_HOLD = 2
CAT_STATUS_HOLD = 2,
CAT_STATUS_AGAIN = 3
} cat_status;

/**
Expand Down