2 fgetline - read the next line from a file, newline is tossed
13 This function reads the next line, including any trailing newline from
14 the open file associated with fd. Unlike fgets, the trailing
15 newline is removed from the return string.
17 Empty lines return the null string. When the end of file is reached,
18 fgetline returns the null value. (Note the distinction between a null
19 string and a null value.)
21 If the line contained a numeric value, then the 'eval' function can
22 then be used to convert the string to a numeric value.
24 If a line is read, is returned minus the trailing newline, otherwise
25 (EOF or ERROR) nil is returned.
28 ; fd = fopen("/tmp/newfile", "w")
29 ; fputs(fd, "chongo was here\n")
31 ; fd2 = fopen("/tmp/newfile", "r")
37 ; fd2 = fopen("/tmp/newfile", "r")
44 fd must be associated with an open file
50 errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen,
51 fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt
53 ## Copyright (C) 1999 Landon Curt Noll
55 ## Calc is open software; you can redistribute it and/or modify it under
56 ## the terms of the version 2.1 of the GNU Lesser General Public License
57 ## as published by the Free Software Foundation.
59 ## Calc is distributed in the hope that it will be useful, but WITHOUT
60 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
61 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
62 ## Public License for more details.
64 ## A copy of version 2.1 of the GNU Lesser General Public License is
65 ## distributed with calc under the filename COPYING-LGPL. You should have
66 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
67 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
69 ## @(#) $Revision: 30.1 $
70 ## @(#) $Id: fgetline,v 30.1 2007/03/16 11:10:42 chongo Exp $
71 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetline,v $
73 ## Under source code control: 1995/03/04 11:33:19
74 ## File existed as early as: 1995
76 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
77 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/