Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 1 | /* termiosmodule.c -- POSIX terminal I/O module implementation. */ |
| 2 | |
Guido van Rossum | ca6954a | 1999-01-14 19:31:42 +0000 | [diff] [blame] | 3 | #include "Python.h" |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 4 | |
Martin v. Löwis | be4fea6 | 2003-10-31 13:01:24 +0000 | [diff] [blame] | 5 | /* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE |
| 6 | is defined, so we define it here. */ |
| 7 | #if defined(__sgi) |
| 8 | #define CTRL(c) ((c)&037) |
| 9 | #endif |
| 10 | |
jcea | f0a95f2 | 2018-01-28 14:00:48 +0100 | [diff] [blame] | 11 | #if defined(__sun) |
| 12 | /* We could do better. Check issue-32660 */ |
| 13 | #include <sys/filio.h> |
| 14 | #include <sys/sockio.h> |
| 15 | #endif |
| 16 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 17 | #include <termios.h> |
Fred Drake | 9b3bc49 | 2001-04-04 21:19:26 +0000 | [diff] [blame] | 18 | #include <sys/ioctl.h> |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 19 | |
Fred Drake | 87068f1 | 2001-05-11 16:14:17 +0000 | [diff] [blame] | 20 | /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, |
| 21 | * MDTR, MRI, and MRTS (appearantly used internally by some things |
| 22 | * defined as macros; these are not used here directly). |
| 23 | */ |
| 24 | #ifdef HAVE_SYS_MODEM_H |
| 25 | #include <sys/modem.h> |
| 26 | #endif |
Neal Norwitz | 8225103 | 2003-05-23 14:35:24 +0000 | [diff] [blame] | 27 | /* HP-UX requires that this be included to pick up TIOCGPGRP and friends */ |
| 28 | #ifdef HAVE_SYS_BSDTTY_H |
| 29 | #include <sys/bsdtty.h> |
| 30 | #endif |
Fred Drake | 87068f1 | 2001-05-11 16:14:17 +0000 | [diff] [blame] | 31 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 32 | PyDoc_STRVAR(termios__doc__, |
| 33 | "This module provides an interface to the Posix calls for tty I/O control.\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 34 | For a complete description of these calls, see the Posix or Unix manual\n\ |
| 35 | pages. It is only available for those Unix versions that support Posix\n\ |
| 36 | termios style tty I/O control.\n\ |
| 37 | \n\ |
| 38 | All functions in this module take a file descriptor fd as their first\n\ |
| 39 | argument. This can be an integer file descriptor, such as returned by\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 40 | sys.stdin.fileno(), or a file object, such as sys.stdin itself."); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 41 | |
| 42 | static PyObject *TermiosError; |
| 43 | |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 44 | static int fdconv(PyObject* obj, void* p) |
| 45 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 46 | int fd; |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 47 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 48 | fd = PyObject_AsFileDescriptor(obj); |
| 49 | if (fd >= 0) { |
| 50 | *(int*)p = fd; |
| 51 | return 1; |
| 52 | } |
| 53 | return 0; |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 54 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 55 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 56 | PyDoc_STRVAR(termios_tcgetattr__doc__, |
| 57 | "tcgetattr(fd) -> list_of_attrs\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 58 | \n\ |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 59 | Get the tty attributes for file descriptor fd, as follows:\n\ |
| 60 | [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list\n\ |
| 61 | of the tty special characters (each a string of length 1, except the items\n\ |
| 62 | with indices VMIN and VTIME, which are integers when these fields are\n\ |
| 63 | defined). The interpretation of the flags and the speeds as well as the\n\ |
| 64 | indexing in the cc array must be done using the symbolic constants defined\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 65 | in this module."); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 66 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 67 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 68 | termios_tcgetattr(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 69 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 70 | int fd; |
| 71 | struct termios mode; |
| 72 | PyObject *cc; |
| 73 | speed_t ispeed, ospeed; |
| 74 | PyObject *v; |
| 75 | int i; |
| 76 | char ch; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 77 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 78 | if (!PyArg_ParseTuple(args, "O&:tcgetattr", |
| 79 | fdconv, (void*)&fd)) |
| 80 | return NULL; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 81 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 82 | if (tcgetattr(fd, &mode) == -1) |
| 83 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 84 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 85 | ispeed = cfgetispeed(&mode); |
| 86 | ospeed = cfgetospeed(&mode); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 87 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 88 | cc = PyList_New(NCCS); |
| 89 | if (cc == NULL) |
| 90 | return NULL; |
| 91 | for (i = 0; i < NCCS; i++) { |
| 92 | ch = (char)mode.c_cc[i]; |
| 93 | v = PyBytes_FromStringAndSize(&ch, 1); |
| 94 | if (v == NULL) |
| 95 | goto err; |
| 96 | PyList_SetItem(cc, i, v); |
| 97 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 98 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 99 | /* Convert the MIN and TIME slots to integer. On some systems, the |
| 100 | MIN and TIME slots are the same as the EOF and EOL slots. So we |
| 101 | only do this in noncanonical input mode. */ |
| 102 | if ((mode.c_lflag & ICANON) == 0) { |
| 103 | v = PyLong_FromLong((long)mode.c_cc[VMIN]); |
| 104 | if (v == NULL) |
| 105 | goto err; |
| 106 | PyList_SetItem(cc, VMIN, v); |
| 107 | v = PyLong_FromLong((long)mode.c_cc[VTIME]); |
| 108 | if (v == NULL) |
| 109 | goto err; |
| 110 | PyList_SetItem(cc, VTIME, v); |
| 111 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 112 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 113 | if (!(v = PyList_New(7))) |
| 114 | goto err; |
Barry Warsaw | 5709dcf | 1997-01-10 18:42:18 +0000 | [diff] [blame] | 115 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 116 | PyList_SetItem(v, 0, PyLong_FromLong((long)mode.c_iflag)); |
| 117 | PyList_SetItem(v, 1, PyLong_FromLong((long)mode.c_oflag)); |
| 118 | PyList_SetItem(v, 2, PyLong_FromLong((long)mode.c_cflag)); |
| 119 | PyList_SetItem(v, 3, PyLong_FromLong((long)mode.c_lflag)); |
| 120 | PyList_SetItem(v, 4, PyLong_FromLong((long)ispeed)); |
| 121 | PyList_SetItem(v, 5, PyLong_FromLong((long)ospeed)); |
Zackery Spytz | 53835e9 | 2018-10-28 22:55:20 -0600 | [diff] [blame] | 122 | if (PyErr_Occurred()) { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 123 | Py_DECREF(v); |
| 124 | goto err; |
| 125 | } |
Zackery Spytz | 53835e9 | 2018-10-28 22:55:20 -0600 | [diff] [blame] | 126 | PyList_SetItem(v, 6, cc); |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 127 | return v; |
Barry Warsaw | 5709dcf | 1997-01-10 18:42:18 +0000 | [diff] [blame] | 128 | err: |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 129 | Py_DECREF(cc); |
| 130 | return NULL; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 131 | } |
| 132 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 133 | PyDoc_STRVAR(termios_tcsetattr__doc__, |
| 134 | "tcsetattr(fd, when, attributes) -> None\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 135 | \n\ |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 136 | Set the tty attributes for file descriptor fd.\n\ |
| 137 | The attributes to be set are taken from the attributes argument, which\n\ |
| 138 | is a list like the one returned by tcgetattr(). The when argument\n\ |
Fred Drake | 29fd031 | 2001-04-09 19:32:52 +0000 | [diff] [blame] | 139 | determines when the attributes are changed: termios.TCSANOW to\n\ |
| 140 | change immediately, termios.TCSADRAIN to change after transmitting all\n\ |
| 141 | queued output, or termios.TCSAFLUSH to change after transmitting all\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 142 | queued output and discarding all queued input. "); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 143 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 144 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 145 | termios_tcsetattr(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 146 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 147 | int fd, when; |
| 148 | struct termios mode; |
| 149 | speed_t ispeed, ospeed; |
| 150 | PyObject *term, *cc, *v; |
| 151 | int i; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 152 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 153 | if (!PyArg_ParseTuple(args, "O&iO:tcsetattr", |
| 154 | fdconv, &fd, &when, &term)) |
| 155 | return NULL; |
| 156 | if (!PyList_Check(term) || PyList_Size(term) != 7) { |
| 157 | PyErr_SetString(PyExc_TypeError, |
| 158 | "tcsetattr, arg 3: must be 7 element list"); |
| 159 | return NULL; |
| 160 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 161 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 162 | /* Get the old mode, in case there are any hidden fields... */ |
| 163 | if (tcgetattr(fd, &mode) == -1) |
| 164 | return PyErr_SetFromErrno(TermiosError); |
| 165 | mode.c_iflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 0)); |
| 166 | mode.c_oflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 1)); |
| 167 | mode.c_cflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 2)); |
| 168 | mode.c_lflag = (tcflag_t) PyLong_AsLong(PyList_GetItem(term, 3)); |
| 169 | ispeed = (speed_t) PyLong_AsLong(PyList_GetItem(term, 4)); |
| 170 | ospeed = (speed_t) PyLong_AsLong(PyList_GetItem(term, 5)); |
| 171 | cc = PyList_GetItem(term, 6); |
| 172 | if (PyErr_Occurred()) |
| 173 | return NULL; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 174 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 175 | if (!PyList_Check(cc) || PyList_Size(cc) != NCCS) { |
| 176 | PyErr_Format(PyExc_TypeError, |
| 177 | "tcsetattr: attributes[6] must be %d element list", |
| 178 | NCCS); |
| 179 | return NULL; |
| 180 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 181 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 182 | for (i = 0; i < NCCS; i++) { |
| 183 | v = PyList_GetItem(cc, i); |
Barry Warsaw | 5709dcf | 1997-01-10 18:42:18 +0000 | [diff] [blame] | 184 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 185 | if (PyBytes_Check(v) && PyBytes_Size(v) == 1) |
| 186 | mode.c_cc[i] = (cc_t) * PyBytes_AsString(v); |
| 187 | else if (PyLong_Check(v)) |
| 188 | mode.c_cc[i] = (cc_t) PyLong_AsLong(v); |
| 189 | else { |
| 190 | PyErr_SetString(PyExc_TypeError, |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 191 | "tcsetattr: elements of attributes must be characters or integers"); |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 192 | return NULL; |
| 193 | } |
| 194 | } |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 195 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 196 | if (cfsetispeed(&mode, (speed_t) ispeed) == -1) |
| 197 | return PyErr_SetFromErrno(TermiosError); |
| 198 | if (cfsetospeed(&mode, (speed_t) ospeed) == -1) |
| 199 | return PyErr_SetFromErrno(TermiosError); |
| 200 | if (tcsetattr(fd, when, &mode) == -1) |
| 201 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 202 | |
Serhiy Storchaka | 228b12e | 2017-01-23 09:47:21 +0200 | [diff] [blame] | 203 | Py_RETURN_NONE; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 206 | PyDoc_STRVAR(termios_tcsendbreak__doc__, |
| 207 | "tcsendbreak(fd, duration) -> None\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 208 | \n\ |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 209 | Send a break on file descriptor fd.\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 210 | A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 211 | has a system dependent meaning."); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 212 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 213 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 214 | termios_tcsendbreak(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 215 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 216 | int fd, duration; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 217 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 218 | if (!PyArg_ParseTuple(args, "O&i:tcsendbreak", |
| 219 | fdconv, &fd, &duration)) |
| 220 | return NULL; |
| 221 | if (tcsendbreak(fd, duration) == -1) |
| 222 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 223 | |
Serhiy Storchaka | 228b12e | 2017-01-23 09:47:21 +0200 | [diff] [blame] | 224 | Py_RETURN_NONE; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 225 | } |
| 226 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 227 | PyDoc_STRVAR(termios_tcdrain__doc__, |
| 228 | "tcdrain(fd) -> None\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 229 | \n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 230 | Wait until all output written to file descriptor fd has been transmitted."); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 231 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 232 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 233 | termios_tcdrain(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 234 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 235 | int fd; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 236 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 237 | if (!PyArg_ParseTuple(args, "O&:tcdrain", |
| 238 | fdconv, &fd)) |
| 239 | return NULL; |
| 240 | if (tcdrain(fd) == -1) |
| 241 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 242 | |
Serhiy Storchaka | 228b12e | 2017-01-23 09:47:21 +0200 | [diff] [blame] | 243 | Py_RETURN_NONE; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 244 | } |
| 245 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 246 | PyDoc_STRVAR(termios_tcflush__doc__, |
| 247 | "tcflush(fd, queue) -> None\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 248 | \n\ |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 249 | Discard queued data on file descriptor fd.\n\ |
Fred Drake | 29fd031 | 2001-04-09 19:32:52 +0000 | [diff] [blame] | 250 | The queue selector specifies which queue: termios.TCIFLUSH for the input\n\ |
| 251 | queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 252 | both queues. "); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 253 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 254 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 255 | termios_tcflush(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 256 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 257 | int fd, queue; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 258 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 259 | if (!PyArg_ParseTuple(args, "O&i:tcflush", |
| 260 | fdconv, &fd, &queue)) |
| 261 | return NULL; |
| 262 | if (tcflush(fd, queue) == -1) |
| 263 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 264 | |
Serhiy Storchaka | 228b12e | 2017-01-23 09:47:21 +0200 | [diff] [blame] | 265 | Py_RETURN_NONE; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 268 | PyDoc_STRVAR(termios_tcflow__doc__, |
| 269 | "tcflow(fd, action) -> None\n\ |
Fred Drake | b638aaf | 2001-05-07 17:55:35 +0000 | [diff] [blame] | 270 | \n\ |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 271 | Suspend or resume input or output on file descriptor fd.\n\ |
Fred Drake | 29fd031 | 2001-04-09 19:32:52 +0000 | [diff] [blame] | 272 | The action argument can be termios.TCOOFF to suspend output,\n\ |
| 273 | termios.TCOON to restart output, termios.TCIOFF to suspend input,\n\ |
Martin v. Löwis | 14f8b4c | 2002-06-13 20:33:02 +0000 | [diff] [blame] | 274 | or termios.TCION to restart input."); |
Guido van Rossum | 1aca4d8 | 1998-03-03 22:10:18 +0000 | [diff] [blame] | 275 | |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 276 | static PyObject * |
Peter Schneider-Kamp | 416d413 | 2000-07-10 12:15:54 +0000 | [diff] [blame] | 277 | termios_tcflow(PyObject *self, PyObject *args) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 278 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 279 | int fd, action; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 280 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 281 | if (!PyArg_ParseTuple(args, "O&i:tcflow", |
| 282 | fdconv, &fd, &action)) |
| 283 | return NULL; |
| 284 | if (tcflow(fd, action) == -1) |
| 285 | return PyErr_SetFromErrno(TermiosError); |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 286 | |
Serhiy Storchaka | 228b12e | 2017-01-23 09:47:21 +0200 | [diff] [blame] | 287 | Py_RETURN_NONE; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | static PyMethodDef termios_methods[] = |
| 291 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 292 | {"tcgetattr", termios_tcgetattr, |
| 293 | METH_VARARGS, termios_tcgetattr__doc__}, |
| 294 | {"tcsetattr", termios_tcsetattr, |
| 295 | METH_VARARGS, termios_tcsetattr__doc__}, |
| 296 | {"tcsendbreak", termios_tcsendbreak, |
| 297 | METH_VARARGS, termios_tcsendbreak__doc__}, |
| 298 | {"tcdrain", termios_tcdrain, |
| 299 | METH_VARARGS, termios_tcdrain__doc__}, |
| 300 | {"tcflush", termios_tcflush, |
| 301 | METH_VARARGS, termios_tcflush__doc__}, |
| 302 | {"tcflow", termios_tcflow, |
| 303 | METH_VARARGS, termios_tcflow__doc__}, |
| 304 | {NULL, NULL} |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 305 | }; |
| 306 | |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 307 | |
Fred Drake | 9ef7fa8 | 2001-03-01 21:54:49 +0000 | [diff] [blame] | 308 | #if defined(VSWTCH) && !defined(VSWTC) |
| 309 | #define VSWTC VSWTCH |
| 310 | #endif |
| 311 | |
| 312 | #if defined(VSWTC) && !defined(VSWTCH) |
| 313 | #define VSWTCH VSWTC |
| 314 | #endif |
| 315 | |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 316 | static struct constant { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 317 | char *name; |
| 318 | long value; |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 319 | } termios_constants[] = { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 320 | /* cfgetospeed(), cfsetospeed() constants */ |
| 321 | {"B0", B0}, |
| 322 | {"B50", B50}, |
| 323 | {"B75", B75}, |
| 324 | {"B110", B110}, |
| 325 | {"B134", B134}, |
| 326 | {"B150", B150}, |
| 327 | {"B200", B200}, |
| 328 | {"B300", B300}, |
| 329 | {"B600", B600}, |
| 330 | {"B1200", B1200}, |
| 331 | {"B1800", B1800}, |
| 332 | {"B2400", B2400}, |
| 333 | {"B4800", B4800}, |
| 334 | {"B9600", B9600}, |
| 335 | {"B19200", B19200}, |
| 336 | {"B38400", B38400}, |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 337 | #ifdef B57600 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 338 | {"B57600", B57600}, |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 339 | #endif |
| 340 | #ifdef B115200 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 341 | {"B115200", B115200}, |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 342 | #endif |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 343 | #ifdef B230400 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 344 | {"B230400", B230400}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 345 | #endif |
Antoine Pitrou | a78f74c | 2010-11-20 20:03:08 +0000 | [diff] [blame] | 346 | #ifdef B460800 |
| 347 | {"B460800", B460800}, |
| 348 | #endif |
| 349 | #ifdef B500000 |
| 350 | {"B500000", B500000}, |
| 351 | #endif |
| 352 | #ifdef B576000 |
| 353 | {"B576000", B576000}, |
| 354 | #endif |
| 355 | #ifdef B921600 |
| 356 | {"B921600", B921600}, |
| 357 | #endif |
| 358 | #ifdef B1000000 |
| 359 | {"B1000000", B1000000}, |
| 360 | #endif |
| 361 | #ifdef B1152000 |
| 362 | {"B1152000", B1152000}, |
| 363 | #endif |
| 364 | #ifdef B1500000 |
| 365 | {"B1500000", B1500000}, |
| 366 | #endif |
| 367 | #ifdef B2000000 |
| 368 | {"B2000000", B2000000}, |
| 369 | #endif |
| 370 | #ifdef B2500000 |
| 371 | {"B2500000", B2500000}, |
| 372 | #endif |
| 373 | #ifdef B3000000 |
| 374 | {"B3000000", B3000000}, |
| 375 | #endif |
| 376 | #ifdef B3500000 |
| 377 | {"B3500000", B3500000}, |
| 378 | #endif |
| 379 | #ifdef B4000000 |
| 380 | {"B4000000", B4000000}, |
| 381 | #endif |
| 382 | |
Fred Drake | 9ef7fa8 | 2001-03-01 21:54:49 +0000 | [diff] [blame] | 383 | #ifdef CBAUDEX |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 384 | {"CBAUDEX", CBAUDEX}, |
Fred Drake | 9ef7fa8 | 2001-03-01 21:54:49 +0000 | [diff] [blame] | 385 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 386 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 387 | /* tcsetattr() constants */ |
| 388 | {"TCSANOW", TCSANOW}, |
| 389 | {"TCSADRAIN", TCSADRAIN}, |
| 390 | {"TCSAFLUSH", TCSAFLUSH}, |
Gregory P. Smith | cafc22f | 2009-11-01 19:24:18 +0000 | [diff] [blame] | 391 | #ifdef TCSASOFT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 392 | {"TCSASOFT", TCSASOFT}, |
Gregory P. Smith | cafc22f | 2009-11-01 19:24:18 +0000 | [diff] [blame] | 393 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 394 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 395 | /* tcflush() constants */ |
| 396 | {"TCIFLUSH", TCIFLUSH}, |
| 397 | {"TCOFLUSH", TCOFLUSH}, |
| 398 | {"TCIOFLUSH", TCIOFLUSH}, |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 399 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 400 | /* tcflow() constants */ |
| 401 | {"TCOOFF", TCOOFF}, |
| 402 | {"TCOON", TCOON}, |
| 403 | {"TCIOFF", TCIOFF}, |
| 404 | {"TCION", TCION}, |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 405 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 406 | /* struct termios.c_iflag constants */ |
| 407 | {"IGNBRK", IGNBRK}, |
| 408 | {"BRKINT", BRKINT}, |
| 409 | {"IGNPAR", IGNPAR}, |
| 410 | {"PARMRK", PARMRK}, |
| 411 | {"INPCK", INPCK}, |
| 412 | {"ISTRIP", ISTRIP}, |
| 413 | {"INLCR", INLCR}, |
| 414 | {"IGNCR", IGNCR}, |
| 415 | {"ICRNL", ICRNL}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 416 | #ifdef IUCLC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 417 | {"IUCLC", IUCLC}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 418 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 419 | {"IXON", IXON}, |
| 420 | {"IXANY", IXANY}, |
| 421 | {"IXOFF", IXOFF}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 422 | #ifdef IMAXBEL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 423 | {"IMAXBEL", IMAXBEL}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 424 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 425 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 426 | /* struct termios.c_oflag constants */ |
| 427 | {"OPOST", OPOST}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 428 | #ifdef OLCUC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 429 | {"OLCUC", OLCUC}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 430 | #endif |
Andrew MacIntyre | 7bf6833 | 2002-03-03 02:59:16 +0000 | [diff] [blame] | 431 | #ifdef ONLCR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 432 | {"ONLCR", ONLCR}, |
Andrew MacIntyre | 7bf6833 | 2002-03-03 02:59:16 +0000 | [diff] [blame] | 433 | #endif |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 434 | #ifdef OCRNL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 435 | {"OCRNL", OCRNL}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 436 | #endif |
| 437 | #ifdef ONOCR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 438 | {"ONOCR", ONOCR}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 439 | #endif |
| 440 | #ifdef ONLRET |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 441 | {"ONLRET", ONLRET}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 442 | #endif |
| 443 | #ifdef OFILL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 444 | {"OFILL", OFILL}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 445 | #endif |
| 446 | #ifdef OFDEL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 447 | {"OFDEL", OFDEL}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 448 | #endif |
| 449 | #ifdef NLDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 450 | {"NLDLY", NLDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 451 | #endif |
| 452 | #ifdef CRDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 453 | {"CRDLY", CRDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 454 | #endif |
| 455 | #ifdef TABDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 456 | {"TABDLY", TABDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 457 | #endif |
| 458 | #ifdef BSDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 459 | {"BSDLY", BSDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 460 | #endif |
| 461 | #ifdef VTDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 462 | {"VTDLY", VTDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 463 | #endif |
| 464 | #ifdef FFDLY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 465 | {"FFDLY", FFDLY}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 466 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 467 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 468 | /* struct termios.c_oflag-related values (delay mask) */ |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 469 | #ifdef NL0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 470 | {"NL0", NL0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 471 | #endif |
| 472 | #ifdef NL1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 473 | {"NL1", NL1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 474 | #endif |
| 475 | #ifdef CR0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 476 | {"CR0", CR0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 477 | #endif |
| 478 | #ifdef CR1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 479 | {"CR1", CR1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 480 | #endif |
| 481 | #ifdef CR2 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 482 | {"CR2", CR2}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 483 | #endif |
| 484 | #ifdef CR3 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 485 | {"CR3", CR3}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 486 | #endif |
| 487 | #ifdef TAB0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 488 | {"TAB0", TAB0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 489 | #endif |
| 490 | #ifdef TAB1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 491 | {"TAB1", TAB1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 492 | #endif |
| 493 | #ifdef TAB2 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 494 | {"TAB2", TAB2}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 495 | #endif |
| 496 | #ifdef TAB3 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 497 | {"TAB3", TAB3}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 498 | #endif |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 499 | #ifdef XTABS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 500 | {"XTABS", XTABS}, |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 501 | #endif |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 502 | #ifdef BS0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 503 | {"BS0", BS0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 504 | #endif |
| 505 | #ifdef BS1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 506 | {"BS1", BS1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 507 | #endif |
| 508 | #ifdef VT0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 509 | {"VT0", VT0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 510 | #endif |
| 511 | #ifdef VT1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 512 | {"VT1", VT1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 513 | #endif |
| 514 | #ifdef FF0 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 515 | {"FF0", FF0}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 516 | #endif |
| 517 | #ifdef FF1 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 518 | {"FF1", FF1}, |
Fred Drake | d85556c | 2001-03-03 18:08:52 +0000 | [diff] [blame] | 519 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 520 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 521 | /* struct termios.c_cflag constants */ |
| 522 | {"CSIZE", CSIZE}, |
| 523 | {"CSTOPB", CSTOPB}, |
| 524 | {"CREAD", CREAD}, |
| 525 | {"PARENB", PARENB}, |
| 526 | {"PARODD", PARODD}, |
| 527 | {"HUPCL", HUPCL}, |
| 528 | {"CLOCAL", CLOCAL}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 529 | #ifdef CIBAUD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 530 | {"CIBAUD", CIBAUD}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 531 | #endif |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 532 | #ifdef CRTSCTS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 533 | {"CRTSCTS", (long)CRTSCTS}, |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 534 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 535 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 536 | /* struct termios.c_cflag-related values (character size) */ |
| 537 | {"CS5", CS5}, |
| 538 | {"CS6", CS6}, |
| 539 | {"CS7", CS7}, |
| 540 | {"CS8", CS8}, |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 541 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 542 | /* struct termios.c_lflag constants */ |
| 543 | {"ISIG", ISIG}, |
| 544 | {"ICANON", ICANON}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 545 | #ifdef XCASE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 546 | {"XCASE", XCASE}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 547 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 548 | {"ECHO", ECHO}, |
| 549 | {"ECHOE", ECHOE}, |
| 550 | {"ECHOK", ECHOK}, |
| 551 | {"ECHONL", ECHONL}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 552 | #ifdef ECHOCTL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 553 | {"ECHOCTL", ECHOCTL}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 554 | #endif |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 555 | #ifdef ECHOPRT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 556 | {"ECHOPRT", ECHOPRT}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 557 | #endif |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 558 | #ifdef ECHOKE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 559 | {"ECHOKE", ECHOKE}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 560 | #endif |
| 561 | #ifdef FLUSHO |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 562 | {"FLUSHO", FLUSHO}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 563 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 564 | {"NOFLSH", NOFLSH}, |
| 565 | {"TOSTOP", TOSTOP}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 566 | #ifdef PENDIN |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 567 | {"PENDIN", PENDIN}, |
Fred Drake | abb379e | 2001-03-01 03:28:08 +0000 | [diff] [blame] | 568 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 569 | {"IEXTEN", IEXTEN}, |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 570 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 571 | /* indexes into the control chars array returned by tcgetattr() */ |
| 572 | {"VINTR", VINTR}, |
| 573 | {"VQUIT", VQUIT}, |
| 574 | {"VERASE", VERASE}, |
| 575 | {"VKILL", VKILL}, |
| 576 | {"VEOF", VEOF}, |
| 577 | {"VTIME", VTIME}, |
| 578 | {"VMIN", VMIN}, |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 579 | #ifdef VSWTC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 580 | /* The #defines above ensure that if either is defined, both are, |
| 581 | * but both may be omitted by the system headers. ;-( */ |
| 582 | {"VSWTC", VSWTC}, |
| 583 | {"VSWTCH", VSWTCH}, |
Fred Drake | dedbebf | 2001-03-02 06:50:58 +0000 | [diff] [blame] | 584 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 585 | {"VSTART", VSTART}, |
| 586 | {"VSTOP", VSTOP}, |
| 587 | {"VSUSP", VSUSP}, |
| 588 | {"VEOL", VEOL}, |
Fred Drake | d0b625d | 2001-05-22 15:44:15 +0000 | [diff] [blame] | 589 | #ifdef VREPRINT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 590 | {"VREPRINT", VREPRINT}, |
Fred Drake | 87068f1 | 2001-05-11 16:14:17 +0000 | [diff] [blame] | 591 | #endif |
Fred Drake | d0b625d | 2001-05-22 15:44:15 +0000 | [diff] [blame] | 592 | #ifdef VDISCARD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 593 | {"VDISCARD", VDISCARD}, |
Fred Drake | 87068f1 | 2001-05-11 16:14:17 +0000 | [diff] [blame] | 594 | #endif |
Thomas Wouters | 819bb2c | 2001-06-11 15:25:16 +0000 | [diff] [blame] | 595 | #ifdef VWERASE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 596 | {"VWERASE", VWERASE}, |
Thomas Wouters | 819bb2c | 2001-06-11 15:25:16 +0000 | [diff] [blame] | 597 | #endif |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 598 | #ifdef VLNEXT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 599 | {"VLNEXT", VLNEXT}, |
Thomas Wouters | 2b30524 | 2001-06-15 12:05:44 +0000 | [diff] [blame] | 600 | #endif |
Andrew MacIntyre | 7bf6833 | 2002-03-03 02:59:16 +0000 | [diff] [blame] | 601 | #ifdef VEOL2 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 602 | {"VEOL2", VEOL2}, |
Andrew MacIntyre | 7bf6833 | 2002-03-03 02:59:16 +0000 | [diff] [blame] | 603 | #endif |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 604 | |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 605 | |
| 606 | #ifdef B460800 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 607 | {"B460800", B460800}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 608 | #endif |
| 609 | #ifdef CBAUD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 610 | {"CBAUD", CBAUD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 611 | #endif |
| 612 | #ifdef CDEL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 613 | {"CDEL", CDEL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 614 | #endif |
| 615 | #ifdef CDSUSP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 616 | {"CDSUSP", CDSUSP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 617 | #endif |
| 618 | #ifdef CEOF |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 619 | {"CEOF", CEOF}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 620 | #endif |
| 621 | #ifdef CEOL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 622 | {"CEOL", CEOL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 623 | #endif |
| 624 | #ifdef CEOL2 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 625 | {"CEOL2", CEOL2}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 626 | #endif |
| 627 | #ifdef CEOT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 628 | {"CEOT", CEOT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 629 | #endif |
| 630 | #ifdef CERASE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 631 | {"CERASE", CERASE}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 632 | #endif |
| 633 | #ifdef CESC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 634 | {"CESC", CESC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 635 | #endif |
| 636 | #ifdef CFLUSH |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 637 | {"CFLUSH", CFLUSH}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 638 | #endif |
| 639 | #ifdef CINTR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 640 | {"CINTR", CINTR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 641 | #endif |
| 642 | #ifdef CKILL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 643 | {"CKILL", CKILL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 644 | #endif |
| 645 | #ifdef CLNEXT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 646 | {"CLNEXT", CLNEXT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 647 | #endif |
| 648 | #ifdef CNUL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 649 | {"CNUL", CNUL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 650 | #endif |
| 651 | #ifdef COMMON |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 652 | {"COMMON", COMMON}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 653 | #endif |
| 654 | #ifdef CQUIT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 655 | {"CQUIT", CQUIT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 656 | #endif |
| 657 | #ifdef CRPRNT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 658 | {"CRPRNT", CRPRNT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 659 | #endif |
| 660 | #ifdef CSTART |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 661 | {"CSTART", CSTART}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 662 | #endif |
| 663 | #ifdef CSTOP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 664 | {"CSTOP", CSTOP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 665 | #endif |
| 666 | #ifdef CSUSP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 667 | {"CSUSP", CSUSP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 668 | #endif |
| 669 | #ifdef CSWTCH |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 670 | {"CSWTCH", CSWTCH}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 671 | #endif |
| 672 | #ifdef CWERASE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 673 | {"CWERASE", CWERASE}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 674 | #endif |
| 675 | #ifdef EXTA |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 676 | {"EXTA", EXTA}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 677 | #endif |
| 678 | #ifdef EXTB |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 679 | {"EXTB", EXTB}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 680 | #endif |
| 681 | #ifdef FIOASYNC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 682 | {"FIOASYNC", FIOASYNC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 683 | #endif |
| 684 | #ifdef FIOCLEX |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 685 | {"FIOCLEX", FIOCLEX}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 686 | #endif |
| 687 | #ifdef FIONBIO |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 688 | {"FIONBIO", FIONBIO}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 689 | #endif |
| 690 | #ifdef FIONCLEX |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 691 | {"FIONCLEX", FIONCLEX}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 692 | #endif |
| 693 | #ifdef FIONREAD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 694 | {"FIONREAD", FIONREAD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 695 | #endif |
| 696 | #ifdef IBSHIFT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 697 | {"IBSHIFT", IBSHIFT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 698 | #endif |
| 699 | #ifdef INIT_C_CC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 700 | {"INIT_C_CC", INIT_C_CC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 701 | #endif |
| 702 | #ifdef IOCSIZE_MASK |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 703 | {"IOCSIZE_MASK", IOCSIZE_MASK}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 704 | #endif |
| 705 | #ifdef IOCSIZE_SHIFT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 706 | {"IOCSIZE_SHIFT", IOCSIZE_SHIFT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 707 | #endif |
| 708 | #ifdef NCC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 709 | {"NCC", NCC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 710 | #endif |
| 711 | #ifdef NCCS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 712 | {"NCCS", NCCS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 713 | #endif |
| 714 | #ifdef NSWTCH |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 715 | {"NSWTCH", NSWTCH}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 716 | #endif |
| 717 | #ifdef N_MOUSE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 718 | {"N_MOUSE", N_MOUSE}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 719 | #endif |
| 720 | #ifdef N_PPP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 721 | {"N_PPP", N_PPP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 722 | #endif |
| 723 | #ifdef N_SLIP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 724 | {"N_SLIP", N_SLIP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 725 | #endif |
| 726 | #ifdef N_STRIP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 727 | {"N_STRIP", N_STRIP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 728 | #endif |
| 729 | #ifdef N_TTY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 730 | {"N_TTY", N_TTY}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 731 | #endif |
| 732 | #ifdef TCFLSH |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 733 | {"TCFLSH", TCFLSH}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 734 | #endif |
| 735 | #ifdef TCGETA |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 736 | {"TCGETA", TCGETA}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 737 | #endif |
| 738 | #ifdef TCGETS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 739 | {"TCGETS", TCGETS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 740 | #endif |
| 741 | #ifdef TCSBRK |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 742 | {"TCSBRK", TCSBRK}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 743 | #endif |
| 744 | #ifdef TCSBRKP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 745 | {"TCSBRKP", TCSBRKP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 746 | #endif |
| 747 | #ifdef TCSETA |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 748 | {"TCSETA", TCSETA}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 749 | #endif |
| 750 | #ifdef TCSETAF |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 751 | {"TCSETAF", TCSETAF}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 752 | #endif |
| 753 | #ifdef TCSETAW |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 754 | {"TCSETAW", TCSETAW}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 755 | #endif |
| 756 | #ifdef TCSETS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 757 | {"TCSETS", TCSETS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 758 | #endif |
| 759 | #ifdef TCSETSF |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 760 | {"TCSETSF", TCSETSF}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 761 | #endif |
| 762 | #ifdef TCSETSW |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 763 | {"TCSETSW", TCSETSW}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 764 | #endif |
| 765 | #ifdef TCXONC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 766 | {"TCXONC", TCXONC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 767 | #endif |
| 768 | #ifdef TIOCCONS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 769 | {"TIOCCONS", TIOCCONS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 770 | #endif |
| 771 | #ifdef TIOCEXCL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 772 | {"TIOCEXCL", TIOCEXCL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 773 | #endif |
| 774 | #ifdef TIOCGETD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 775 | {"TIOCGETD", TIOCGETD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 776 | #endif |
| 777 | #ifdef TIOCGICOUNT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 778 | {"TIOCGICOUNT", TIOCGICOUNT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 779 | #endif |
| 780 | #ifdef TIOCGLCKTRMIOS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 781 | {"TIOCGLCKTRMIOS", TIOCGLCKTRMIOS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 782 | #endif |
| 783 | #ifdef TIOCGPGRP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 784 | {"TIOCGPGRP", TIOCGPGRP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 785 | #endif |
| 786 | #ifdef TIOCGSERIAL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 787 | {"TIOCGSERIAL", TIOCGSERIAL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 788 | #endif |
| 789 | #ifdef TIOCGSOFTCAR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 790 | {"TIOCGSOFTCAR", TIOCGSOFTCAR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 791 | #endif |
| 792 | #ifdef TIOCGWINSZ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 793 | {"TIOCGWINSZ", TIOCGWINSZ}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 794 | #endif |
| 795 | #ifdef TIOCINQ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 796 | {"TIOCINQ", TIOCINQ}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 797 | #endif |
| 798 | #ifdef TIOCLINUX |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 799 | {"TIOCLINUX", TIOCLINUX}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 800 | #endif |
| 801 | #ifdef TIOCMBIC |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 802 | {"TIOCMBIC", TIOCMBIC}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 803 | #endif |
| 804 | #ifdef TIOCMBIS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 805 | {"TIOCMBIS", TIOCMBIS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 806 | #endif |
| 807 | #ifdef TIOCMGET |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 808 | {"TIOCMGET", TIOCMGET}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 809 | #endif |
| 810 | #ifdef TIOCMIWAIT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 811 | {"TIOCMIWAIT", TIOCMIWAIT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 812 | #endif |
| 813 | #ifdef TIOCMSET |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 814 | {"TIOCMSET", TIOCMSET}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 815 | #endif |
| 816 | #ifdef TIOCM_CAR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 817 | {"TIOCM_CAR", TIOCM_CAR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 818 | #endif |
| 819 | #ifdef TIOCM_CD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 820 | {"TIOCM_CD", TIOCM_CD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 821 | #endif |
| 822 | #ifdef TIOCM_CTS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 823 | {"TIOCM_CTS", TIOCM_CTS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 824 | #endif |
| 825 | #ifdef TIOCM_DSR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 826 | {"TIOCM_DSR", TIOCM_DSR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 827 | #endif |
| 828 | #ifdef TIOCM_DTR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 829 | {"TIOCM_DTR", TIOCM_DTR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 830 | #endif |
| 831 | #ifdef TIOCM_LE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 832 | {"TIOCM_LE", TIOCM_LE}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 833 | #endif |
| 834 | #ifdef TIOCM_RI |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 835 | {"TIOCM_RI", TIOCM_RI}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 836 | #endif |
| 837 | #ifdef TIOCM_RNG |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 838 | {"TIOCM_RNG", TIOCM_RNG}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 839 | #endif |
| 840 | #ifdef TIOCM_RTS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 841 | {"TIOCM_RTS", TIOCM_RTS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 842 | #endif |
| 843 | #ifdef TIOCM_SR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 844 | {"TIOCM_SR", TIOCM_SR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 845 | #endif |
| 846 | #ifdef TIOCM_ST |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 847 | {"TIOCM_ST", TIOCM_ST}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 848 | #endif |
| 849 | #ifdef TIOCNOTTY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 850 | {"TIOCNOTTY", TIOCNOTTY}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 851 | #endif |
| 852 | #ifdef TIOCNXCL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 853 | {"TIOCNXCL", TIOCNXCL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 854 | #endif |
| 855 | #ifdef TIOCOUTQ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 856 | {"TIOCOUTQ", TIOCOUTQ}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 857 | #endif |
| 858 | #ifdef TIOCPKT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 859 | {"TIOCPKT", TIOCPKT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 860 | #endif |
| 861 | #ifdef TIOCPKT_DATA |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 862 | {"TIOCPKT_DATA", TIOCPKT_DATA}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 863 | #endif |
| 864 | #ifdef TIOCPKT_DOSTOP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 865 | {"TIOCPKT_DOSTOP", TIOCPKT_DOSTOP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 866 | #endif |
| 867 | #ifdef TIOCPKT_FLUSHREAD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 868 | {"TIOCPKT_FLUSHREAD", TIOCPKT_FLUSHREAD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 869 | #endif |
| 870 | #ifdef TIOCPKT_FLUSHWRITE |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 871 | {"TIOCPKT_FLUSHWRITE", TIOCPKT_FLUSHWRITE}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 872 | #endif |
| 873 | #ifdef TIOCPKT_NOSTOP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 874 | {"TIOCPKT_NOSTOP", TIOCPKT_NOSTOP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 875 | #endif |
| 876 | #ifdef TIOCPKT_START |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 877 | {"TIOCPKT_START", TIOCPKT_START}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 878 | #endif |
| 879 | #ifdef TIOCPKT_STOP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 880 | {"TIOCPKT_STOP", TIOCPKT_STOP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 881 | #endif |
| 882 | #ifdef TIOCSCTTY |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 883 | {"TIOCSCTTY", TIOCSCTTY}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 884 | #endif |
| 885 | #ifdef TIOCSERCONFIG |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 886 | {"TIOCSERCONFIG", TIOCSERCONFIG}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 887 | #endif |
| 888 | #ifdef TIOCSERGETLSR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 889 | {"TIOCSERGETLSR", TIOCSERGETLSR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 890 | #endif |
| 891 | #ifdef TIOCSERGETMULTI |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 892 | {"TIOCSERGETMULTI", TIOCSERGETMULTI}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 893 | #endif |
| 894 | #ifdef TIOCSERGSTRUCT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 895 | {"TIOCSERGSTRUCT", TIOCSERGSTRUCT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 896 | #endif |
| 897 | #ifdef TIOCSERGWILD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 898 | {"TIOCSERGWILD", TIOCSERGWILD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 899 | #endif |
| 900 | #ifdef TIOCSERSETMULTI |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 901 | {"TIOCSERSETMULTI", TIOCSERSETMULTI}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 902 | #endif |
| 903 | #ifdef TIOCSERSWILD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 904 | {"TIOCSERSWILD", TIOCSERSWILD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 905 | #endif |
| 906 | #ifdef TIOCSER_TEMT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 907 | {"TIOCSER_TEMT", TIOCSER_TEMT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 908 | #endif |
| 909 | #ifdef TIOCSETD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 910 | {"TIOCSETD", TIOCSETD}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 911 | #endif |
| 912 | #ifdef TIOCSLCKTRMIOS |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 913 | {"TIOCSLCKTRMIOS", TIOCSLCKTRMIOS}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 914 | #endif |
| 915 | #ifdef TIOCSPGRP |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 916 | {"TIOCSPGRP", TIOCSPGRP}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 917 | #endif |
| 918 | #ifdef TIOCSSERIAL |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 919 | {"TIOCSSERIAL", TIOCSSERIAL}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 920 | #endif |
| 921 | #ifdef TIOCSSOFTCAR |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 922 | {"TIOCSSOFTCAR", TIOCSSOFTCAR}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 923 | #endif |
| 924 | #ifdef TIOCSTI |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 925 | {"TIOCSTI", TIOCSTI}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 926 | #endif |
| 927 | #ifdef TIOCSWINSZ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 928 | {"TIOCSWINSZ", TIOCSWINSZ}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 929 | #endif |
| 930 | #ifdef TIOCTTYGSTRUCT |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 931 | {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT}, |
Fred Drake | 55a0034 | 2001-03-26 17:14:02 +0000 | [diff] [blame] | 932 | #endif |
| 933 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 934 | /* sentinel */ |
| 935 | {NULL, 0} |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 936 | }; |
| 937 | |
| 938 | |
Martin v. Löwis | 1a21451 | 2008-06-11 05:26:20 +0000 | [diff] [blame] | 939 | static struct PyModuleDef termiosmodule = { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 940 | PyModuleDef_HEAD_INIT, |
| 941 | "termios", |
| 942 | termios__doc__, |
| 943 | -1, |
| 944 | termios_methods, |
| 945 | NULL, |
| 946 | NULL, |
| 947 | NULL, |
| 948 | NULL |
Martin v. Löwis | 1a21451 | 2008-06-11 05:26:20 +0000 | [diff] [blame] | 949 | }; |
| 950 | |
Mark Hammond | fe51c6d | 2002-08-02 02:27:13 +0000 | [diff] [blame] | 951 | PyMODINIT_FUNC |
Thomas Wouters | f3f33dc | 2000-07-21 06:00:07 +0000 | [diff] [blame] | 952 | PyInit_termios(void) |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 953 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 954 | PyObject *m; |
| 955 | struct constant *constant = termios_constants; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 956 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 957 | m = PyModule_Create(&termiosmodule); |
| 958 | if (m == NULL) |
| 959 | return NULL; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 960 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 961 | if (TermiosError == NULL) { |
| 962 | TermiosError = PyErr_NewException("termios.error", NULL, NULL); |
| 963 | } |
| 964 | Py_INCREF(TermiosError); |
| 965 | PyModule_AddObject(m, "error", TermiosError); |
Fred Drake | df48d14 | 2001-02-27 21:22:39 +0000 | [diff] [blame] | 966 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 967 | while (constant->name != NULL) { |
| 968 | PyModule_AddIntConstant(m, constant->name, constant->value); |
| 969 | ++constant; |
| 970 | } |
| 971 | return m; |
Guido van Rossum | 9adae8e | 1994-09-12 10:41:22 +0000 | [diff] [blame] | 972 | } |