Initial revision
[LeanCalc.git] / help / fgetstr
1 NAME
2     fgetstr - read the next null-terminated string from a file
3
4 SYNOPSIS
5     fgetstr(fs)
6
7 TYPES
8     fs          file stream open for reading
9
10     return      string, null or error value
11
12 DESCRIPTION
13     If the stream is at end of file, the null value is returned.
14
15     If the stream cannot be read, an error value is returned.
16
17     Otherwise the function returns the string of characters from the
18     current file position to the first null character ('\0') (the file
19     position for further reading then being immediately after the '\0'),
20     or if no null character is encountered, the string of characters to
21     the end of file (the string as usual being terminated by '\0').
22
23     If the stream being read is from stdin (i.e. files(0)), the
24     characters entered are not displayed and reading ends when a '\0' is
25     entered (on many terminals this is by ctrl-@).
26
27 EXAMPLE
28     > f = fopen("/tmp/junk", "w")
29     > fputstr(f, "  Alpha    Beta ", "", "Gamma\n\tDelta")
30     > freopen(f, "r")
31     > fgetstr(f)
32         "  Alpha    Beta "
33     > fgetstr(f)
34         ""
35     > fgetstr(f)
36         "Gamma
37         Delta"
38     > fgetstr(f)
39     >
40
41 LIMITS
42     none - XXX - is this correct?
43
44 LINK LIBRARY
45     none - XXX - is this correct?
46
47 SEE ALSO
48     fputstr, fgetword, fgets, fputs, fopen, files, fprintf
49