diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 23:53:51 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-03 23:53:51 +0300 |
| commit | 1009bf18b38a8d36298575191dd8fdf43f8f9097 (patch) | |
| tree | 18860fdef30c931dc2ea177059e96b69a49fa04f /Modules/_cursesmodule.c | |
| parent | 0759f84d6260bad1234b802212e73fdc5873d261 (diff) | |
| download | cpython-git-1009bf18b38a8d36298575191dd8fdf43f8f9097.tar.gz | |
Issue #23501: Argumen Clinic now generates code into separate files by default.
Diffstat (limited to 'Modules/_cursesmodule.c')
| -rw-r--r-- | Modules/_cursesmodule.c | 70 |
1 files changed, 3 insertions, 67 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 6b778687e7..209f87e8b0 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -140,6 +140,8 @@ class curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type" [clinic start generated code]*/ /*[clinic end generated code: output=da39a3ee5e6b4b0d input=88c860abdbb50e0c]*/ +#include "clinic/_cursesmodule.c.h" + /* Definition of exception curses.error */ static PyObject *PyCursesError; @@ -583,75 +585,9 @@ By default, the character position and attributes are the current settings for the window object. [clinic start generated code]*/ -PyDoc_STRVAR(curses_window_addch__doc__, -"addch([y, x,] ch, [attr])\n" -"Paint character ch at (y, x) with attributes attr.\n" -"\n" -" y\n" -" Y-coordinate.\n" -" x\n" -" X-coordinate.\n" -" ch\n" -" Character to add.\n" -" attr\n" -" Attributes for the character.\n" -"\n" -"Paint character ch at (y, x) with attributes attr,\n" -"overwriting any character previously painted at that location.\n" -"By default, the character position and attributes are the\n" -"current settings for the window object."); - -#define CURSES_WINDOW_ADDCH_METHODDEF \ - {"addch", (PyCFunction)curses_window_addch, METH_VARARGS, curses_window_addch__doc__}, - -static PyObject * -curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr); - -static PyObject * -curses_window_addch(PyCursesWindowObject *self, PyObject *args) -{ - PyObject *return_value = NULL; - int group_left_1 = 0; - int y = 0; - int x = 0; - PyObject *ch; - int group_right_1 = 0; - long attr = 0; - - switch (PyTuple_GET_SIZE(args)) { - case 1: - if (!PyArg_ParseTuple(args, "O:addch", &ch)) - goto exit; - break; - case 2: - if (!PyArg_ParseTuple(args, "Ol:addch", &ch, &attr)) - goto exit; - group_right_1 = 1; - break; - case 3: - if (!PyArg_ParseTuple(args, "iiO:addch", &y, &x, &ch)) - goto exit; - group_left_1 = 1; - break; - case 4: - if (!PyArg_ParseTuple(args, "iiOl:addch", &y, &x, &ch, &attr)) - goto exit; - group_right_1 = 1; - group_left_1 = 1; - break; - default: - PyErr_SetString(PyExc_TypeError, "curses.window.addch requires 1 to 4 arguments"); - goto exit; - } - return_value = curses_window_addch_impl(self, group_left_1, y, x, ch, group_right_1, attr); - -exit: - return return_value; -} - static PyObject * curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y, int x, PyObject *ch, int group_right_1, long attr) -/*[clinic end generated code: output=d4b97cc287010c54 input=5a41efb34a2de338]*/ +/*[clinic end generated code: output=9fa34a5d80151f1a input=5a41efb34a2de338]*/ { PyCursesWindowObject *cwself = (PyCursesWindowObject *)self; int coordinates_group = group_left_1; |
