Go to the documentation of this file.
10 #ifdef _BSD_WCHAR_T_DEFINED_
17 #define NCURSES_OPAQUE 0
25 #ifdef _XOPEN_SOURCE_EXTENDED
26 #ifndef __FreeBSD_version
27 #include <osreldate.h>
29 #if __FreeBSD_version >= 500000
60 #ifndef WINDOW_HAS_FLAGS
61 #define WINDOW_HAS_FLAGS 1
63 #ifndef MVWDELCH_IS_EXPRESSION
64 #define MVWDELCH_IS_EXPRESSION 1
72 #define PyCurses_API_pointers 4
81 #define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type)
83 #define PyCurses_CAPSULE_NAME "_curses._C_API"
94 #define PyCursesWindow_Type (*(PyTypeObject *) PyCurses_API[0])
95 #define PyCursesSetupTermCalled {if (! ((int (*)(void))PyCurses_API[1]) () ) return NULL;}
96 #define PyCursesInitialised {if (! ((int (*)(void))PyCurses_API[2]) () ) return NULL;}
97 #define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;}
99 #define import_curses() \
100 PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1);
116 #define NoArgNoReturnFunction(X) \
117 static PyObject *PyCurses_ ## X (PyObject *self) \
119 PyCursesInitialised \
120 return PyCursesCheckERR(X(), # X); }
122 #define NoArgOrFlagNoReturnFunction(X) \
123 static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
126 PyCursesInitialised \
127 switch(PyTuple_Size(args)) { \
129 return PyCursesCheckERR(X(), # X); \
131 if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL; \
132 if (flag) return PyCursesCheckERR(X(), # X); \
133 else return PyCursesCheckERR(no ## X (), # X); \
135 PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \
138 #define NoArgReturnIntFunction(X) \
139 static PyObject *PyCurses_ ## X (PyObject *self) \
141 PyCursesInitialised \
142 return PyInt_FromLong((long) X()); }
145 #define NoArgReturnStringFunction(X) \
146 static PyObject *PyCurses_ ## X (PyObject *self) \
148 PyCursesInitialised \
149 return PyString_FromString(X()); }
151 #define NoArgTrueFalseFunction(X) \
152 static PyObject *PyCurses_ ## X (PyObject *self) \
154 PyCursesInitialised \
155 if (X () == FALSE) { \
156 Py_INCREF(Py_False); \
159 Py_INCREF(Py_True); \
162 #define NoArgNoReturnVoidFunction(X) \
163 static PyObject *PyCurses_ ## X (PyObject *self) \
165 PyCursesInitialised \
167 Py_INCREF(Py_None); \
Copyright 2014 Google Inc. All rights reserved.