您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

linebuf.h 598B

12345678910111213141516171819202122232425262728
  1. #ifndef _GPXE_LINEBUF_H
  2. #define _GPXE_LINEBUF_H
  3. /** @file
  4. *
  5. * Line buffering
  6. *
  7. */
  8. #include <stdint.h>
  9. #include <stddef.h>
  10. /** A line buffer */
  11. struct line_buffer {
  12. /** Current string in the buffer */
  13. char *data;
  14. /** Length of current string, excluding the terminating NUL */
  15. size_t len;
  16. /** String is ready to read */
  17. int ready;
  18. };
  19. extern char * buffered_line ( struct line_buffer *linebuf );
  20. extern ssize_t line_buffer ( struct line_buffer *linebuf,
  21. const char *data, size_t len );
  22. extern void empty_line_buffer ( struct line_buffer *linebuf );
  23. #endif /* _GPXE_LINEBUF_H */