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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <stddef.h>
15
16/** A 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
26extern char * buffered_line ( struct line_buffer *linebuf );
27extern int line_buffer ( struct line_buffer *linebuf,
28 const char *data, size_t len );
29extern void empty_line_buffer ( struct line_buffer *linebuf );
30
31#endif /* _IPXE_LINEBUF_H */
ring len
Length.
Definition dwmac.h:226
uint8_t data[48]
Additional event data.
Definition ena.h:11
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
int line_buffer(struct line_buffer *linebuf, const char *data, size_t len)
Buffer up received data by lines.
Definition linebuf.c:92
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
A line buffer.
Definition linebuf.h:17
size_t len
Length of buffered data.
Definition linebuf.h:21
char * data
Data buffer.
Definition linebuf.h:19
size_t consumed
Most recently consumed length.
Definition linebuf.h:23