home *** CD-ROM | disk | FTP | other *** search
- /*
- * illustrates the use of extended tty charateristics
- *
- */
-
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/ioctl.h>
- #include <sys/ttold.h>
-
- #ifdef TIOCSLTC
- struct ltchars old_chars, new_chars;
- #define ctl(c) ((c)&037)
- #endif
-
- main ()
- {
- #ifdef TIOCSLTC
- /*
- * save off ltchars settings,
- * and change some
- */
- (void)ioctl(fileno(stdin), TIOCGLTC, (char *)&old_chars);
- new_chars = old_chars;
- if (old_chars.t_lnextc == ctl('v'))
- new_chars.t_lnextc = -1;
- if (old_chars.t_rprntc == ctl('r'))
- new_chars.t_rprntc = -1;
- (void)ioctl(fileno(stdin), TIOCSLTC, (char *)&new_chars);
- #endif
- }
-
- /*
- * on program exit, restore old ltchars settings
- */
- void
- on_quit()
- {
- #ifdef TIOCSLTC
- (void)ioctl(fileno(stdin), TIOCSLTC, (char *)&old_chars);
- #endif
- }
-
-