1 /* Copyright (C) 1995, 2000-2002 Free Software Foundation, Inc.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24 /* Like the glibc functions get_line and get_delim, except that the result
25 must be freed using delete[], not free(). */
27 /* Reads up to (and including) a newline from STREAM into *LINEPTR
28 (and null-terminate it). *LINEPTR is a pointer returned from new [] (or
29 NULL), pointing to *N characters of space. It is realloc'd as
30 necessary. Returns the number of characters read (not including the
31 null terminator), or -1 on error or immediate EOF. */
32 extern int get_line (char **lineptr, size_t *n, FILE *stream);
34 /* Reads up to (and including) a DELIMITER from STREAM into *LINEPTR
35 (and null-terminate it). *LINEPTR is a pointer returned from new [] (or
36 NULL), pointing to *N characters of space. It is realloc'd as
37 necessary. Returns the number of characters read (not including the
38 null terminator), or -1 on error or immediate EOF. */
39 extern int get_delim (char **lineptr, size_t *n, int delimiter, FILE *stream);
41 #endif /* not GETLINE_H_ */