Skip to content

Commit 272c61d

Browse files
bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic.
1 parent 8cf4b34 commit 272c61d

File tree

5 files changed

+6552
-1338
lines changed

5 files changed

+6552
-1338
lines changed

Include/py_curses.h

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -91,65 +91,6 @@ static void **PyCurses_API;
9191
static const char catchall_ERR[] = "curses function returned ERR";
9292
static const char catchall_NULL[] = "curses function returned NULL";
9393

94-
/* Function Prototype Macros - They are ugly but very, very useful. ;-)
95-
96-
X - function name
97-
TYPE - parameter Type
98-
ERGSTR - format string for construction of the return value
99-
PARSESTR - format string for argument parsing
100-
*/
101-
102-
#define NoArgNoReturnFunction(X) \
103-
static PyObject *PyCurses_ ## X (PyObject *self) \
104-
{ \
105-
PyCursesInitialised \
106-
return PyCursesCheckERR(X(), # X); }
107-
108-
#define NoArgOrFlagNoReturnFunction(X) \
109-
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
110-
{ \
111-
int flag = 0; \
112-
PyCursesInitialised \
113-
switch(PyTuple_Size(args)) { \
114-
case 0: \
115-
return PyCursesCheckERR(X(), # X); \
116-
case 1: \
117-
if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \
118-
if (flag) return PyCursesCheckERR(X(), # X); \
119-
else return PyCursesCheckERR(no ## X (), # X); \
120-
default: \
121-
PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \
122-
return NULL; } }
123-
124-
#define NoArgReturnIntFunction(X) \
125-
static PyObject *PyCurses_ ## X (PyObject *self) \
126-
{ \
127-
PyCursesInitialised \
128-
return PyLong_FromLong((long) X()); }
129-
130-
131-
#define NoArgReturnStringFunction(X) \
132-
static PyObject *PyCurses_ ## X (PyObject *self) \
133-
{ \
134-
PyCursesInitialised \
135-
return PyBytes_FromString(X()); }
136-
137-
#define NoArgTrueFalseFunction(X) \
138-
static PyObject *PyCurses_ ## X (PyObject *self) \
139-
{ \
140-
PyCursesInitialised \
141-
if (X () == FALSE) { \
142-
Py_RETURN_FALSE; \
143-
} \
144-
Py_RETURN_TRUE; }
145-
146-
#define NoArgNoReturnVoidFunction(X) \
147-
static PyObject *PyCurses_ ## X (PyObject *self) \
148-
{ \
149-
PyCursesInitialised \
150-
X(); \
151-
Py_RETURN_NONE; }
152-
15394
#ifdef __cplusplus
15495
}
15596
#endif

0 commit comments

Comments
 (0)