delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/11/16:22:50

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Date: Sun, 11 Jun 2000 16:22:40 -0400
MIME-Version: 1.0
Subject: patch for _get_dev_info return bits
Message-ID: <3943BCD0.22771.2CF8D0@localhost>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

Hello,

Several of the termios implementation files define _DEV_* macros to parse the dev 
info word returned by _get_dev_info. This patch deletes all these macros and defines 
them in just one place in <io.h> where the prototype for _get_dev_info is located. I 
noticed the large number of duplicates while working on the enhanced fcntl.

Also, should the _DEV_* macros be documented and extended to cover all the bits?

Index: djgpp/include/io.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/io.h,v
retrieving revision 1.3
diff -c -3 -r1.3 io.h
*** io.h	1998/06/28 22:42:16	1.3
--- io.h	2000/06/11 17:20:59
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #ifndef __dj_include_io_h_
***************
*** 14,19 ****
--- 15,30 ----
  #ifndef _POSIX_SOURCE
  
  #include <sys/types.h>
+ 
+ /* For parsing the dev info word returned by _get_dev_info.  */
+ #define _DEV_STDIN	0x0001
+ #define _DEV_STDOUT	0x0002
+ #define _DEV_NUL	0x0004
+ #define _DEV_CLOCK	0x0008
+ #define _DEV_RAW	0x0020
+ #define _DEV_CDEV	0x0080
+ #define _DEV_NO_INHERIT	0x1000 /* Undocumented. */
+ #define _DEV_IOCTRL	0x4000
  
  int		chsize(int handle, long size);
  int		_close(int _fd);
Index: djgpp/src/libc/posix/termios/tcdrain.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcdrain.c,v
retrieving revision 1.2
diff -c -3 -r1.2 tcdrain.c
*** tcdrain.c	1996/09/15 17:02:22	1.2
--- tcdrain.c	2000/06/11 17:18:28
***************
*** 1,17 ****
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
  #include <io.h>
  #include <termios.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  int
  tcdrain (int handle)
--- 1,10 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
  #include <io.h>
  #include <termios.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
  
  int
  tcdrain (int handle)
Index: djgpp/src/libc/posix/termios/tcflow.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcflow.c,v
retrieving revision 1.2
diff -c -3 -r1.2 tcflow.c
*** tcflow.c	1996/09/15 17:02:22	1.2
--- tcflow.c	2000/06/11 17:18:40
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <libc/stubs.h>
  #include <errno.h>
***************
*** 6,19 ****
  #include <unistd.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  int
  tcflow (int handle, int action)
--- 7,12 ----
Index: djgpp/src/libc/posix/termios/tcflush.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcflush.c,v
retrieving revision 1.4
diff -c -3 -r1.4 tcflush.c
*** tcflush.c	1999/06/03 17:27:40	1.4
--- tcflush.c	2000/06/11 17:18:48
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
***************
*** 8,21 ****
  #include <libc/farptrgs.h>
  #include <dpmi.h>
  #include <go32.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  static int
  getkey_nowait (void)
--- 9,14 ----
Index: djgpp/src/libc/posix/termios/tcgetatr.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcgetatr.c,v
retrieving revision 1.2
diff -c -3 -r1.2 tcgetatr.c
*** tcgetatr.c	1996/09/15 17:02:22	1.2
--- tcgetatr.c	2000/06/11 17:18:56
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyrifht (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
  #include <io.h>
***************
*** 5,18 ****
  #include <termios.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  int
  tcgetattr (int handle, struct termios *termiosp)
--- 6,11 ----
Index: djgpp/src/libc/posix/termios/tcsetatr.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcsetatr.c,v
retrieving revision 1.4
diff -c -3 -r1.4 tcsetatr.c
*** tcsetatr.c	1999/06/03 17:27:40	1.4
--- tcsetatr.c	2000/06/11 17:19:02
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
***************
*** 7,20 ****
  #include <sys/exceptn.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  int
  tcsetattr (int handle, int action, const struct termios *termiosp)
--- 8,13 ----
Index: djgpp/src/libc/posix/termios/tcsndbrk.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tcsndbrk.c,v
retrieving revision 1.2
diff -c -3 -r1.2 tcsndbrk.c
*** tcsndbrk.c	1996/09/15 17:02:22	1.2
--- tcsndbrk.c	2000/06/11 17:19:10
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  #include <errno.h>
  #include <io.h>
***************
*** 5,18 ****
  #include <termios.h>
  #include <libc/bss.h>
  #include <libc/ttyprvt.h>
- 
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  int
  tcsendbreak (int handle, int duration)
--- 6,11 ----
Index: djgpp/src/libc/posix/termios/tminit.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/termios/tminit.c,v
retrieving revision 1.7
diff -c -3 -r1.7 tminit.c
*** tminit.c	1999/06/03 17:27:40	1.7
--- tminit.c	2000/06/11 17:19:31
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  /*
***************
*** 24,36 ****
  #include <libc/ttyprvt.h>
  #include <libc/farptrgs.h>
  
- #define _DEV_STDIN  0x0001
- #define _DEV_STDOUT 0x0002
- #define _DEV_NUL    0x0004
- #define _DEV_CLOCK  0x0008
- #define _DEV_RAW    0x0020
- #define _DEV_CDEV   0x0080
- #define _DEV_IOCTRL 0x4000
  
  #define CPMEOF 0x1a /* Ctrl+Z */
  
--- 25,30 ----


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019