posix_getline.h 657 B

123456789101112131415161718192021222324
  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. * https://github.com/mysterywolf/getline/
  9. *
  10. * Meco Man 2020-09-03 First Version
  11. */
  12. #ifndef POSIX_GETLINE_H
  13. #define POSIX_GETLINE_H
  14. #include <stdio.h>
  15. #include <sys/types.h>
  16. ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
  17. ssize_t getline(char **lineptr, size_t *n, FILE *stream);
  18. #endif /* POSIX_GETLINE_H */