47 char *line = &linebuf->
data[ linebuf->
len ];
50 if ( ( linebuf->
len == 0 ) || ( linebuf->
consumed == 0 ) ||
51 ( *(--line) !=
'\0' ) )
55 while ( ( line > linebuf->
data ) && ( line[-1] !=
'\0' ) )
102 consume = ( eol -
data + 1 );
112 new_len = ( linebuf->
len + consume );
113 new_data =
realloc ( linebuf->
data, ( new_len + 1 ) );
117 new_data[new_len] =
'\0';
118 linebuf->
data = new_data;
119 linebuf->
len = new_len;
126 lf = &linebuf->
data[ linebuf->
len - 1 ];
131 if ( linebuf->
len > 1 ) {
#define NULL
NULL pointer (VOID *)
#define assert(condition)
Assert a condition at run-time.
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int line_buffer(struct line_buffer *linebuf, const char *data, size_t len)
Buffer up received data by lines.
char * buffered_line(struct line_buffer *linebuf)
Retrieve buffered-up line.
void empty_line_buffer(struct line_buffer *linebuf)
Discard line buffer contents.
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
static void(* free)(struct refcnt *refcnt))
void * memchr(const void *src, int character, size_t len)
Find character within a memory region.
size_t len
Length of buffered data.
size_t consumed
Most recently consumed length.