From 2080551cb6861021940db38330a8fabd6317ad0a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 30 Sep 2007 05:53:48 +0200 Subject: [PATCH] Tweak doc of getdelim and getline declarations. --- ChangeLog | 4 ++++ lib/stdio_.h | 27 +++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13c922fba..035b2c999 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-09-29 Bruno Haible + * lib/stdio_.h (getdelim, getline): Add identifiers. Doc tweak. + +2007-09-29 Bruno Haible + * lib/xreadlink.c (xreadlink): Simplify to a wrapper around areadlink. * modules/xreadlink (Depends-on): Add areadlink, remove readlink etc. * build-aux/install-reloc: Compile also areadlink.c. diff --git a/lib/stdio_.h b/lib/stdio_.h index 76d985637..5264194bd 100644 --- a/lib/stdio_.h +++ b/lib/stdio_.h @@ -308,12 +308,14 @@ extern long rpl_ftell (FILE *fp); #if @GNULIB_GETDELIM@ # if !@HAVE_DECL_GETDELIM@ - /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and - NUL-terminate it). *LINEPTR is a pointer returned from malloc (or - NULL), pointing to *N characters of space. It is realloc'ed as - necessary. Returns the number of characters read (not including - the null terminator), or -1 on error or EOF. */ - extern ssize_t getdelim (char **, size_t *, int delim, FILE *); +/* Read input, up to (and including) the next occurrence of DELIMITER, from + STREAM, store it in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, + FILE *stream); # endif #elif defined GNULIB_POSIXCHECK # undef getdelim @@ -329,12 +331,13 @@ extern long rpl_ftell (FILE *fp); # define getline rpl_getline # endif # if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@ - /* Read up to (and including) a newline from FP into *LINEPTR (and - NUL-terminate it). *LINEPTR is a pointer returned from malloc (or - NULL), pointing to *N characters of space. It is realloc'ed as - necessary. Returns the number of characters read (not including - the null terminator), or -1 on error or EOF. */ - extern ssize_t getline (char **, size_t *, FILE *); +/* Read a line, up to (and including) the next newline, from STREAM, store it + in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); # endif #elif defined GNULIB_POSIXCHECK # undef getline -- 2.11.0