Bruno Haible <[EMAIL PROTECTED]> writes: > Hi Simon, > > May I add comments to getline.h?
I suppose this has the same issue as the fix in getdelim.h. > And also in getline.c, add the specification header before the others, to > verify it's self-contained. No objections here. > Bruno > > > *** gnulib-20060430/lib/getline.h 2005-08-02 11:33:30.000000000 +0200 > --- gnulib-20060430-modified/lib/getline.h 2006-05-01 17:07:58.000000000 > +0200 > *************** > *** 1,5 **** > /* getline.h --- Prototype for replacement getline function. > ! Copyright (C) 2005 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License as > --- 1,5 ---- > /* getline.h --- Prototype for replacement getline function. > ! Copyright (C) 2005-2006 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License as > *************** > *** 19,28 **** > /* Written by Simon Josefsson. */ > > /* Get size_t, FILE, ssize_t. And getline, if available. */ > ! # include <stddef.h> > ! # include <stdio.h> > ! # include <sys/types.h> > > #if !HAVE_DECL_GETLINE > ! ssize_t getline (char **lineptr, size_t *n, FILE *stream); > ! #endif /* !HAVE_GETLINE */ > --- 19,34 ---- > /* Written by Simon Josefsson. */ > > /* Get size_t, FILE, ssize_t. And getline, if available. */ > ! #include <stddef.h> > ! #include <stdio.h> > ! #include <sys/types.h> > > #if !HAVE_DECL_GETLINE > ! /* 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 /* !HAVE_DECL_GETLINE */ > *** gnulib-20060430/lib/getline.c 2005-09-19 19:28:14.000000000 +0200 > --- gnulib-20060430-modified/lib/getline.c 2006-05-01 17:08:25.000000000 > +0200 > *************** > *** 1,5 **** > /* getline.c --- Implementation of replacement getline function. > ! Copyright (C) 2005 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License as > --- 1,5 ---- > /* getline.c --- Implementation of replacement getline function. > ! Copyright (C) 2005-2006 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License as > *************** > *** 22,30 **** > # include <config.h> > #endif > > ! #include "getdelim.h" > #include "getline.h" > > ssize_t > getline (char **lineptr, size_t *n, FILE *stream) > { > --- 22,32 ---- > # include <config.h> > #endif > > ! /* Specification. */ > #include "getline.h" > > + #include "getdelim.h" > + > ssize_t > getline (char **lineptr, size_t *n, FILE *stream) > {