aboutsummaryrefslogtreecommitdiff
path: root/sys/libc/crdukey.c
blob: a0b7042c8f69c6932ec26ee8a9ae0c3acfe9330b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
*/

#define import_spp
#define	import_libc
#define	import_xnames
#include <iraf.h>


/* C_RDUKEY -- Read a user keystroke object from the terminal in raw mode.
*/
int
c_rdukey (
  char	*obuf,			/* output buffer	*/
  int	maxch			/* maxc chars out	*/
)
{
	XCHAR	buf[SZ_LINE+1];
	XINT	x_maxch = SZ_LINE;
	int	status;


	obuf[0] = EOS;
	if ((status = (int) RDUKEY (buf, &x_maxch)) > 0)
	    c_strpak (buf, obuf, maxch);

	return (status);
}