xref: /csrg-svn/lib/libcurses/getstr.c (revision 67082)
122665Sdist /*
2*67082Sbostic  * Copyright (c) 1981, 1993, 1994
361270Sbostic  *	The Regents of the University of California.  All rights reserved.
434677Sbostic  *
542653Sbostic  * %sccs.include.redist.c%
622665Sdist  */
722665Sdist 
822665Sdist #ifndef lint
9*67082Sbostic static char sccsid[] = "@(#)getstr.c	8.2 (Berkeley) 05/04/94";
1055960Sbostic #endif	/* not lint */
1122665Sdist 
12*67082Sbostic #include "curses.h"
132250Sarnold 
142250Sarnold /*
1555960Sbostic  * wgetstr --
1656238Selan  *	Get a string starting at (cury, curx).
172250Sarnold  */
1855960Sbostic int
wgetstr(win,str)1955960Sbostic wgetstr(win, str)
2055960Sbostic 	register WINDOW *win;
2155960Sbostic 	register char *str;
2255960Sbostic {
2357472Sbostic 	while ((*str = wgetch(win)) != ERR && *str != '\n')
242250Sarnold 		str++;
2557472Sbostic 	if (*str == ERR) {
263639Sarnold 		*str = '\0';
2757472Sbostic 		return (ERR);
283497Sarnold 	}
292250Sarnold 	*str = '\0';
3057472Sbostic 	return (OK);
312250Sarnold }
32