


     FFFFGGGGEEEETTTTFFFFLLLLNNNN((((3333))))		     XXXXEEEENNNNIIIIXXXX 3333....0000 ((((llllooooccccaaaallll))))		    FFFFGGGGEEEETTTTFFFFLLLLNNNN((((3333))))



     NNNNAAAAMMMMEEEE
	  fgetfln - read an arbitrarily long, possibly continued line
	  (DRAFT)

     SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
	  ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
	  ####iiiinnnncccclllluuuuddddeeee <<<<ffffggggeeeettttffffllllnnnn....hhhh>>>>

	  cccchhhhaaaarrrr ****ffffggggeeeettttffffllllnnnn((((ssssttttrrrreeeeaaaammmm,,,,	lllliiiimmmmiiiitttt,,,, lllleeeennnnpppp))))
	  FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;
	  iiiinnnntttt lllliiiimmmmiiiitttt,,,, ****lllleeeennnnpppp;;;;

	  cccchhhhaaaarrrr ****ffffggggeeeettttllllnnnn((((ssssttttrrrreeeeaaaammmm))))
	  FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;

	  cccchhhhaaaarrrr ****ccccffffggggeeeettttllllnnnn((((ssssttttrrrreeeeaaaammmm))))
	  FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;

	  cccchhhhaaaarrrr ****ffffggggeeeettttlllliiiinnnneeee((((ssssttttrrrreeeeaaaammmm,,,, lllleeeennnnpppp))))
	  FFFFIIIILLLLEEEE ****ssssttttrrrreeeeaaaammmm;;;;
	  iiiinnnntttt ****lllleeeennnnpppp;;;;

	  cccchhhhaaaarrrr ****ddddooooggggeeeettttssss((((lllliiiinnnneeee,,,, lllleeeennnnpppp))))
	  cccchhhhaaaarrrr ****lllliiiinnnneeee;;;;
	  iiiinnnntttt ****lllleeeennnnpppp;;;;

     DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
	  _F_g_e_t_f_l_n reads	an arbitrarily long line from _s_t_r_e_a_m,
	  allocating memory via	_m_a_l_l_o_c(3) as needed.  If _l_i_m_i_t is
	  non-negative,	_f_g_e_t_f_l_n	will read no more than _l_i_m_i_t bytes
	  from _s_t_r_e_a_m.	If _l_e_n_p	is non-null, _s_t_r_l_e_n of the returned
	  string will be stored	through	_l_e_n_p.

	  _f_g_e_t_l_n (to read without continuations) and _c_f_g_e_t_l_n (to read
	  with continuations and remove	leading	whitespace) should be
	  used instead when the	_l_i_m_i_t is not needed.  Their
	  definitions are:

	       ####ddddeeeeffffiiiinnnneeee ffffggggeeeettttllllnnnn((((ffffpppp))))  ffffggggeeeettttffffllllnnnn((((ffffpppp,,,, ----1111,,,, ((((iiiinnnntttt	****))))NNNNUUUULLLLLLLL))))	 ////**** uuuunnnnbbbboooouuuunnnnddddeeeedddd rrrreeeeaaaadddd ****////
	       ####ddddeeeeffffiiiinnnneeee ccccffffggggeeeettttllllnnnn((((ffffpppp)))) ccccssssffffggggeeeettttffffllllnnnn((((ffffpppp,,,, 1111))))    ////**** uuuunnnnbbbboooouuuunnnnddddeeeedddd ccccoooonnnntttt....dddd rrrreeeeaaaadddd	****////

	  _f_g_e_t_l_i_n_e is the 4.4BSD routine.  _D_o_g_e_t_s hacks	any newline
	  off the end of _l_i_n_e (as determined from the _s_t_r_l_e_n *_l_e_n_p),
	  adjusts *_l_e_n_p	to match, and returns _l_i_n_e.

	  _F_g_e_t_f_l_n is intended to provide a reliable mechanism for
	  reading input	containing lines of arbitrary length, rather
	  than trusting	that no	line will be longer than some
	  arbitrary tolerance.

	  The memory returned by _f_g_e_t_f_l_n must not be returned via
	  _f_r_e_e(3); it will be reused by	_f_g_e_t_f_l_n.  Conversely, the



     Page 1					      (printed 8/2/94)






     FFFFGGGGEEEETTTTFFFFLLLLNNNN((((3333))))		     XXXXEEEENNNNIIIIXXXX 3333....0000 ((((llllooooccccaaaallll))))		    FFFFGGGGEEEETTTTFFFFLLLLNNNN((((3333))))



	  memory returned by _c_s_f_g_e_t_l_n must be returned via _f_r_e_e(3).

     SSSSEEEEEEEE AAAALLLLSSSSOOOO
	  _m_a_l_l_o_c(3), _f_g_e_t_s(3)

     DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
	  Returns NULL (0) if memory cannot be allocated or upon
	  reading end-of-file; use _f_e_o_f(_s_t_r_e_a_m)	to distinguish.

     HHHHIIIISSSSTTTTOOOORRRRYYYY
	  Written by Geoff Collyer at Software Tool & Die as part of
	  the C	news project.

     BBBBUUUUGGGGSSSS
	  It's not yet clear how fast _c_s_f_g_e_t_l_n is.








































     Page 2					      (printed 8/2/94)



