posix_getline.h 616 B

1234567891011121314151617181920212223
  1. /* posix_getline.h
  2. * RT-Thread POSIX
  3. * getdelim(), getline() - read a delimited record from stream, ersatz implementation
  4. * This code is unlicensed -- free and released into the public domain.
  5. * https://man7.org/linux/man-pages/man3/getline.3.html
  6. * Authors:
  7. * https://github.com/ivanrad/getline
  8. *
  9. * Meco Man 2020-09-03 porting to RT-Thread
  10. */
  11. #ifndef POSIX_GETLINE_H
  12. #define POSIX_GETLINE_H
  13. #include <stdio.h>
  14. #include <sys/types.h>
  15. ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
  16. ssize_t getline(char **lineptr, size_t *n, FILE *stream);
  17. #endif /* POSIX_GETLINE_H */