Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: Modules/_cursesmodule.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Modules/_ctypes/libffi/src/dlmalloc.c ('k') | Modules/faulthandler.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This is a curses module for Python. 2 * This is a curses module for Python.
3 * 3 *
4 * Based on prior work by Lance Ellinghaus and Oliver Andrich 4 * Based on prior work by Lance Ellinghaus and Oliver Andrich
5 * Version 1.2 of this module: Copyright 1994 by Lance Ellinghouse, 5 * Version 1.2 of this module: Copyright 1994 by Lance Ellinghouse,
6 * Cathedral City, California Republic, United States of America. 6 * Cathedral City, California Republic, United States of America.
7 * 7 *
8 * Version 1.5b1, heavily extended for ncurses by Oliver Andrich: 8 * Version 1.5b1, heavily extended for ncurses by Oliver Andrich:
9 * Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany. 9 * Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany.
10 * 10 *
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 return Py_BuildValue("C", rtn); 897 return Py_BuildValue("C", rtn);
898 } else { 898 } else {
899 const char *knp; 899 const char *knp;
900 #if defined(__NetBSD__) 900 #if defined(__NetBSD__)
901 knp = unctrl(rtn); 901 knp = unctrl(rtn);
902 #else 902 #else
903 knp = keyname(rtn); 903 knp = keyname(rtn);
904 #endif 904 #endif
905 return PyUnicode_FromString((knp == NULL) ? "" : knp); 905 return PyUnicode_FromString((knp == NULL) ? "" : knp);
906 } 906 }
907 }
908
909 static PyObject *
910 PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args)
911 {
912 int x, y;
913 int ct;
914 wint_t rtn;
915
916 switch (PyTuple_Size(args)) {
917 case 0:
918 Py_BEGIN_ALLOW_THREADS
919 ct = wget_wch(self->win,&rtn);
920 Py_END_ALLOW_THREADS
921 break;
922 case 2:
923 if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x))
924 return NULL;
925 Py_BEGIN_ALLOW_THREADS
926 ct = mvwget_wch(self->win,y,x,&rtn);
927 Py_END_ALLOW_THREADS
928 break;
929 default:
930 PyErr_SetString(PyExc_TypeError, "get_wch requires 0 or 2 arguments");
931 return NULL;
932 }
933 if (ct == ERR) {
934 /* get_wch() returns ERR in nodelay mode */
935 PyErr_SetString(PyCursesError, "no input");
936 return NULL;
937 }
938 return PyLong_FromLong(rtn);
939 } 907 }
940 908
941 static PyObject * 909 static PyObject *
942 PyCursesWindow_GetStr(PyCursesWindowObject *self, PyObject *args) 910 PyCursesWindow_GetStr(PyCursesWindowObject *self, PyObject *args)
943 { 911 {
944 int x, y, n; 912 int x, y, n;
945 char rtn[1024]; /* This should be big enough.. I hope */ 913 char rtn[1024]; /* This should be big enough.. I hope */
946 int rtn2; 914 int rtn2;
947 915
948 switch (PyTuple_Size(args)) { 916 switch (PyTuple_Size(args)) {
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 {"derwin", (PyCFunction)PyCursesWindow_DerWin, METH_VARARGS}, 1597 {"derwin", (PyCFunction)PyCursesWindow_DerWin, METH_VARARGS},
1630 {"echochar", (PyCFunction)PyCursesWindow_EchoChar, METH_VARARGS}, 1598 {"echochar", (PyCFunction)PyCursesWindow_EchoChar, METH_VARARGS},
1631 #ifdef NCURSES_MOUSE_VERSION 1599 #ifdef NCURSES_MOUSE_VERSION
1632 {"enclose", (PyCFunction)PyCursesWindow_Enclose, METH_VARARGS}, 1600 {"enclose", (PyCFunction)PyCursesWindow_Enclose, METH_VARARGS},
1633 #endif 1601 #endif
1634 {"erase", (PyCFunction)PyCursesWindow_werase, METH_NOARGS}, 1602 {"erase", (PyCFunction)PyCursesWindow_werase, METH_NOARGS},
1635 {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS}, 1603 {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS},
1636 {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS}, 1604 {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS},
1637 {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS}, 1605 {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS},
1638 {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS}, 1606 {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS},
1639 {"get_wch", (PyCFunction)PyCursesWindow_Get_WCh, METH_VARARGS},
1640 {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS}, 1607 {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS},
1641 {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS}, 1608 {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS},
1642 {"getstr", (PyCFunction)PyCursesWindow_GetStr, METH_VARARGS}, 1609 {"getstr", (PyCFunction)PyCursesWindow_GetStr, METH_VARARGS},
1643 {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_NOARGS}, 1610 {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_NOARGS},
1644 {"hline", (PyCFunction)PyCursesWindow_Hline, METH_VARARGS}, 1611 {"hline", (PyCFunction)PyCursesWindow_Hline, METH_VARARGS},
1645 {"idcok", (PyCFunction)PyCursesWindow_idcok, METH_VARARGS}, 1612 {"idcok", (PyCFunction)PyCursesWindow_idcok, METH_VARARGS},
1646 {"idlok", (PyCFunction)PyCursesWindow_idlok, METH_VARARGS}, 1613 {"idlok", (PyCFunction)PyCursesWindow_idlok, METH_VARARGS},
1647 {"immedok", (PyCFunction)PyCursesWindow_immedok, METH_VARARGS}, 1614 {"immedok", (PyCFunction)PyCursesWindow_immedok, METH_VARARGS},
1648 {"inch", (PyCFunction)PyCursesWindow_InCh, METH_VARARGS}, 1615 {"inch", (PyCFunction)PyCursesWindow_InCh, METH_VARARGS},
1649 {"insch", (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS}, 1616 {"insch", (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS},
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 SetDictInt(key_n2,key); 2965 SetDictInt(key_n2,key);
2999 if (key_n2 != key_n) 2966 if (key_n2 != key_n)
3000 free(key_n2); 2967 free(key_n2);
3001 } 2968 }
3002 #endif 2969 #endif
3003 SetDictInt("KEY_MIN", KEY_MIN); 2970 SetDictInt("KEY_MIN", KEY_MIN);
3004 SetDictInt("KEY_MAX", KEY_MAX); 2971 SetDictInt("KEY_MAX", KEY_MAX);
3005 } 2972 }
3006 return m; 2973 return m;
3007 } 2974 }
OLDNEW
« no previous file with comments | « Modules/_ctypes/libffi/src/dlmalloc.c ('k') | Modules/faulthandler.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+