diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-05-10 11:27:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-10 11:27:23 +0300 |
commit | b00854caa080cec613496d3a5e1b0891c9ff83e6 (patch) | |
tree | 7d46b563232b3f3e6d99ed8bee0134f3fe084f03 /Include/py_curses.h | |
parent | bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data ... (diff) | |
download | cpython-b00854caa080cec613496d3a5e1b0891c9ff83e6.tar.gz cpython-b00854caa080cec613496d3a5e1b0891c9ff83e6.tar.bz2 cpython-b00854caa080cec613496d3a5e1b0891c9ff83e6.zip |
bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic. (GH-4251)
Diffstat (limited to 'Include/py_curses.h')
-rw-r--r-- | Include/py_curses.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/Include/py_curses.h b/Include/py_curses.h index 0eebc362a15..2702b37ea7c 100644 --- a/Include/py_curses.h +++ b/Include/py_curses.h @@ -91,65 +91,6 @@ static void **PyCurses_API; static const char catchall_ERR[] = "curses function returned ERR"; static const char catchall_NULL[] = "curses function returned NULL"; -/* Function Prototype Macros - They are ugly but very, very useful. ;-) - - X - function name - TYPE - parameter Type - ERGSTR - format string for construction of the return value - PARSESTR - format string for argument parsing - */ - -#define NoArgNoReturnFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self) \ -{ \ - PyCursesInitialised \ - return PyCursesCheckERR(X(), # X); } - -#define NoArgOrFlagNoReturnFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \ -{ \ - int flag = 0; \ - PyCursesInitialised \ - switch(PyTuple_Size(args)) { \ - case 0: \ - return PyCursesCheckERR(X(), # X); \ - case 1: \ - if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \ - if (flag) return PyCursesCheckERR(X(), # X); \ - else return PyCursesCheckERR(no ## X (), # X); \ - default: \ - PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \ - return NULL; } } - -#define NoArgReturnIntFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self) \ -{ \ - PyCursesInitialised \ - return PyLong_FromLong((long) X()); } - - -#define NoArgReturnStringFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self) \ -{ \ - PyCursesInitialised \ - return PyBytes_FromString(X()); } - -#define NoArgTrueFalseFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self) \ -{ \ - PyCursesInitialised \ - if (X () == FALSE) { \ - Py_RETURN_FALSE; \ - } \ - Py_RETURN_TRUE; } - -#define NoArgNoReturnVoidFunction(X) \ -static PyObject *PyCurses_ ## X (PyObject *self) \ -{ \ - PyCursesInitialised \ - X(); \ - Py_RETURN_NONE; } - #ifdef __cplusplus } #endif |