home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
400-499
/
ff473.lzh
/
CNewsSrc
/
cnews_src.lzh
/
man
/
fgetmfs.man
< prev
next >
Wrap
Text File
|
1991-01-05
|
4KB
|
133 lines
FGETMFS(3) C LIBRARY FUNCTIONS FGETMFS(3)
NNNNAAAAMMMMEEEE
fgetmfs - read an arbitrarily long, possibly continued line
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
####iiiinnnncccclllluuuuddddeeee <<<<ffffggggeeeettttmmmmffffssss....hhhh>>>>
cccchhhhaaaarrrr ****ffffggggeeeettttmmmmffffssss((((ssssttttrrrreeeeaaaammmm,,,, lllliiiimmmmiiiitttt,,,, ccccoooonnnntttt))))
FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;
iiiinnnntttt lllliiiimmmmiiiitttt,,,, ccccoooonnnntttt;;;;
cccchhhhaaaarrrr ****ffffggggeeeettttmmmmssss((((ssssttttrrrreeeeaaaammmm))))
FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;
cccchhhhaaaarrrr ****ccccffffggggeeeettttmmmmssss((((ssssttttrrrreeeeaaaammmm))))
FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_F_g_e_t_m_f_s reads an arbitrarily long line from _s_t_r_e_a_m, allocat-
ing memory via _m_a_l_l_o_c(3) as needed. If _l_i_m_i_t is non-
negative, _f_g_e_t_m_f_s will read no more than _l_i_m_i_t bytes from
_s_t_r_e_a_m. For efficiency, if _c_o_n_t is not _C_O_N_T__N_O, such as
_C_O_N_T__N_O_S_P_C or _C_O_N_T__S_P_C, occurrences of a backslash and a
newline together and in that order will be deleted from the
input stream; if _c_o_n_t is _C_O_N_T__N_O_S_P_C, any whitespace after
the newline in the input stream will also be deleted from
it.
The macros _f_g_e_t_m_s (to read without continuations) and
_c_f_g_e_t_m_s (to read with continuations and remove leading whi-
tespace) should be used instead when the _l_i_m_i_t is not
needed.
_F_g_e_t_m_f_s is intended to provide a reliable mechanism for
reading input containing lines of arbitrary length, rather
than trusting that no line with be longer than some arbi-
trary tolerance.
The memory returned by _f_g_e_t_m_f_s should be returned when no
longer needed via _f_r_e_e(3).
SSSSEEEEEEEE AAAALLLLSSSSOOOO
_m_a_l_l_o_c(3), _f_g_e_t_s(3)
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
Returns NULL (0) if memory cannot be allocated or upon read-
ing end-of-file; use _f_e_o_f(_s_t_r_e_a_m) to distinguish.
HHHHIIIISSSSTTTTOOOORRRRYYYY
Written by Geoff Collyer at the University of Toronto as
part of the C news project.
Sun Microsystems Last change: local 1
FGETMFS(3) C LIBRARY FUNCTIONS FGETMFS(3)
BBBBUUUUGGGGSSSS
It's too slow.
The meaning of the _c_o_n_t flag is ugly, but layering this form
of continuation on top is even slower.
Sun Microsystems Last change: local 2