add bs_seterrorstate
This commit is contained in:
parent
606a282145
commit
235dfb18cd
6
buffer/bs_seterrorstate.c
Normal file
6
buffer/bs_seterrorstate.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include "parse.h"
|
||||
|
||||
void bs_seterrorstate(struct bytestream* b) {
|
||||
b->cur = 1;
|
||||
b->max = 0;
|
||||
}
|
3
parse.h
3
parse.h
@ -83,6 +83,9 @@ unsigned char bs_peek(struct bytestream* bs);
|
||||
/* was there a read error or did we attempt to read more than maxlen bytes? */
|
||||
int bs_err(struct bytestream* bs);
|
||||
|
||||
/* mark bytestream as erroneous */
|
||||
void bs_seterrorstate(struct bytestream* b);
|
||||
|
||||
/* Can we read this much more bytes from the bytestream? */
|
||||
/* returns 1 for yes, 0 for no */
|
||||
int bs_capacitycheck(struct bytestream* bs,size_t capacity);
|
||||
|
Loading…
x
Reference in New Issue
Block a user