secondary cache feature in vm.
[minix.git] / lib / libcurses / wgetstr.c
blob2458e4b8910026df6c17c465f79a9a5d7ce1e7fa
1 #include <curses.h>
2 #include "curspriv.h"
4 /****************************************************************/
5 /* Wgetstr(win,str) reads in a string (terminated by \n or \r) */
6 /* To the buffer pointed to by 'str', and displays the input */
7 /* In window 'win'. The user's erase and kill characters are */
8 /* Active. */
9 /****************************************************************/
11 int wgetstr(win, str)
12 WINDOW *win;
13 char *str;
15 while ((*str = wgetch(win)) != ERR && *str != '\n') str++;
16 if (*str == ERR) {
17 *str = '\0';
18 return ERR;
20 *str = '\0';
21 return OK;