input.c: namespace enum
This commit is contained in:
parent
6ec1d0a8ae
commit
dea5819d67
8
input.c
8
input.c
|
@ -1,9 +1,9 @@
|
|||
#include "input.h"
|
||||
|
||||
enum { READ, DISCARD };
|
||||
enum { LIBSCOMM_READ, LIBSCOMM_DISCARD };
|
||||
|
||||
void libscomm_reset(struct libscomm_input *in) {
|
||||
in->state = READ;
|
||||
in->state = LIBSCOMM_READ;
|
||||
in->len = 0;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ enum libscomm_input_r libscomm_read(struct libscomm_input *in,
|
|||
while ((c = **s)) {
|
||||
(*s)++;
|
||||
|
||||
if (in->state == DISCARD) {
|
||||
if (in->state == LIBSCOMM_DISCARD) {
|
||||
if (c == '\n') {
|
||||
libscomm_reset(in);
|
||||
return LIBSCOMM_OVERFLOW;
|
||||
|
@ -53,7 +53,7 @@ enum libscomm_input_r libscomm_read(struct libscomm_input *in,
|
|||
default:
|
||||
in->intbuf[in->len++] = c;
|
||||
if (in->len == LIBSCOMM_MAXBUF)
|
||||
in->state = DISCARD;
|
||||
in->state = LIBSCOMM_DISCARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue