RCVCHAR(3R)

NAME
rcvchar - receive character from host

SYNOPSIS
int rcvchar ( )

DESCRIPTION
The rcvchar function returns the next character received from the host. If there are no characters available, rcvchar returns -1.

Since local programs have no host connection, a call to rcvchar by a local program will always return -1.

EXAMPLE
The following program is a very simple terminal emulator.

    #include <dmd.h>
    main()
    {
    	int c;
    	request(RCV);
    	for(;;) {
    		wait(RCV);
    		while( (c=rcvchar()) != -1 )
    			lputchar(c);
    	}
    }

SEE ALSO
local(3R), resources(3R), sendchar(3R).