Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2008 15:24:01 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 147234 for review
Message-ID:  <200808121524.m7CFO10m034513@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147234

Change 147234 by ed@ed_dull on 2008/08/12 15:23:44

	Only use TAB3 inside the kernel. Still leave OXTABS to make
	userspace happy. Don't mention OXTABS in the documentation,
	though. People should use TAB3.

Affected files ...

.. //depot/projects/mpsafetty/share/man/man4/termios.4#2 edit
.. //depot/projects/mpsafetty/sys/kern/tty.c#20 edit
.. //depot/projects/mpsafetty/sys/kern/tty_compat.c#2 edit
.. //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#9 edit
.. //depot/projects/mpsafetty/sys/sys/termios.h#4 edit

Differences ...

==== //depot/projects/mpsafetty/share/man/man4/termios.4#2 (text+ko) ====

@@ -1073,7 +1073,7 @@
 field describe the basic terminal output control,
 and are composed of the following masks:
 .Pp
-.Bl -tag -width OXTABS -offset indent -compact
+.Bl -tag -width ONOEOT -offset indent -compact
 .It Dv OPOST
 /* enable following output processing */
 .It Dv ONLCR
@@ -1082,7 +1082,7 @@
 */
 .It Dv OCRNL
 /* map CR to NL */
-.It Dv OXTABS
+.It Dv TAB3
 /* expand tabs to spaces */
 .It Dv ONOEOT
 /* discard
@@ -1109,7 +1109,7 @@
 is set, carriage returns are translated to newlines.
 .Pp
 If
-.Dv OXTABS
+.Dv TAB3
 is set, tabs are expanded to the appropriate number of
 spaces (assuming 8 column tab stops).
 .Pp

==== //depot/projects/mpsafetty/sys/kern/tty.c#20 (text+ko) ====

@@ -78,7 +78,7 @@
  */
 #define TTYSUP_IFLAG	(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\
 			INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL)
-#define TTYSUP_OFLAG	(OPOST|ONLCR|OXTABS|ONOEOT|OCRNL|ONOCR|ONLRET)
+#define TTYSUP_OFLAG	(OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET)
 #define TTYSUP_LFLAG	(ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\
 			ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\
 			FLUSHO|NOKERNINFO|NOFLSH)

==== //depot/projects/mpsafetty/sys/kern/tty_compat.c#2 (text+ko) ====

@@ -308,7 +308,7 @@
 		flags |= MDMBUF;
 	if ((cflag&HUPCL) == 0)
 		flags |= NOHANG;
-	if (oflag&OXTABS)
+	if (oflag&TAB3)
 		flags |= XTABS;
 	if (lflag&ECHOE)
 		flags |= CRTERA|CRTBS;
@@ -343,9 +343,9 @@
 		iflag |= BRKINT|IXON|IMAXBEL;
 		lflag |= ISIG|IEXTEN|ECHOCTL;	/* XXX was echoctl on ? */
 		if (flags & XTABS)
-			oflag |= OXTABS;
+			oflag |= TAB3;
 		else
-			oflag &= ~OXTABS;
+			oflag &= ~TAB3;
 		if (flags & CBREAK)
 			lflag &= ~ICANON;
 		else

==== //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#9 (text+ko) ====

@@ -372,7 +372,7 @@
 	case CTAB:
 		/* Tab expansion */
 		scnt = 8 - (tp->t_column & 7);
-		if (CMP_FLAG(o, OXTABS)) {
+		if (CMP_FLAG(o, TAB3)) {
 			error = ttyoutq_write_nofrag(&tp->t_outq,
 			    "        ", scnt);
 		} else {
@@ -428,8 +428,8 @@
 /*
  * Just like the old TTY implementation, we need to copy data in chunks
  * into a temporary buffer. One of the reasons why we need to do this,
- * is because output processing (only OXTABS though) may allow the
- * buffer to grow eight times.
+ * is because output processing (only TAB3 though) may allow the buffer
+ * to grow eight times.
  */
 int
 ttydisc_write(struct tty *tp, struct uio *uio, int ioflag)

==== //depot/projects/mpsafetty/sys/sys/termios.h#4 (text+ko) ====

@@ -108,7 +108,10 @@
 #define	OPOST		0x00000001	/* enable following output processing */
 #ifndef _POSIX_SOURCE
 #define ONLCR		0x00000002	/* map NL to CR-NL (ala CRMOD) */
-#define OXTABS		0x00000004	/* expand tabs to spaces */
+#define TAB3		0x00000004	/* expand tabs to spaces */
+#ifndef _KERNEL
+#define	OXTABS		TAB3
+#endif /* !_KERNEL */
 #define ONOEOT		0x00000008	/* discard EOT's (^D) on output) */
 #define OCRNL		0x00000010	/* map CR to NL on output */
 #define ONOCR		0x00000020	/* no CR output at column 0 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808121524.m7CFO10m034513>