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 12 #include <stdint.h> 13 #include <stddef.h> 14 15 /** A line buffer */ 16 struct line_buffer { 17 /** Data buffer */ 18 char *data; 19 /** Length of buffered data */ 20 size_t len; 21 /** Most recently consumed length */ 22 size_t consumed; 23 }; 24 25 extern char * buffered_line ( struct line_buffer *linebuf ); 26 extern int line_buffer ( struct line_buffer *linebuf, 27 const char *data, size_t len ); 28 extern void empty_line_buffer ( struct line_buffer *linebuf ); 29 30 #endif /* _IPXE_LINEBUF_H */ 31