iPXE
linebuf.h
Go to the documentation of this file.
1 #ifndef _IPXE_LINEBUF_H
2 #define _IPXE_LINEBUF_H
3 
4 /** @file
5  *
6  * Line buffering
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <stdint.h>
14 #include <stddef.h>
15 
16 /** A line buffer */
17 struct line_buffer {
18  /** Data buffer */
19  char *data;
20  /** Length of buffered data */
21  size_t len;
22  /** Most recently consumed length */
23  size_t consumed;
24 };
25 
26 extern char * buffered_line ( struct line_buffer *linebuf );
27 extern int line_buffer ( struct line_buffer *linebuf,
28  const char *data, size_t len );
29 extern void empty_line_buffer ( struct line_buffer *linebuf );
30 
31 #endif /* _IPXE_LINEBUF_H */
char * buffered_line(struct line_buffer *linebuf)
Retrieve buffered-up line.
Definition: linebuf.c:46
void empty_line_buffer(struct line_buffer *linebuf)
Discard line buffer contents.
Definition: linebuf.c:66
size_t consumed
Most recently consumed length.
Definition: linebuf.h:23
char * data
Data buffer.
Definition: linebuf.h:19
ring len
Length.
Definition: dwmac.h:231
size_t len
Length of buffered data.
Definition: linebuf.h:21
FILE_SECBOOT(PERMITTED)
int line_buffer(struct line_buffer *linebuf, const char *data, size_t len)
Buffer up received data by lines.
Definition: linebuf.c:92
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
A line buffer.
Definition: linebuf.h:17
uint8_t data[48]
Additional event data.
Definition: ena.h:22