You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linebuf.h 594B

123456789101112131415161718192021222324252627282930
  1. #ifndef _IPXE_LINEBUF_H
  2. #define _IPXE_LINEBUF_H
  3. /** @file
  4. *
  5. * Line buffering
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <stddef.h>
  11. /** A line buffer */
  12. struct line_buffer {
  13. /** Data buffer */
  14. char *data;
  15. /** Length of buffered data */
  16. size_t len;
  17. /** Most recently consumed length */
  18. size_t consumed;
  19. };
  20. extern char * buffered_line ( struct line_buffer *linebuf );
  21. extern int line_buffer ( struct line_buffer *linebuf,
  22. const char *data, size_t len );
  23. extern void empty_line_buffer ( struct line_buffer *linebuf );
  24. #endif /* _IPXE_LINEBUF_H */