source: trunk/minix/lib/curses/wgetstr.c@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 583 bytes
RevLine 
[9]1#include <curses.h>
2#include "curspriv.h"
3
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/****************************************************************/
10
11int wgetstr(win, str)
12WINDOW *win;
13char *str;
14{
15 while ((*str = wgetch(win)) != ERR && *str != '\n') str++;
16 if (*str == ERR) {
17 *str = '\0';
18 return ERR;
19 }
20 *str = '\0';
21 return OK;
22}
Note: See TracBrowser for help on using the repository browser.