#include <std.h>
#include <vms.h>
#include <iodef.h>

VOID main()
{
char inchar;
unsigned short chan = 0;
static $DESCRIPTOR(sysindes, "SYS$INPUT");

if (!(sys$assign(&sysindes,&chan,NULL,NULL)&1)) /* Assign chan to     */
        error("can't open SYS$INPUT",NULL);     /* terminal input     */

do {
  sys$qiow(NULL,chan,IO$_READVBLK               /* Read               */
                     |IO$M_NOECHO               /* without echo       */
                     |IO$M_NOFILTR,             /* pass ^U, ^R, del   */
                     NULL,NULL,NULL,&inchar,    /* to inchar          */
                     1,                         /* 1 character        */
                     NULL,NULL,NULL,NULL);
  putfmt("%c\n",inchar);                        /* Show what we got   */
} while (inchar != '\032');                     /* Ctrl/Z = exit      */

sys$dassgn(chan);                               /* Deassign chan      */
exit();
}       
