iPXE
linebuf.h
Go to the documentation of this file.
00001 #ifndef _IPXE_LINEBUF_H
00002 #define _IPXE_LINEBUF_H
00003 
00004 /** @file
00005  *
00006  * Line buffering
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <stdint.h>
00013 #include <stddef.h>
00014 
00015 /** A line buffer */
00016 struct line_buffer {
00017         /** Data buffer */
00018         char *data;
00019         /** Length of buffered data */
00020         size_t len;
00021         /** Most recently consumed length */
00022         size_t consumed;
00023 };
00024 
00025 extern char * buffered_line ( struct line_buffer *linebuf );
00026 extern int line_buffer ( struct line_buffer *linebuf,
00027                          const char *data, size_t len );
00028 extern void empty_line_buffer ( struct line_buffer *linebuf );
00029 
00030 #endif /* _IPXE_LINEBUF_H */