readline.h 434 B

12345678910111213
  1. typedef struct {
  2. int read_fd; /* caller's descriptor to read from */
  3. char *read_ptr; /* caller's buffer to read into */
  4. size_t read_maxlen; /* max #bytes to read */
  5. /* next three are used internally by the function */
  6. int rl_cnt; /* initialize to 0 */
  7. char *rl_bufptr; /* initialize to rl_buf */
  8. char rl_buf[MAXLINE];
  9. } Rline;
  10. void readline_rinit(int, void *, size_t, Rline *);
  11. ssize_t readline_r(Rline *);