annotate Modules/termios.c @ 27998:e27f58a50737 legacy-trunk

SF bug #690377: Dud footnote reference in distutils docs
author Raymond Hettinger <python@rcn.com>
date Fri, 21 Feb 2003 02:47:09 +0000
parents f66b3a3509c7
children 39b871678467
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /* termiosmodule.c -- POSIX terminal I/O module implementation. */
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
9887
ae908ef91cf0 Should include "Python.h", not <Python.h> -- it's not a standard
Guido van Rossum <guido@python.org>
parents: 9588
diff changeset
3 #include "Python.h"
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 #define PyInit_termios inittermios
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 #include <termios.h>
17732
e785d7bd7598 Only import termio.h on OSF, and add a comment about why it is needed there.
Fred Drake <fdrake@acm.org>
parents: 17697
diff changeset
8 #ifdef __osf__
e785d7bd7598 Only import termio.h on OSF, and add a comment about why it is needed there.
Fred Drake <fdrake@acm.org>
parents: 17697
diff changeset
9 /* On OSF, sys/ioctl.h requires that struct termio already be defined,
e785d7bd7598 Only import termio.h on OSF, and add a comment about why it is needed there.
Fred Drake <fdrake@acm.org>
parents: 17697
diff changeset
10 * so this needs to be included first on that platform. */
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
11 #include <termio.h>
17732
e785d7bd7598 Only import termio.h on OSF, and add a comment about why it is needed there.
Fred Drake <fdrake@acm.org>
parents: 17697
diff changeset
12 #endif
17313
b73547bf8bc2 Add an #include of sys/ioctl.h to pick up a lot of the constants supported
Fred Drake <fdrake@acm.org>
parents: 17226
diff changeset
13 #include <sys/ioctl.h>
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
14
17788
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
15 /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR,
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
16 * MDTR, MRI, and MRTS (appearantly used internally by some things
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
17 * defined as macros; these are not used here directly).
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
18 */
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
19 #ifdef HAVE_SYS_MODEM_H
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
20 #include <sys/modem.h>
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
21 #endif
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
22
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
23 PyDoc_STRVAR(termios__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
24 "This module provides an interface to the Posix calls for tty I/O control.\n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
25 For a complete description of these calls, see the Posix or Unix manual\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
26 pages. It is only available for those Unix versions that support Posix\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
27 termios style tty I/O control.\n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
28 \n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
29 All functions in this module take a file descriptor fd as their first\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
30 argument. This can be an integer file descriptor, such as returned by\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
31 sys.stdin.fileno(), or a file object, such as sys.stdin itself.");
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 static PyObject *TermiosError;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
35 static int fdconv(PyObject* obj, void* p)
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
36 {
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
37 int fd;
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
38
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
39 fd = PyObject_AsFileDescriptor(obj);
17742
1a21dd13e60a fdconv(): Do not second guess the error condition returned by
Fred Drake <fdrake@acm.org>
parents: 17732
diff changeset
40 if (fd >= 0) {
1a21dd13e60a fdconv(): Do not second guess the error condition returned by
Fred Drake <fdrake@acm.org>
parents: 17732
diff changeset
41 *(int*)p = fd;
1a21dd13e60a fdconv(): Do not second guess the error condition returned by
Fred Drake <fdrake@acm.org>
parents: 17732
diff changeset
42 return 1;
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
43 }
17742
1a21dd13e60a fdconv(): Do not second guess the error condition returned by
Fred Drake <fdrake@acm.org>
parents: 17732
diff changeset
44 return 0;
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
45 }
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
47 PyDoc_STRVAR(termios_tcgetattr__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
48 "tcgetattr(fd) -> list_of_attrs\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
49 \n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
50 Get the tty attributes for file descriptor fd, as follows:\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
51 [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
52 of the tty special characters (each a string of length 1, except the items\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
53 with indices VMIN and VTIME, which are integers when these fields are\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
54 defined). The interpretation of the flags and the speeds as well as the\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
55 indexing in the cc array must be done using the symbolic constants defined\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
56 in this module.");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
57
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
59 termios_tcgetattr(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 int fd;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 struct termios mode;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 PyObject *cc;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 speed_t ispeed, ospeed;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 PyObject *v;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 int i;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 char ch;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
68
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
69 if (!PyArg_ParseTuple(args, "O&:tcgetattr",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
70 fdconv, (void*)&fd))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
71 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
72
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
73 if (tcgetattr(fd, &mode) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
74 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
75
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 ispeed = cfgetispeed(&mode);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 ospeed = cfgetospeed(&mode);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
78
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
79 cc = PyList_New(NCCS);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
80 if (cc == NULL)
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
82 for (i = 0; i < NCCS; i++) {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
83 ch = (char)mode.c_cc[i];
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
84 v = PyString_FromStringAndSize(&ch, 1);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
85 if (v == NULL)
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
86 goto err;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 PyList_SetItem(cc, i, v);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
88 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
89
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
90 /* Convert the MIN and TIME slots to integer. On some systems, the
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
91 MIN and TIME slots are the same as the EOF and EOL slots. So we
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
92 only do this in noncanonical input mode. */
4653
3b7cd83b602d Fix operator priority bug found thanks to gcc -Wall.
Guido van Rossum <guido@python.org>
parents: 1888
diff changeset
93 if ((mode.c_lflag & ICANON) == 0) {
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
94 v = PyInt_FromLong((long)mode.c_cc[VMIN]);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
95 if (v == NULL)
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
96 goto err;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
97 PyList_SetItem(cc, VMIN, v);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
98 v = PyInt_FromLong((long)mode.c_cc[VTIME]);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
99 if (v == NULL)
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
100 goto err;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
101 PyList_SetItem(cc, VTIME, v);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
102 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
103
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
104 if (!(v = PyList_New(7)))
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
105 goto err;
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
106
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
107 PyList_SetItem(v, 0, PyInt_FromLong((long)mode.c_iflag));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
108 PyList_SetItem(v, 1, PyInt_FromLong((long)mode.c_oflag));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
109 PyList_SetItem(v, 2, PyInt_FromLong((long)mode.c_cflag));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
110 PyList_SetItem(v, 3, PyInt_FromLong((long)mode.c_lflag));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
111 PyList_SetItem(v, 4, PyInt_FromLong((long)ispeed));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
112 PyList_SetItem(v, 5, PyInt_FromLong((long)ospeed));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
113 PyList_SetItem(v, 6, cc);
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
114 if (PyErr_Occurred()){
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
115 Py_DECREF(v);
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
116 goto err;
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
117 }
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
118 return v;
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
119 err:
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
120 Py_DECREF(cc);
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
121 return NULL;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
122 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
123
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
124 PyDoc_STRVAR(termios_tcsetattr__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
125 "tcsetattr(fd, when, attributes) -> None\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
126 \n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
127 Set the tty attributes for file descriptor fd.\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
128 The attributes to be set are taken from the attributes argument, which\n\
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
129 is a list like the one returned by tcgetattr(). The when argument\n\
17357
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
130 determines when the attributes are changed: termios.TCSANOW to\n\
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
131 change immediately, termios.TCSADRAIN to change after transmitting all\n\
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
132 queued output, or termios.TCSAFLUSH to change after transmitting all\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
133 queued output and discarding all queued input. ");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
134
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
135 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
136 termios_tcsetattr(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
138 int fd, when;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
139 struct termios mode;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
140 speed_t ispeed, ospeed;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
141 PyObject *term, *cc, *v;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
142 int i;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
143
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
144 if (!PyArg_ParseTuple(args, "O&iO:tcsetattr",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
145 fdconv, &fd, &when, &term))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
146 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
147 if (!PyList_Check(term) || PyList_Size(term) != 7) {
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
148 PyErr_SetString(PyExc_TypeError,
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
149 "tcsetattr, arg 3: must be 7 element list");
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
150 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
151 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
152
8494
fc29625df532 In tcsetattr(), first initialize the mode structure by calling
Guido van Rossum <guido@python.org>
parents: 7531
diff changeset
153 /* Get the old mode, in case there are any hidden fields... */
fc29625df532 In tcsetattr(), first initialize the mode structure by calling
Guido van Rossum <guido@python.org>
parents: 7531
diff changeset
154 if (tcgetattr(fd, &mode) == -1)
fc29625df532 In tcsetattr(), first initialize the mode structure by calling
Guido van Rossum <guido@python.org>
parents: 7531
diff changeset
155 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 mode.c_iflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 0));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
157 mode.c_oflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 1));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 mode.c_cflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 2));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
159 mode.c_lflag = (tcflag_t) PyInt_AsLong(PyList_GetItem(term, 3));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
160 ispeed = (speed_t) PyInt_AsLong(PyList_GetItem(term, 4));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
161 ospeed = (speed_t) PyInt_AsLong(PyList_GetItem(term, 5));
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 cc = PyList_GetItem(term, 6);
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
163 if (PyErr_Occurred())
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
164 return NULL;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
165
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
166 if (!PyList_Check(cc) || PyList_Size(cc) != NCCS) {
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
167 PyErr_Format(PyExc_TypeError,
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
168 "tcsetattr: attributes[6] must be %d element list",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
169 NCCS);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
170 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
171 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
172
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
173 for (i = 0; i < NCCS; i++) {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 v = PyList_GetItem(cc, i);
4928
9be65e6c35c8 The usual return-value and memory management checks. I'm not planning
Barry Warsaw <barry@python.org>
parents: 4653
diff changeset
175
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
176 if (PyString_Check(v) && PyString_Size(v) == 1)
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
177 mode.c_cc[i] = (cc_t) * PyString_AsString(v);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
178 else if (PyInt_Check(v))
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
179 mode.c_cc[i] = (cc_t) PyInt_AsLong(v);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
180 else {
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
181 PyErr_SetString(PyExc_TypeError,
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
182 "tcsetattr: elements of attributes must be characters or integers");
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
183 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
184 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
185 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
186
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
187 if (cfsetispeed(&mode, (speed_t) ispeed) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
188 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
189 if (cfsetospeed(&mode, (speed_t) ospeed) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
190 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
191 if (tcsetattr(fd, when, &mode) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
192 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
193
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
194 Py_INCREF(Py_None);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
195 return Py_None;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
196 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
197
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
198 PyDoc_STRVAR(termios_tcsendbreak__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
199 "tcsendbreak(fd, duration) -> None\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
200 \n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
201 Send a break on file descriptor fd.\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
202 A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
203 has a system dependent meaning.");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
204
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
205 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
206 termios_tcsendbreak(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
207 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
208 int fd, duration;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
209
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
210 if (!PyArg_ParseTuple(args, "O&i:tcsendbreak",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
211 fdconv, &fd, &duration))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
212 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
213 if (tcsendbreak(fd, duration) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
214 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
215
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
216 Py_INCREF(Py_None);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
217 return Py_None;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
218 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
219
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
220 PyDoc_STRVAR(termios_tcdrain__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
221 "tcdrain(fd) -> None\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
222 \n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
223 Wait until all output written to file descriptor fd has been transmitted.");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
224
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
225 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
226 termios_tcdrain(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
227 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
228 int fd;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
229
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
230 if (!PyArg_ParseTuple(args, "O&:tcdrain",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
231 fdconv, &fd))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
232 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
233 if (tcdrain(fd) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
234 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
235
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
236 Py_INCREF(Py_None);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
237 return Py_None;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
238 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
239
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
240 PyDoc_STRVAR(termios_tcflush__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
241 "tcflush(fd, queue) -> None\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
242 \n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
243 Discard queued data on file descriptor fd.\n\
17357
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
244 The queue selector specifies which queue: termios.TCIFLUSH for the input\n\
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
245 queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
246 both queues. ");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
247
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
248 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
249 termios_tcflush(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
250 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
251 int fd, queue;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
252
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
253 if (!PyArg_ParseTuple(args, "O&i:tcflush",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
254 fdconv, &fd, &queue))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
255 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
256 if (tcflush(fd, queue) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
257 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
258
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
259 Py_INCREF(Py_None);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
260 return Py_None;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
261 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
262
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
263 PyDoc_STRVAR(termios_tcflow__doc__,
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
264 "tcflow(fd, action) -> None\n\
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
265 \n\
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
266 Suspend or resume input or output on file descriptor fd.\n\
17357
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
267 The action argument can be termios.TCOOFF to suspend output,\n\
cc8a21ba6449 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17319
diff changeset
268 termios.TCOON to restart output, termios.TCIOFF to suspend input,\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 22114
diff changeset
269 or termios.TCION to restart input.");
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
270
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
271 static PyObject *
13501
ca32ff7a067e ANSI-fication
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 9887
diff changeset
272 termios_tcflow(PyObject *self, PyObject *args)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
273 {
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
274 int fd, action;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
275
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
276 if (!PyArg_ParseTuple(args, "O&i:tcflow",
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
277 fdconv, &fd, &action))
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
278 return NULL;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
279 if (tcflow(fd, action) == -1)
5827
a79d0cef10a1 Add 'return' keyword before error calls.
Guido van Rossum <guido@python.org>
parents: 4928
diff changeset
280 return PyErr_SetFromErrno(TermiosError);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
281
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
282 Py_INCREF(Py_None);
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
283 return Py_None;
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
284 }
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
285
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
286 static PyMethodDef termios_methods[] =
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
287 {
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
288 {"tcgetattr", termios_tcgetattr,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
289 METH_VARARGS, termios_tcgetattr__doc__},
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
290 {"tcsetattr", termios_tcsetattr,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
291 METH_VARARGS, termios_tcsetattr__doc__},
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
292 {"tcsendbreak", termios_tcsendbreak,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
293 METH_VARARGS, termios_tcsendbreak__doc__},
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
294 {"tcdrain", termios_tcdrain,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
295 METH_VARARGS, termios_tcdrain__doc__},
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
296 {"tcflush", termios_tcflush,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
297 METH_VARARGS, termios_tcflush__doc__},
13820
8bd82cf361aa Use METH_OLDARGS instead of numeric constant 0 in method def. tables
Andrew M. Kuchling <amk@amk.ca>
parents: 13651
diff changeset
298 {"tcflow", termios_tcflow,
17697
f970195196c4 Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 17419
diff changeset
299 METH_VARARGS, termios_tcflow__doc__},
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
300 {NULL, NULL}
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
301 };
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
302
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
303
16913
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
304 #if defined(VSWTCH) && !defined(VSWTC)
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
305 #define VSWTC VSWTCH
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
306 #endif
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
307
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
308 #if defined(VSWTC) && !defined(VSWTCH)
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
309 #define VSWTCH VSWTC
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
310 #endif
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
311
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
312 static struct constant {
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
313 char *name;
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
314 long value;
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
315 } termios_constants[] = {
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
316 /* cfgetospeed(), cfsetospeed() constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
317 {"B0", B0},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
318 {"B50", B50},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
319 {"B75", B75},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
320 {"B110", B110},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
321 {"B134", B134},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
322 {"B150", B150},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
323 {"B200", B200},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
324 {"B300", B300},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
325 {"B600", B600},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
326 {"B1200", B1200},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
327 {"B1800", B1800},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
328 {"B2400", B2400},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
329 {"B4800", B4800},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
330 {"B9600", B9600},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
331 {"B19200", B19200},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
332 {"B38400", B38400},
17419
3fadc37cfa92 Unixware 7 support by Billy G. Allie (SF patch 413011)
Guido van Rossum <guido@python.org>
parents: 17357
diff changeset
333 #ifdef B57600
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
334 {"B57600", B57600},
17419
3fadc37cfa92 Unixware 7 support by Billy G. Allie (SF patch 413011)
Guido van Rossum <guido@python.org>
parents: 17357
diff changeset
335 #endif
3fadc37cfa92 Unixware 7 support by Billy G. Allie (SF patch 413011)
Guido van Rossum <guido@python.org>
parents: 17357
diff changeset
336 #ifdef B115200
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
337 {"B115200", B115200},
17419
3fadc37cfa92 Unixware 7 support by Billy G. Allie (SF patch 413011)
Guido van Rossum <guido@python.org>
parents: 17357
diff changeset
338 #endif
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
339 #ifdef B230400
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
340 {"B230400", B230400},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
341 #endif
16913
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
342 #ifdef CBAUDEX
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
343 {"CBAUDEX", CBAUDEX},
16913
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
344 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
345
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
346 /* tcsetattr() constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
347 {"TCSANOW", TCSANOW},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
348 {"TCSADRAIN", TCSADRAIN},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
349 {"TCSAFLUSH", TCSAFLUSH},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
350
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
351 /* tcflush() constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
352 {"TCIFLUSH", TCIFLUSH},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
353 {"TCOFLUSH", TCOFLUSH},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
354 {"TCIOFLUSH", TCIOFLUSH},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
355
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
356 /* tcflow() constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
357 {"TCOOFF", TCOOFF},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
358 {"TCOON", TCOON},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
359 {"TCIOFF", TCIOFF},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
360 {"TCION", TCION},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
361
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
362 /* struct termios.c_iflag constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
363 {"IGNBRK", IGNBRK},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
364 {"BRKINT", BRKINT},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
365 {"IGNPAR", IGNPAR},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
366 {"PARMRK", PARMRK},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
367 {"INPCK", INPCK},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
368 {"ISTRIP", ISTRIP},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
369 {"INLCR", INLCR},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
370 {"IGNCR", IGNCR},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
371 {"ICRNL", ICRNL},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
372 #ifdef IUCLC
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
373 {"IUCLC", IUCLC},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
374 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
375 {"IXON", IXON},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
376 {"IXANY", IXANY},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
377 {"IXOFF", IXOFF},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
378 #ifdef IMAXBEL
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
379 {"IMAXBEL", IMAXBEL},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
380 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
381
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
382 /* struct termios.c_oflag constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
383 {"OPOST", OPOST},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
384 #ifdef OLCUC
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
385 {"OLCUC", OLCUC},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
386 #endif
22114
c454b76d51e7 OS/2 EMX port changes (Modules part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21944
diff changeset
387 #ifdef ONLCR
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
388 {"ONLCR", ONLCR},
22114
c454b76d51e7 OS/2 EMX port changes (Modules part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21944
diff changeset
389 #endif
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
390 #ifdef OCRNL
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
391 {"OCRNL", OCRNL},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
392 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
393 #ifdef ONOCR
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
394 {"ONOCR", ONOCR},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
395 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
396 #ifdef ONLRET
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
397 {"ONLRET", ONLRET},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
398 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
399 #ifdef OFILL
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
400 {"OFILL", OFILL},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
401 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
402 #ifdef OFDEL
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
403 {"OFDEL", OFDEL},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
404 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
405 #ifdef NLDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
406 {"NLDLY", NLDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
407 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
408 #ifdef CRDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
409 {"CRDLY", CRDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
410 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
411 #ifdef TABDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
412 {"TABDLY", TABDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
413 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
414 #ifdef BSDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
415 {"BSDLY", BSDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
416 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
417 #ifdef VTDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
418 {"VTDLY", VTDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
419 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
420 #ifdef FFDLY
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
421 {"FFDLY", FFDLY},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
422 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
423
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
424 /* struct termios.c_oflag-related values (delay mask) */
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
425 #ifdef NL0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
426 {"NL0", NL0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
427 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
428 #ifdef NL1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
429 {"NL1", NL1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
430 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
431 #ifdef CR0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
432 {"CR0", CR0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
433 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
434 #ifdef CR1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
435 {"CR1", CR1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
436 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
437 #ifdef CR2
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
438 {"CR2", CR2},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
439 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
440 #ifdef CR3
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
441 {"CR3", CR3},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
442 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
443 #ifdef TAB0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
444 {"TAB0", TAB0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
445 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
446 #ifdef TAB1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
447 {"TAB1", TAB1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
448 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
449 #ifdef TAB2
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
450 {"TAB2", TAB2},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
451 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
452 #ifdef TAB3
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
453 {"TAB3", TAB3},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
454 #endif
16952
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
455 #ifdef XTABS
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
456 {"XTABS", XTABS},
16952
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
457 #endif
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
458 #ifdef BS0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
459 {"BS0", BS0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
460 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
461 #ifdef BS1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
462 {"BS1", BS1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
463 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
464 #ifdef VT0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
465 {"VT0", VT0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
466 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
467 #ifdef VT1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
468 {"VT1", VT1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
469 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
470 #ifdef FF0
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
471 {"FF0", FF0},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
472 #endif
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
473 #ifdef FF1
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
474 {"FF1", FF1},
16975
a79ebba6466a Wrap several more of the constants in #ifdef/#endif for FreeBSD; at least
Fred Drake <fdrake@acm.org>
parents: 16952
diff changeset
475 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
476
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
477 /* struct termios.c_cflag constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
478 {"CSIZE", CSIZE},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
479 {"CSTOPB", CSTOPB},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
480 {"CREAD", CREAD},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
481 {"PARENB", PARENB},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
482 {"PARODD", PARODD},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
483 {"HUPCL", HUPCL},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
484 {"CLOCAL", CLOCAL},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
485 #ifdef CIBAUD
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
486 {"CIBAUD", CIBAUD},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
487 #endif
16952
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
488 #ifdef CRTSCTS
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
489 {"CRTSCTS", (long)CRTSCTS},
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
490 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
491
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
492 /* struct termios.c_cflag-related values (character size) */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
493 {"CS5", CS5},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
494 {"CS6", CS6},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
495 {"CS7", CS7},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
496 {"CS8", CS8},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
497
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
498 /* struct termios.c_lflag constants */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
499 {"ISIG", ISIG},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
500 {"ICANON", ICANON},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
501 #ifdef XCASE
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
502 {"XCASE", XCASE},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
503 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
504 {"ECHO", ECHO},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
505 {"ECHOE", ECHOE},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
506 {"ECHOK", ECHOK},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
507 {"ECHONL", ECHONL},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
508 #ifdef ECHOCTL
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
509 {"ECHOCTL", ECHOCTL},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
510 #endif
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
511 #ifdef ECHOPRT
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
512 {"ECHOPRT", ECHOPRT},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
513 #endif
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
514 #ifdef ECHOKE
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
515 {"ECHOKE", ECHOKE},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
516 #endif
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
517 #ifdef FLUSHO
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
518 {"FLUSHO", FLUSHO},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
519 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
520 {"NOFLSH", NOFLSH},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
521 {"TOSTOP", TOSTOP},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
522 #ifdef PENDIN
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
523 {"PENDIN", PENDIN},
16886
68ce32861626 Revised version of Jason Tishler's patch to make this compile on Cygwin,
Fred Drake <fdrake@acm.org>
parents: 16806
diff changeset
524 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
525 {"IEXTEN", IEXTEN},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
526
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
527 /* indexes into the control chars array returned by tcgetattr() */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
528 {"VINTR", VINTR},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
529 {"VQUIT", VQUIT},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
530 {"VERASE", VERASE},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
531 {"VKILL", VKILL},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
532 {"VEOF", VEOF},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
533 {"VTIME", VTIME},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
534 {"VMIN", VMIN},
16952
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
535 #ifdef VSWTC
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
536 /* The #defines above ensure that if either is defined, both are,
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
537 * but both may be omitted by the system headers. ;-( */
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
538 {"VSWTC", VSWTC},
16913
f07fa7f5262a Solaris defines VSWTCH instead of VSWTC; carefully make sure both are
Fred Drake <fdrake@acm.org>
parents: 16886
diff changeset
539 {"VSWTCH", VSWTCH},
16952
832e40909ef4 Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
Fred Drake <fdrake@acm.org>
parents: 16913
diff changeset
540 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
541 {"VSTART", VSTART},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
542 {"VSTOP", VSTOP},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
543 {"VSUSP", VSUSP},
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
544 {"VEOL", VEOL},
17905
0a7af0e538d4 Correct the sense of a couple of conditional compilations -- used #ifndef
Fred Drake <fdrake@acm.org>
parents: 17788
diff changeset
545 #ifdef VREPRINT
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
546 {"VREPRINT", VREPRINT},
17788
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
547 #endif
17905
0a7af0e538d4 Correct the sense of a couple of conditional compilations -- used #ifndef
Fred Drake <fdrake@acm.org>
parents: 17788
diff changeset
548 #ifdef VDISCARD
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
549 {"VDISCARD", VDISCARD},
17788
479ea69ec85b Include sys/modem.h if we have it; this is needed on HP-UX to provide
Fred Drake <fdrake@acm.org>
parents: 17742
diff changeset
550 #endif
18076
90193750cc83 Protect the use of the VWERASE symbol by an #ifdef, it's apparently missing
Thomas Wouters <thomas@python.org>
parents: 17905
diff changeset
551 #ifdef VWERASE
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
552 {"VWERASE", VWERASE},
18076
90193750cc83 Protect the use of the VWERASE symbol by an #ifdef, it's apparently missing
Thomas Wouters <thomas@python.org>
parents: 17905
diff changeset
553 #endif
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
554 #ifdef VLNEXT
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
555 {"VLNEXT", VLNEXT},
18124
1f1364806599 Forward-port revision 2.24.2.4 from the release21-maint branch:
Thomas Wouters <thomas@python.org>
parents: 18076
diff changeset
556 #endif
22114
c454b76d51e7 OS/2 EMX port changes (Modules part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21944
diff changeset
557 #ifdef VEOL2
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
558 {"VEOL2", VEOL2},
22114
c454b76d51e7 OS/2 EMX port changes (Modules part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21944
diff changeset
559 #endif
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
560
17226
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
561
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
562 #ifdef B460800
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
563 {"B460800", B460800},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
564 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
565 #ifdef CBAUD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
566 {"CBAUD", CBAUD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
567 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
568 #ifdef CDEL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
569 {"CDEL", CDEL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
570 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
571 #ifdef CDSUSP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
572 {"CDSUSP", CDSUSP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
573 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
574 #ifdef CEOF
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
575 {"CEOF", CEOF},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
576 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
577 #ifdef CEOL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
578 {"CEOL", CEOL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
579 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
580 #ifdef CEOL2
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
581 {"CEOL2", CEOL2},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
582 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
583 #ifdef CEOT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
584 {"CEOT", CEOT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
585 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
586 #ifdef CERASE
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
587 {"CERASE", CERASE},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
588 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
589 #ifdef CESC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
590 {"CESC", CESC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
591 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
592 #ifdef CFLUSH
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
593 {"CFLUSH", CFLUSH},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
594 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
595 #ifdef CINTR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
596 {"CINTR", CINTR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
597 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
598 #ifdef CKILL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
599 {"CKILL", CKILL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
600 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
601 #ifdef CLNEXT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
602 {"CLNEXT", CLNEXT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
603 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
604 #ifdef CNUL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
605 {"CNUL", CNUL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
606 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
607 #ifdef COMMON
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
608 {"COMMON", COMMON},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
609 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
610 #ifdef CQUIT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
611 {"CQUIT", CQUIT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
612 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
613 #ifdef CRPRNT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
614 {"CRPRNT", CRPRNT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
615 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
616 #ifdef CSTART
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
617 {"CSTART", CSTART},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
618 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
619 #ifdef CSTOP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
620 {"CSTOP", CSTOP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
621 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
622 #ifdef CSUSP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
623 {"CSUSP", CSUSP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
624 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
625 #ifdef CSWTCH
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
626 {"CSWTCH", CSWTCH},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
627 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
628 #ifdef CWERASE
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
629 {"CWERASE", CWERASE},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
630 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
631 #ifdef EXTA
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
632 {"EXTA", EXTA},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
633 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
634 #ifdef EXTB
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
635 {"EXTB", EXTB},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
636 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
637 #ifdef FIOASYNC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
638 {"FIOASYNC", FIOASYNC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
639 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
640 #ifdef FIOCLEX
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
641 {"FIOCLEX", FIOCLEX},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
642 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
643 #ifdef FIONBIO
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
644 {"FIONBIO", FIONBIO},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
645 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
646 #ifdef FIONCLEX
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
647 {"FIONCLEX", FIONCLEX},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
648 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
649 #ifdef FIONREAD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
650 {"FIONREAD", FIONREAD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
651 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
652 #ifdef IBSHIFT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
653 {"IBSHIFT", IBSHIFT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
654 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
655 #ifdef INIT_C_CC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
656 {"INIT_C_CC", INIT_C_CC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
657 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
658 #ifdef IOCSIZE_MASK
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
659 {"IOCSIZE_MASK", IOCSIZE_MASK},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
660 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
661 #ifdef IOCSIZE_SHIFT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
662 {"IOCSIZE_SHIFT", IOCSIZE_SHIFT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
663 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
664 #ifdef NCC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
665 {"NCC", NCC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
666 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
667 #ifdef NCCS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
668 {"NCCS", NCCS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
669 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
670 #ifdef NSWTCH
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
671 {"NSWTCH", NSWTCH},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
672 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
673 #ifdef N_MOUSE
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
674 {"N_MOUSE", N_MOUSE},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
675 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
676 #ifdef N_PPP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
677 {"N_PPP", N_PPP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
678 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
679 #ifdef N_SLIP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
680 {"N_SLIP", N_SLIP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
681 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
682 #ifdef N_STRIP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
683 {"N_STRIP", N_STRIP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
684 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
685 #ifdef N_TTY
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
686 {"N_TTY", N_TTY},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
687 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
688 #ifdef TCFLSH
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
689 {"TCFLSH", TCFLSH},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
690 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
691 #ifdef TCGETA
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
692 {"TCGETA", TCGETA},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
693 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
694 #ifdef TCGETS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
695 {"TCGETS", TCGETS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
696 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
697 #ifdef TCSBRK
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
698 {"TCSBRK", TCSBRK},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
699 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
700 #ifdef TCSBRKP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
701 {"TCSBRKP", TCSBRKP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
702 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
703 #ifdef TCSETA
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
704 {"TCSETA", TCSETA},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
705 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
706 #ifdef TCSETAF
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
707 {"TCSETAF", TCSETAF},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
708 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
709 #ifdef TCSETAW
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
710 {"TCSETAW", TCSETAW},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
711 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
712 #ifdef TCSETS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
713 {"TCSETS", TCSETS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
714 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
715 #ifdef TCSETSF
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
716 {"TCSETSF", TCSETSF},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
717 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
718 #ifdef TCSETSW
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
719 {"TCSETSW", TCSETSW},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
720 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
721 #ifdef TCXONC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
722 {"TCXONC", TCXONC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
723 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
724 #ifdef TIOCCONS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
725 {"TIOCCONS", TIOCCONS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
726 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
727 #ifdef TIOCEXCL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
728 {"TIOCEXCL", TIOCEXCL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
729 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
730 #ifdef TIOCGETD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
731 {"TIOCGETD", TIOCGETD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
732 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
733 #ifdef TIOCGICOUNT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
734 {"TIOCGICOUNT", TIOCGICOUNT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
735 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
736 #ifdef TIOCGLCKTRMIOS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
737 {"TIOCGLCKTRMIOS", TIOCGLCKTRMIOS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
738 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
739 #ifdef TIOCGPGRP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
740 {"TIOCGPGRP", TIOCGPGRP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
741 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
742 #ifdef TIOCGSERIAL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
743 {"TIOCGSERIAL", TIOCGSERIAL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
744 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
745 #ifdef TIOCGSOFTCAR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
746 {"TIOCGSOFTCAR", TIOCGSOFTCAR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
747 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
748 #ifdef TIOCGWINSZ
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
749 {"TIOCGWINSZ", TIOCGWINSZ},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
750 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
751 #ifdef TIOCINQ
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
752 {"TIOCINQ", TIOCINQ},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
753 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
754 #ifdef TIOCLINUX
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
755 {"TIOCLINUX", TIOCLINUX},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
756 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
757 #ifdef TIOCMBIC
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
758 {"TIOCMBIC", TIOCMBIC},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
759 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
760 #ifdef TIOCMBIS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
761 {"TIOCMBIS", TIOCMBIS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
762 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
763 #ifdef TIOCMGET
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
764 {"TIOCMGET", TIOCMGET},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
765 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
766 #ifdef TIOCMIWAIT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
767 {"TIOCMIWAIT", TIOCMIWAIT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
768 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
769 #ifdef TIOCMSET
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
770 {"TIOCMSET", TIOCMSET},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
771 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
772 #ifdef TIOCM_CAR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
773 {"TIOCM_CAR", TIOCM_CAR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
774 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
775 #ifdef TIOCM_CD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
776 {"TIOCM_CD", TIOCM_CD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
777 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
778 #ifdef TIOCM_CTS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
779 {"TIOCM_CTS", TIOCM_CTS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
780 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
781 #ifdef TIOCM_DSR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
782 {"TIOCM_DSR", TIOCM_DSR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
783 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
784 #ifdef TIOCM_DTR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
785 {"TIOCM_DTR", TIOCM_DTR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
786 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
787 #ifdef TIOCM_LE
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
788 {"TIOCM_LE", TIOCM_LE},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
789 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
790 #ifdef TIOCM_RI
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
791 {"TIOCM_RI", TIOCM_RI},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
792 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
793 #ifdef TIOCM_RNG
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
794 {"TIOCM_RNG", TIOCM_RNG},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
795 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
796 #ifdef TIOCM_RTS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
797 {"TIOCM_RTS", TIOCM_RTS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
798 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
799 #ifdef TIOCM_SR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
800 {"TIOCM_SR", TIOCM_SR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
801 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
802 #ifdef TIOCM_ST
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
803 {"TIOCM_ST", TIOCM_ST},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
804 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
805 #ifdef TIOCNOTTY
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
806 {"TIOCNOTTY", TIOCNOTTY},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
807 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
808 #ifdef TIOCNXCL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
809 {"TIOCNXCL", TIOCNXCL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
810 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
811 #ifdef TIOCOUTQ
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
812 {"TIOCOUTQ", TIOCOUTQ},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
813 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
814 #ifdef TIOCPKT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
815 {"TIOCPKT", TIOCPKT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
816 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
817 #ifdef TIOCPKT_DATA
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
818 {"TIOCPKT_DATA", TIOCPKT_DATA},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
819 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
820 #ifdef TIOCPKT_DOSTOP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
821 {"TIOCPKT_DOSTOP", TIOCPKT_DOSTOP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
822 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
823 #ifdef TIOCPKT_FLUSHREAD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
824 {"TIOCPKT_FLUSHREAD", TIOCPKT_FLUSHREAD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
825 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
826 #ifdef TIOCPKT_FLUSHWRITE
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
827 {"TIOCPKT_FLUSHWRITE", TIOCPKT_FLUSHWRITE},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
828 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
829 #ifdef TIOCPKT_NOSTOP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
830 {"TIOCPKT_NOSTOP", TIOCPKT_NOSTOP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
831 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
832 #ifdef TIOCPKT_START
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
833 {"TIOCPKT_START", TIOCPKT_START},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
834 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
835 #ifdef TIOCPKT_STOP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
836 {"TIOCPKT_STOP", TIOCPKT_STOP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
837 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
838 #ifdef TIOCSCTTY
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
839 {"TIOCSCTTY", TIOCSCTTY},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
840 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
841 #ifdef TIOCSERCONFIG
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
842 {"TIOCSERCONFIG", TIOCSERCONFIG},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
843 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
844 #ifdef TIOCSERGETLSR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
845 {"TIOCSERGETLSR", TIOCSERGETLSR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
846 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
847 #ifdef TIOCSERGETMULTI
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
848 {"TIOCSERGETMULTI", TIOCSERGETMULTI},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
849 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
850 #ifdef TIOCSERGSTRUCT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
851 {"TIOCSERGSTRUCT", TIOCSERGSTRUCT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
852 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
853 #ifdef TIOCSERGWILD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
854 {"TIOCSERGWILD", TIOCSERGWILD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
855 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
856 #ifdef TIOCSERSETMULTI
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
857 {"TIOCSERSETMULTI", TIOCSERSETMULTI},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
858 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
859 #ifdef TIOCSERSWILD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
860 {"TIOCSERSWILD", TIOCSERSWILD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
861 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
862 #ifdef TIOCSER_TEMT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
863 {"TIOCSER_TEMT", TIOCSER_TEMT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
864 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
865 #ifdef TIOCSETD
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
866 {"TIOCSETD", TIOCSETD},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
867 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
868 #ifdef TIOCSLCKTRMIOS
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
869 {"TIOCSLCKTRMIOS", TIOCSLCKTRMIOS},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
870 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
871 #ifdef TIOCSPGRP
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
872 {"TIOCSPGRP", TIOCSPGRP},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
873 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
874 #ifdef TIOCSSERIAL
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
875 {"TIOCSSERIAL", TIOCSSERIAL},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
876 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
877 #ifdef TIOCSSOFTCAR
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
878 {"TIOCSSOFTCAR", TIOCSSOFTCAR},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
879 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
880 #ifdef TIOCSTI
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
881 {"TIOCSTI", TIOCSTI},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
882 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
883 #ifdef TIOCSWINSZ
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
884 {"TIOCSWINSZ", TIOCSWINSZ},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
885 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
886 #ifdef TIOCTTYGSTRUCT
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
887 {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT},
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
888 #endif
02a4b0cfc57e Michael Hudson <mwh21@cam.ac.uk>:
Fred Drake <fdrake@acm.org>
parents: 16975
diff changeset
889
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
890 /* sentinel */
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
891 {NULL, 0}
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
892 };
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
893
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
894
24471
f66b3a3509c7 Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents: 23832
diff changeset
895 PyMODINIT_FUNC
13651
8a063423e0b7 Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
Thomas Wouters <thomas@python.org>
parents: 13501
diff changeset
896 PyInit_termios(void)
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
897 {
21944
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
898 PyObject *m;
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
899 struct constant *constant = termios_constants;
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
900
7531
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
901 m = Py_InitModule4("termios", termios_methods, termios__doc__,
b4660ad7dc41 Doc strings added by Mitch Chapman.
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
902 (PyObject *)NULL, PYTHON_API_VERSION);
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
903
21944
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
904 if (TermiosError == NULL) {
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
905 TermiosError = PyErr_NewException("termios.error", NULL, NULL);
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
906 }
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
907 Py_INCREF(TermiosError);
f39213405e05 Use PyModule_AddObject() instead of accessing the module dict directly.
Fred Drake <fdrake@acm.org>
parents: 21712
diff changeset
908 PyModule_AddObject(m, "error", TermiosError);
16806
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
909
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
910 while (constant->name != NULL) {
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
911 PyModule_AddIntConstant(m, constant->name, constant->value);
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
912 ++constant;
b2585d8fdb8b Define the constants needed for working with these functions directly
Fred Drake <fdrake@acm.org>
parents: 13820
diff changeset
913 }
1879
91bfb2771554 Steen Lumholt's termios interface.
Guido van Rossum <guido@python.org>
parents:
diff changeset
914 }