1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-06-12 12:36:39 +02:00
Files
coreutils/lib/getline.c
T

45 lines
1.3 KiB
C
Raw Normal View History

1995-09-19 14:30:59 +00:00
/* getline.c -- Replacement for GNU C library function getline
2004-05-17 13:17:45 +00:00
Copyright (C) 1993, 1996, 1997, 1998, 2000, 2003, 2004 Free
Software Foundation, Inc.
1995-09-19 14:30:59 +00:00
2003-06-17 19:57:27 +00:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
1995-09-19 14:30:59 +00:00
2003-06-17 19:57:27 +00:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1995-09-19 14:30:59 +00:00
2003-06-17 19:57:27 +00:00
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1995-09-19 14:30:59 +00:00
/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
1996-07-14 12:32:01 +00:00
#if HAVE_CONFIG_H
1996-04-22 03:02:55 +00:00
# include <config.h>
1995-09-19 14:30:59 +00:00
#endif
2003-06-17 19:57:27 +00:00
#include "getline.h"
2004-05-17 13:17:45 +00:00
#if ! (defined __GNU_LIBRARY__ && HAVE_GETDELIM)
1996-04-22 03:02:55 +00:00
2003-08-07 09:26:06 +00:00
# include "getndelim2.h"
ssize_t
2004-05-17 13:17:45 +00:00
getdelim (char **lineptr, size_t *linesize, int delimiter, FILE *stream)
1995-09-19 14:30:59 +00:00
{
2004-05-17 13:17:45 +00:00
return getndelim2 (lineptr, linesize, 0, GETNLINE_NO_LIMIT, delimiter, EOF,
stream);
1995-09-19 14:30:59 +00:00
}
2004-05-17 13:17:45 +00:00
#endif
1996-04-22 03:02:55 +00:00
2003-08-07 09:26:06 +00:00
ssize_t
2004-05-17 13:17:45 +00:00
getline (char **lineptr, size_t *linesize, FILE *stream)
1996-04-22 03:02:55 +00:00
{
2004-05-17 13:17:45 +00:00
return getdelim (lineptr, linesize, '\n', stream);
1996-04-22 03:02:55 +00:00
}