NAMEgetline, getdelim - delimited string input
SYNOPSIS
#include <stdio.h>
ssize_t getline(char **restrict lineptr, size_t *restrict n, FILE *restrict stream); ssize_t getdelim(char **restrict lineptr, size_t *restrict n, int delim, FILE *restrict stream);
getline(), getdelim():
Since glibc 2.10: _POSIX_C_SOURCE >= 200809L Before glibc 2.10: _GNU_SOURCE
DESCRIPTIONgetline() reads an entire line from stream, storing the address of the buffer containing the text into *lineptr. The buffer is null-terminated and includes the newline character, if one was found.
If *lineptr is set to NULL a failure, errno is set to indicate the error.
ERRORS
- EINVAL
- Bad arguments (n or lineptr is NULL, or stream is not valid).
-.
EXAMPLES
d:\n", nread); fwrite(line, nread, 1, stdout); } free(line); fclose(stream); exit(EXIT_SUCCESS); }