Commit | Line | Data |
---|---|---|
6e1c93d0 | 1 | /* |
2f14f200 KB |
2 | * Copyright (c) 1981 Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
c07973a2 | 5 | * %sccs.include.redist.c% |
6e1c93d0 DF |
6 | */ |
7 | ||
8 | #ifndef lint | |
c07973a2 | 9 | static char sccsid[] = "@(#)getstr.c 5.4 (Berkeley) %G%"; |
2f14f200 | 10 | #endif /* not lint */ |
6e1c93d0 | 11 | |
94aeb2d1 KA |
12 | # include "curses.ext" |
13 | ||
14 | /* | |
15 | * This routine gets a string starting at (_cury,_curx) | |
16 | * | |
94aeb2d1 KA |
17 | */ |
18 | wgetstr(win,str) | |
19 | reg WINDOW *win; | |
20 | reg char *str; { | |
21 | ||
57bc80fd | 22 | while ((*str = wgetch(win)) != ERR && *str != '\n') |
94aeb2d1 | 23 | str++; |
158defd2 | 24 | if (*str == ERR) { |
158defd2 | 25 | *str = '\0'; |
7527eef6 | 26 | return ERR; |
158defd2 KA |
27 | } |
28 | *str = '\0'; | |
94aeb2d1 KA |
29 | return OK; |
30 | } |