home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
security
/
login_1
/
c
/
get
next >
Wrap
Text File
|
1995-08-29
|
515b
|
35 lines
/* vi:tabstop=4:shiftwidth=4:smartindent
*
* get.c - Obtains a line from the input, with or without
* echoing. char *line should point to a 1K buffer.
*
*/
#include <stdio.h>
#include <unistd.h>
void get(char *prompt, char *line, int echo)
{
if (feof(stdin))
{
putchar('\n');
freopen("/dev/tty", "r", stdin);
}
printf("%s", prompt);
fflush(stdout);
if (!echo)
{
os_vdu(21);
}
fgets(line, 1024, stdin);
line[strlen(line)-1] = '\0';
if (!echo)
{
os_vdu(6);
putchar('\n');
}
}