Include_files_for_shell_editor_program

malik at rdin.UUCP malik at rdin.UUCP
Sat May 12 08:04:10 AEST 1984


Subject: Re: Those annoying shell commands typ-o errors
Date:    May 11, 1984
From:    Jeffrey Malik
	 Resource Dynamics Inc.
         New York, NY
	 philabs!rdin!malik


	It appears that many do not have the include file "termio.h,"
which is needed to run my shell editor program.  To avoid any potential
legal problems with MASSCOMP, the computer I developed the program on,
I will not send the include file either through the net or personally
through the mail.  Chances are even if you had the files, it would not
work on your system.  I will, however, explain the purpose of the 
include files so you can peruse through your system's manuals for the 
proper include files.

	Firstly, the signal.h file is not used.  I forgot to delete it
on the final version.  The termio.h include file is used to access the
"termio" structure, which holds the parameters of the terminal (I/O
modes, control modes, etc).  I will include that structure:

	struct termio {
		unsigned short	c_iflag;	/* input modes */
		unsigned short	c_oflag;	/* output modes */
		unsigned short	c_cflag;	/* control modes */
		unsigned short	c_lflag;	/* line discipline modes */
		char		c_line;		/* line discipline */
		unsigned char	c_cc[NCC];	/* control chars */
	};

	The sys/ioctl.h is used in conjunction with the termio.h
include file, and is needed for the ioctl UNIX call.

	The changes I made to termio are as follows:

		c_lflag  reset icanon, to allow input from terminal
			 without the need for the carriage return
		c_cc[4]  (value for EOF) it was 4 a, Control D, set
			 it to 1
		c_cc[5]  (value for EOL) likewise
			 c_cc[4] and c_cc[5] is to accept input after
			 only one character has been typed

	To make things clearer, you should see in your system's
	manuals:

		stty (section one)
		ioctl (section two)
		tty (section four)

I hope this information will be helpful to you.



More information about the Comp.unix mailing list