Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ad9b1f85
Kaydet (Commit)
ad9b1f85
authored
Tem 09, 2000
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch from Peter Schneider-Kamp: convert curses module to ANSI prototypes,
and substitute the conventional "args" instead of "arg".
üst
bd03bfce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
221 additions
and
377 deletions
+221
-377
_cursesmodule.c
Modules/_cursesmodule.c
+221
-377
No files found.
Modules/_cursesmodule.c
Dosyayı görüntüle @
ad9b1f85
...
@@ -95,9 +95,7 @@ static int initialisedcolors = FALSE;
...
@@ -95,9 +95,7 @@ static int initialisedcolors = FALSE;
*/
*/
static
PyObject
*
static
PyObject
*
PyCursesCheckERR
(
code
,
fname
)
PyCursesCheckERR
(
int
code
,
char
*
fname
)
int
code
;
char
*
fname
;
{
{
if
(
code
!=
ERR
)
{
if
(
code
!=
ERR
)
{
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
...
@@ -113,9 +111,7 @@ PyCursesCheckERR(code, fname)
...
@@ -113,9 +111,7 @@ PyCursesCheckERR(code, fname)
}
}
static
int
static
int
PyCurses_ConvertToChtype
(
obj
,
ch
)
PyCurses_ConvertToChtype
(
PyObject
*
obj
,
chtype
*
ch
)
PyObject
*
obj
;
chtype
*
ch
;
{
{
if
(
PyInt_Check
(
obj
))
{
if
(
PyInt_Check
(
obj
))
{
*
ch
=
(
chtype
)
PyInt_AsLong
(
obj
);
*
ch
=
(
chtype
)
PyInt_AsLong
(
obj
);
...
@@ -152,61 +148,49 @@ PyTypeObject PyCursesWindow_Type;
...
@@ -152,61 +148,49 @@ PyTypeObject PyCursesWindow_Type;
*/
*/
#define Window_NoArgNoReturnFunction(X) \
#define Window_NoArgNoReturnFunction(X) \
static PyObject *PyCursesWindow_ ## X (self, arg) \
static PyObject *PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject * self; PyObject * arg; \
{ if (!PyArg_NoArgs(args)) return NULL; \
{ if (!PyArg_NoArgs(arg)) return NULL; \
return PyCursesCheckERR(X(self->win), # X); }
return PyCursesCheckERR(X(self->win), # X); }
#define Window_NoArgTrueFalseFunction(X) \
#define Window_NoArgTrueFalseFunction(X) \
static PyObject * PyCursesWindow_ ## X (self,arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject * self; PyObject * arg; \
{ \
{ \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
else { Py_INCREF(Py_True); return Py_True; } }
else { Py_INCREF(Py_True); return Py_True; } }
#define Window_NoArgNoReturnVoidFunction(X) \
#define Window_NoArgNoReturnVoidFunction(X) \
static PyObject * PyCursesWindow_ ## X (self,arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject * self; \
PyObject * arg; \
{ \
{ \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
X(self->win); Py_INCREF(Py_None); return Py_None; }
X(self->win); Py_INCREF(Py_None); return Py_None; }
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
static PyObject * PyCursesWindow_ ## X (self, arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject *self; \
PyObject * arg; \
{ \
{ \
TYPE arg1, arg2; \
TYPE arg1, arg2; \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }
X(self->win,arg1,arg2); return Py_BuildValue(ERGSTR, arg1, arg2); }
#define Window_OneArgNoReturnVoidFunction(X, TYPE, PARSESTR) \
#define Window_OneArgNoReturnVoidFunction(X, TYPE, PARSESTR) \
static PyObject * PyCursesWindow_ ## X (self, arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject *self; \
PyObject * arg; \
{ \
{ \
TYPE arg1; \
TYPE arg1; \
if (!PyArg_Parse(arg, PARSESTR, &arg1)) return NULL; \
if (!PyArg_Parse(arg
s
, PARSESTR, &arg1)) return NULL; \
X(self->win,arg1); Py_INCREF(Py_None); return Py_None; }
X(self->win,arg1); Py_INCREF(Py_None); return Py_None; }
#define Window_OneArgNoReturnFunction(X, TYPE, PARSESTR) \
#define Window_OneArgNoReturnFunction(X, TYPE, PARSESTR) \
static PyObject * PyCursesWindow_ ## X (self, arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject *self; \
PyObject * arg; \
{ \
{ \
TYPE arg1; \
TYPE arg1; \
if (!PyArg_Parse(arg,PARSESTR, &arg1)) return NULL; \
if (!PyArg_Parse(arg
s
,PARSESTR, &arg1)) return NULL; \
return PyCursesCheckERR(X(self->win, arg1), # X); }
return PyCursesCheckERR(X(self->win, arg1), # X); }
#define Window_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \
#define Window_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \
static PyObject * PyCursesWindow_ ## X (self, arg) \
static PyObject * PyCursesWindow_ ## X (PyCursesWindowObject *self, PyObject *args) \
PyCursesWindowObject *self; \
PyObject * arg; \
{ \
{ \
TYPE arg1, arg2; \
TYPE arg1, arg2; \
if (!PyArg_Parse(arg,PARSESTR, &arg1, &arg2)) return NULL; \
if (!PyArg_Parse(arg
s
,PARSESTR, &arg1, &arg2)) return NULL; \
return PyCursesCheckERR(X(self->win, arg1, arg2), # X); }
return PyCursesCheckERR(X(self->win, arg1, arg2), # X); }
/* ------------- WINDOW routines --------------- */
/* ------------- WINDOW routines --------------- */
...
@@ -261,8 +245,7 @@ Window_TwoArgNoReturnFunction(wresize, int, "(ii);lines,columns")
...
@@ -261,8 +245,7 @@ Window_TwoArgNoReturnFunction(wresize, int, "(ii);lines,columns")
/* Allocation and deallocation of Window Objects */
/* Allocation and deallocation of Window Objects */
static
PyObject
*
static
PyObject
*
PyCursesWindow_New
(
win
)
PyCursesWindow_New
(
WINDOW
*
win
)
WINDOW
*
win
;
{
{
PyCursesWindowObject
*
wo
;
PyCursesWindowObject
*
wo
;
...
@@ -273,8 +256,7 @@ PyCursesWindow_New(win)
...
@@ -273,8 +256,7 @@ PyCursesWindow_New(win)
}
}
static
void
static
void
PyCursesWindow_Dealloc
(
wo
)
PyCursesWindow_Dealloc
(
PyCursesWindowObject
*
wo
)
PyCursesWindowObject
*
wo
;
{
{
if
(
wo
->
win
!=
stdscr
)
delwin
(
wo
->
win
);
if
(
wo
->
win
!=
stdscr
)
delwin
(
wo
->
win
);
PyMem_DEL
(
wo
);
PyMem_DEL
(
wo
);
...
@@ -283,31 +265,29 @@ PyCursesWindow_Dealloc(wo)
...
@@ -283,31 +265,29 @@ PyCursesWindow_Dealloc(wo)
/* Addch, Addstr, Addnstr */
/* Addch, Addstr, Addnstr */
static
PyObject
*
static
PyObject
*
PyCursesWindow_AddCh
(
self
,
arg
)
PyCursesWindow_AddCh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
,
x
,
y
,
use_xy
=
FALSE
;
int
rtn
,
x
,
y
,
use_xy
=
FALSE
;
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
=
0
;
chtype
ch
=
0
;
attr_t
attr
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iiO);y,x,ch or int"
,
&
y
,
&
x
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iiO);y,x,ch or int"
,
&
y
,
&
x
,
&
temp
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iiOl);y,x,ch or int, attr"
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiOl);y,x,ch or int, attr"
,
&
y
,
&
x
,
&
temp
,
&
attr
))
&
y
,
&
x
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
...
@@ -331,9 +311,7 @@ PyCursesWindow_AddCh(self,arg)
...
@@ -331,9 +311,7 @@ PyCursesWindow_AddCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_AddStr
(
self
,
arg
)
PyCursesWindow_AddStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
;
int
rtn
;
int
x
,
y
;
int
x
,
y
;
...
@@ -341,23 +319,23 @@ PyCursesWindow_AddStr(self,arg)
...
@@ -341,23 +319,23 @@ PyCursesWindow_AddStr(self,arg)
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"s;str"
,
&
str
))
if
(
!
PyArg_Parse
(
arg
s
,
"s;str"
,
&
str
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(sl);str,attr"
,
&
str
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(sl);str,attr"
,
&
str
,
&
attr
))
return
NULL
;
return
NULL
;
use_attr
=
TRUE
;
use_attr
=
TRUE
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iis);int,int,str"
,
&
y
,
&
x
,
&
str
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iis);int,int,str"
,
&
y
,
&
x
,
&
str
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iisl);int,int,str,attr"
,
&
y
,
&
x
,
&
str
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisl);int,int,str,attr"
,
&
y
,
&
x
,
&
str
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
use_attr
=
TRUE
;
use_xy
=
use_attr
=
TRUE
;
break
;
break
;
...
@@ -380,32 +358,30 @@ PyCursesWindow_AddStr(self,arg)
...
@@ -380,32 +358,30 @@ PyCursesWindow_AddStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_AddNStr
(
self
,
arg
)
PyCursesWindow_AddNStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
,
x
,
y
,
n
;
int
rtn
,
x
,
y
,
n
;
char
*
str
;
char
*
str
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(si);str,n"
,
&
str
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(si);str,n"
,
&
str
,
&
n
))
return
NULL
;
return
NULL
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(sil);str,n,attr"
,
&
str
,
&
n
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(sil);str,n,attr"
,
&
str
,
&
n
,
&
attr
))
return
NULL
;
return
NULL
;
use_attr
=
TRUE
;
use_attr
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iisi);y,x,str,n"
,
&
y
,
&
x
,
&
str
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisi);y,x,str,n"
,
&
y
,
&
x
,
&
str
,
&
n
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
5
:
case
5
:
if
(
!
PyArg_Parse
(
arg
,
"(iisil);y,x,str,n,attr"
,
&
y
,
&
x
,
&
str
,
&
n
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisil);y,x,str,n,attr"
,
&
y
,
&
x
,
&
str
,
&
n
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
use_attr
=
TRUE
;
use_xy
=
use_attr
=
TRUE
;
break
;
break
;
...
@@ -428,21 +404,19 @@ PyCursesWindow_AddNStr(self,arg)
...
@@ -428,21 +404,19 @@ PyCursesWindow_AddNStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Bkgd
(
self
,
arg
)
PyCursesWindow_Bkgd
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
bkgd
;
chtype
bkgd
;
attr_t
attr
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
break
;
break
;
default
:
default
:
...
@@ -459,21 +433,19 @@ PyCursesWindow_Bkgd(self,arg)
...
@@ -459,21 +433,19 @@ PyCursesWindow_Bkgd(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_BkgdSet
(
self
,
arg
)
PyCursesWindow_BkgdSet
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
bkgd
;
chtype
bkgd
;
attr_t
attr
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
break
;
break
;
default
:
default
:
...
@@ -491,9 +463,7 @@ PyCursesWindow_BkgdSet(self,arg)
...
@@ -491,9 +463,7 @@ PyCursesWindow_BkgdSet(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Border
(
self
,
args
)
PyCursesWindow_Border
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
args
;
{
{
chtype
ls
,
rs
,
ts
,
bs
,
tl
,
tr
,
bl
,
br
;
chtype
ls
,
rs
,
ts
,
bs
,
tl
,
tr
,
bl
,
br
;
ls
=
rs
=
ts
=
bs
=
tl
=
tr
=
bl
=
br
=
0
;
ls
=
rs
=
ts
=
bs
=
tl
=
tr
=
bl
=
br
=
0
;
...
@@ -506,14 +476,12 @@ PyCursesWindow_Border(self, args)
...
@@ -506,14 +476,12 @@ PyCursesWindow_Border(self, args)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Box
(
self
,
arg
)
PyCursesWindow_Box
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
chtype
ch1
=
0
,
ch2
=
0
;
chtype
ch1
=
0
,
ch2
=
0
;
if
(
!
PyArg_NoArgs
(
arg
))
{
if
(
!
PyArg_NoArgs
(
arg
s
))
{
PyErr_Clear
();
PyErr_Clear
();
if
(
!
PyArg_Parse
(
arg
,
"(ll);vertint,horint"
,
&
ch1
,
&
ch2
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ll);vertint,horint"
,
&
ch1
,
&
ch2
))
return
NULL
;
return
NULL
;
}
}
box
(
self
->
win
,
ch1
,
ch2
);
box
(
self
->
win
,
ch1
,
ch2
);
...
@@ -522,19 +490,17 @@ PyCursesWindow_Box(self,arg)
...
@@ -522,19 +490,17 @@ PyCursesWindow_Box(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_DelCh
(
self
,
arg
)
PyCursesWindow_DelCh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
;
int
rtn
;
int
x
,
y
;
int
x
,
y
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
rtn
=
wdelch
(
self
->
win
);
rtn
=
wdelch
(
self
->
win
);
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
rtn
=
mvwdelch
(
self
->
win
,
y
,
x
);
rtn
=
mvwdelch
(
self
->
win
,
y
,
x
);
break
;
break
;
...
@@ -546,22 +512,20 @@ PyCursesWindow_DelCh(self,arg)
...
@@ -546,22 +512,20 @@ PyCursesWindow_DelCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_DerWin
(
self
,
arg
)
PyCursesWindow_DerWin
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
nlines
=
0
;
nlines
=
0
;
ncols
=
0
;
ncols
=
0
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);begin_y,begin_x"
,
&
begin_y
,
&
begin_x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);begin_y,begin_x"
,
&
begin_y
,
&
begin_x
))
return
NULL
;
return
NULL
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
return
NULL
;
return
NULL
;
break
;
break
;
...
@@ -581,21 +545,19 @@ PyCursesWindow_DerWin(self,arg)
...
@@ -581,21 +545,19 @@ PyCursesWindow_DerWin(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_EchoChar
(
self
,
arg
)
PyCursesWindow_EchoChar
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
;
chtype
ch
;
attr_t
attr
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
break
;
break
;
default
:
default
:
...
@@ -620,12 +582,10 @@ PyCursesWindow_EchoChar(self,arg)
...
@@ -620,12 +582,10 @@ PyCursesWindow_EchoChar(self,arg)
#ifdef NCURSES_MOUSE_VERSION
#ifdef NCURSES_MOUSE_VERSION
static
PyObject
*
static
PyObject
*
PyCursesWindow_Enclose
(
self
,
arg
)
PyCursesWindow_Enclose
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
;
int
x
,
y
;
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
return
PyInt_FromLong
(
wenclose
(
self
->
win
,
y
,
x
)
);
return
PyInt_FromLong
(
wenclose
(
self
->
win
,
y
,
x
)
);
...
@@ -633,31 +593,27 @@ PyCursesWindow_Enclose(self,arg)
...
@@ -633,31 +593,27 @@ PyCursesWindow_Enclose(self,arg)
#endif
#endif
static
PyObject
*
static
PyObject
*
PyCursesWindow_GetBkgd
(
self
,
arg
)
PyCursesWindow_GetBkgd
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
if
(
!
PyArg_NoArgs
(
arg
))
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
return
NULL
;
return
PyInt_FromLong
((
long
)
getbkgd
(
self
->
win
));
return
PyInt_FromLong
((
long
)
getbkgd
(
self
->
win
));
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_GetCh
(
self
,
arg
)
PyCursesWindow_GetCh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
;
int
x
,
y
;
chtype
rtn
;
chtype
rtn
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn
=
wgetch
(
self
->
win
);
rtn
=
wgetch
(
self
->
win
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn
=
mvwgetch
(
self
->
win
,
y
,
x
);
rtn
=
mvwgetch
(
self
->
win
,
y
,
x
);
...
@@ -671,21 +627,19 @@ PyCursesWindow_GetCh(self,arg)
...
@@ -671,21 +627,19 @@ PyCursesWindow_GetCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_GetKey
(
self
,
arg
)
PyCursesWindow_GetKey
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
;
int
x
,
y
;
chtype
rtn
;
chtype
rtn
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn
=
wgetch
(
self
->
win
);
rtn
=
wgetch
(
self
->
win
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn
=
mvwgetch
(
self
->
win
,
y
,
x
);
rtn
=
mvwgetch
(
self
->
win
,
y
,
x
);
...
@@ -702,36 +656,34 @@ PyCursesWindow_GetKey(self,arg)
...
@@ -702,36 +656,34 @@ PyCursesWindow_GetKey(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_GetStr
(
self
,
arg
)
PyCursesWindow_GetStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
,
n
;
int
x
,
y
,
n
;
char
rtn
[
1024
];
/* This should be big enough.. I hope */
char
rtn
[
1024
];
/* This should be big enough.. I hope */
int
rtn2
;
int
rtn2
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn2
=
wgetstr
(
self
->
win
,
rtn
);
rtn2
=
wgetstr
(
self
->
win
,
rtn
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
break
;
break
;
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;n"
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;n"
,
&
n
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn2
=
wgetnstr
(
self
->
win
,
rtn
,
n
);
rtn2
=
wgetnstr
(
self
->
win
,
rtn
,
n
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn2
=
mvwgetstr
(
self
->
win
,
y
,
x
,
rtn
);
rtn2
=
mvwgetstr
(
self
->
win
,
y
,
x
,
rtn
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iii);y,x,n"
,
&
y
,
&
x
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iii);y,x,n"
,
&
y
,
&
x
,
&
n
))
return
NULL
;
return
NULL
;
#ifdef STRICT_SYSV_CURSES
#ifdef STRICT_SYSV_CURSES
/* Untested */
/* Untested */
...
@@ -755,9 +707,7 @@ PyCursesWindow_GetStr(self,arg)
...
@@ -755,9 +707,7 @@ PyCursesWindow_GetStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Hline
(
self
,
args
)
PyCursesWindow_Hline
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
args
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
;
chtype
ch
;
...
@@ -800,31 +750,29 @@ PyCursesWindow_Hline(self, args)
...
@@ -800,31 +750,29 @@ PyCursesWindow_Hline(self, args)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_InsCh
(
self
,
arg
)
PyCursesWindow_InsCh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
,
x
,
y
,
use_xy
=
FALSE
;
int
rtn
,
x
,
y
,
use_xy
=
FALSE
;
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
=
0
;
chtype
ch
=
0
;
attr_t
attr
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(Ol);ch or int,attr"
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iiO);y,x,ch or int"
,
&
y
,
&
x
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iiO);y,x,ch or int"
,
&
y
,
&
x
,
&
temp
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iiOl);y,x,ch or int, attr"
,
&
y
,
&
x
,
&
temp
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iiOl);y,x,ch or int, attr"
,
&
y
,
&
x
,
&
temp
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
...
@@ -848,18 +796,16 @@ PyCursesWindow_InsCh(self,arg)
...
@@ -848,18 +796,16 @@ PyCursesWindow_InsCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_InCh
(
self
,
arg
)
PyCursesWindow_InCh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
,
rtn
;
int
x
,
y
,
rtn
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
rtn
=
winch
(
self
->
win
);
rtn
=
winch
(
self
->
win
);
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
rtn
=
mvwinch
(
self
->
win
,
y
,
x
);
rtn
=
mvwinch
(
self
->
win
,
y
,
x
);
break
;
break
;
...
@@ -871,30 +817,28 @@ PyCursesWindow_InCh(self,arg)
...
@@ -871,30 +817,28 @@ PyCursesWindow_InCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_InStr
(
self
,
arg
)
PyCursesWindow_InStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
,
n
;
int
x
,
y
,
n
;
char
rtn
[
1024
];
/* This should be big enough.. I hope */
char
rtn
[
1024
];
/* This should be big enough.. I hope */
int
rtn2
;
int
rtn2
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
rtn2
=
winstr
(
self
->
win
,
rtn
);
rtn2
=
winstr
(
self
->
win
,
rtn
);
break
;
break
;
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;n"
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;n"
,
&
n
))
return
NULL
;
return
NULL
;
rtn2
=
winnstr
(
self
->
win
,
rtn
,
n
);
rtn2
=
winnstr
(
self
->
win
,
rtn
,
n
);
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);y,x"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y,x"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
rtn2
=
mvwinstr
(
self
->
win
,
y
,
x
,
rtn
);
rtn2
=
mvwinstr
(
self
->
win
,
y
,
x
,
rtn
);
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iii);y,x,n"
,
&
y
,
&
x
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iii);y,x,n"
,
&
y
,
&
x
,
&
n
))
return
NULL
;
return
NULL
;
rtn2
=
mvwinnstr
(
self
->
win
,
y
,
x
,
rtn
,
n
);
rtn2
=
mvwinnstr
(
self
->
win
,
y
,
x
,
rtn
,
n
);
break
;
break
;
...
@@ -908,9 +852,7 @@ PyCursesWindow_InStr(self,arg)
...
@@ -908,9 +852,7 @@ PyCursesWindow_InStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_InsStr
(
self
,
arg
)
PyCursesWindow_InsStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
;
int
rtn
;
int
x
,
y
;
int
x
,
y
;
...
@@ -918,23 +860,23 @@ PyCursesWindow_InsStr(self,arg)
...
@@ -918,23 +860,23 @@ PyCursesWindow_InsStr(self,arg)
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"s;str"
,
&
str
))
if
(
!
PyArg_Parse
(
arg
s
,
"s;str"
,
&
str
))
return
NULL
;
return
NULL
;
break
;
break
;
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(sl);str,attr"
,
&
str
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(sl);str,attr"
,
&
str
,
&
attr
))
return
NULL
;
return
NULL
;
use_attr
=
TRUE
;
use_attr
=
TRUE
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iis);y,x,str"
,
&
y
,
&
x
,
&
str
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iis);y,x,str"
,
&
y
,
&
x
,
&
str
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iisl);y,x,str,attr"
,
&
y
,
&
x
,
&
str
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisl);y,x,str,attr"
,
&
y
,
&
x
,
&
str
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
use_attr
=
TRUE
;
use_xy
=
use_attr
=
TRUE
;
break
;
break
;
...
@@ -957,32 +899,30 @@ PyCursesWindow_InsStr(self,arg)
...
@@ -957,32 +899,30 @@ PyCursesWindow_InsStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_InsNStr
(
self
,
arg
)
PyCursesWindow_InsNStr
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
,
x
,
y
,
n
;
int
rtn
,
x
,
y
,
n
;
char
*
str
;
char
*
str
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
attr_t
attr
=
A_NORMAL
,
attr_old
=
A_NORMAL
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
int
use_xy
=
FALSE
,
use_attr
=
FALSE
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(si);str,n"
,
&
str
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(si);str,n"
,
&
str
,
&
n
))
return
NULL
;
return
NULL
;
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(sil);str,n,attr"
,
&
str
,
&
n
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(sil);str,n,attr"
,
&
str
,
&
n
,
&
attr
))
return
NULL
;
return
NULL
;
use_attr
=
TRUE
;
use_attr
=
TRUE
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iisi);y,x,str,n"
,
&
y
,
&
x
,
&
str
,
&
n
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisi);y,x,str,n"
,
&
y
,
&
x
,
&
str
,
&
n
))
return
NULL
;
return
NULL
;
use_xy
=
TRUE
;
use_xy
=
TRUE
;
break
;
break
;
case
5
:
case
5
:
if
(
!
PyArg_Parse
(
arg
,
"(iisil);y,x,str,n,attr"
,
&
y
,
&
x
,
&
str
,
&
n
,
&
attr
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iisil);y,x,str,n,attr"
,
&
y
,
&
x
,
&
str
,
&
n
,
&
attr
))
return
NULL
;
return
NULL
;
use_xy
=
use_attr
=
TRUE
;
use_xy
=
use_attr
=
TRUE
;
break
;
break
;
...
@@ -1005,12 +945,10 @@ PyCursesWindow_InsNStr(self,arg)
...
@@ -1005,12 +945,10 @@ PyCursesWindow_InsNStr(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Is_LineTouched
(
self
,
arg
)
PyCursesWindow_Is_LineTouched
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
line
,
erg
;
int
line
,
erg
;
if
(
!
PyArg_Parse
(
arg
,
"i;line"
,
&
line
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;line"
,
&
line
))
return
NULL
;
return
NULL
;
erg
=
is_linetouched
(
self
->
win
,
line
);
erg
=
is_linetouched
(
self
->
win
,
line
);
if
(
erg
==
ERR
)
{
if
(
erg
==
ERR
)
{
...
@@ -1028,17 +966,15 @@ PyCursesWindow_Is_LineTouched(self,arg)
...
@@ -1028,17 +966,15 @@ PyCursesWindow_Is_LineTouched(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_NoOutRefresh
(
self
,
arg
)
PyCursesWindow_NoOutRefresh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
pminrow
,
pmincol
,
sminrow
,
smincol
,
smaxrow
,
smaxcol
;
int
pminrow
,
pmincol
,
sminrow
,
smincol
,
smaxrow
,
smaxcol
;
int
rtn
;
int
rtn
;
if
(
self
->
win
->
_flags
&
_ISPAD
)
{
if
(
self
->
win
->
_flags
&
_ISPAD
)
{
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
6
:
case
6
:
if
(
!
PyArg_Parse
(
arg
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiiiii);"
\
"(iiiiii);"
\
"pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol"
,
"pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol"
,
&
pminrow
,
&
pmincol
,
&
sminrow
,
&
pminrow
,
&
pmincol
,
&
sminrow
,
...
@@ -1057,7 +993,7 @@ PyCursesWindow_NoOutRefresh(self,arg)
...
@@ -1057,7 +993,7 @@ PyCursesWindow_NoOutRefresh(self,arg)
return
NULL
;
return
NULL
;
}
}
}
else
{
}
else
{
if
(
!
PyArg_NoArgs
(
arg
))
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
...
@@ -1068,13 +1004,11 @@ PyCursesWindow_NoOutRefresh(self,arg)
...
@@ -1068,13 +1004,11 @@ PyCursesWindow_NoOutRefresh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_PutWin
(
self
,
arg
)
PyCursesWindow_PutWin
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
if
(
!
PyArg_Parse
(
arg
,
"O;fileobj"
,
&
temp
))
if
(
!
PyArg_Parse
(
arg
s
,
"O;fileobj"
,
&
temp
))
return
NULL
;
return
NULL
;
if
(
!
PyFile_Check
(
temp
))
{
if
(
!
PyFile_Check
(
temp
))
{
PyErr_SetString
(
PyExc_TypeError
,
"argument must be a file object"
);
PyErr_SetString
(
PyExc_TypeError
,
"argument must be a file object"
);
...
@@ -1085,28 +1019,24 @@ PyCursesWindow_PutWin(self, arg)
...
@@ -1085,28 +1019,24 @@ PyCursesWindow_PutWin(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_RedrawLine
(
self
,
arg
)
PyCursesWindow_RedrawLine
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
beg
,
num
;
int
beg
,
num
;
if
(
!
PyArg_Parse
(
arg
,
"(ii);beg,num"
,
&
beg
,
&
num
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);beg,num"
,
&
beg
,
&
num
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
wredrawln
(
self
->
win
,
beg
,
num
),
"redrawln"
);
return
PyCursesCheckERR
(
wredrawln
(
self
->
win
,
beg
,
num
),
"redrawln"
);
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Refresh
(
self
,
arg
)
PyCursesWindow_Refresh
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
pminrow
,
pmincol
,
sminrow
,
smincol
,
smaxrow
,
smaxcol
;
int
pminrow
,
pmincol
,
sminrow
,
smincol
,
smaxrow
,
smaxcol
;
int
rtn
;
int
rtn
;
if
(
self
->
win
->
_flags
&
_ISPAD
)
{
if
(
self
->
win
->
_flags
&
_ISPAD
)
{
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
6
:
case
6
:
if
(
!
PyArg_Parse
(
arg
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiiiii);"
\
"(iiiiii);"
\
"pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol"
,
"pminrow,pmincol,sminrow,smincol,smaxrow,smaxcol"
,
&
pminrow
,
&
pmincol
,
&
sminrow
,
&
pminrow
,
&
pmincol
,
&
sminrow
,
...
@@ -1125,43 +1055,39 @@ PyCursesWindow_Refresh(self,arg)
...
@@ -1125,43 +1055,39 @@ PyCursesWindow_Refresh(self,arg)
return
NULL
;
return
NULL
;
}
}
}
else
{
}
else
{
if
(
!
PyArg_NoArgs
(
arg
))
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
return
NULL
;
Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS
rtn
=
wrefresh
(
self
->
win
);
rtn
=
wrefresh
(
self
->
win
);
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS
return
PyCursesCheckERR
(
rtn
);
return
PyCursesCheckERR
(
rtn
,
"prefresh"
);
}
}
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_SetScrollRegion
(
self
,
arg
)
PyCursesWindow_SetScrollRegion
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
;
int
x
,
y
;
if
(
!
PyArg_Parse
(
arg
,
"(ii);top, bottom"
,
&
y
,
&
x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);top, bottom"
,
&
y
,
&
x
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
wsetscrreg
(
self
->
win
,
y
,
x
),
"wsetscrreg"
);
return
PyCursesCheckERR
(
wsetscrreg
(
self
->
win
,
y
,
x
),
"wsetscrreg"
);
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_SubWin
(
self
,
arg
)
PyCursesWindow_SubWin
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
nlines
=
0
;
nlines
=
0
;
ncols
=
0
;
ncols
=
0
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);begin_y,begin_x"
,
&
begin_y
,
&
begin_x
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);begin_y,begin_x"
,
&
begin_y
,
&
begin_x
))
return
NULL
;
return
NULL
;
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
return
NULL
;
return
NULL
;
break
;
break
;
...
@@ -1185,17 +1111,15 @@ PyCursesWindow_SubWin(self,arg)
...
@@ -1185,17 +1111,15 @@ PyCursesWindow_SubWin(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Scroll
(
self
,
arg
)
PyCursesWindow_Scroll
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
lines
;
int
lines
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
return
PyCursesCheckERR
(
scroll
(
self
->
win
),
"scroll"
);
return
PyCursesCheckERR
(
scroll
(
self
->
win
),
"scroll"
);
break
;
break
;
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;lines"
,
&
lines
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;lines"
,
&
lines
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
wscrl
(
self
->
win
,
lines
),
"scroll"
);
return
PyCursesCheckERR
(
wscrl
(
self
->
win
,
lines
),
"scroll"
);
default
:
default
:
...
@@ -1205,19 +1129,17 @@ PyCursesWindow_Scroll(self,arg)
...
@@ -1205,19 +1129,17 @@ PyCursesWindow_Scroll(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_TouchLine
(
self
,
arg
)
PyCursesWindow_TouchLine
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
int
st
,
cnt
,
val
;
int
st
,
cnt
,
val
;
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);start,count"
,
&
st
,
&
cnt
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);start,count"
,
&
st
,
&
cnt
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
touchline
(
self
->
win
,
st
,
cnt
),
"touchline"
);
return
PyCursesCheckERR
(
touchline
(
self
->
win
,
st
,
cnt
),
"touchline"
);
break
;
break
;
case
3
:
case
3
:
if
(
!
PyArg_Parse
(
arg
,
"(iii);start,count,val"
,
&
st
,
&
cnt
,
&
val
))
if
(
!
PyArg_Parse
(
arg
s
,
"(iii);start,count,val"
,
&
st
,
&
cnt
,
&
val
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
wtouchln
(
self
->
win
,
st
,
cnt
,
val
),
"touchline"
);
return
PyCursesCheckERR
(
wtouchln
(
self
->
win
,
st
,
cnt
,
val
),
"touchline"
);
default
:
default
:
...
@@ -1227,9 +1149,7 @@ PyCursesWindow_TouchLine(self,arg)
...
@@ -1227,9 +1149,7 @@ PyCursesWindow_TouchLine(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCursesWindow_Vline
(
self
,
args
)
PyCursesWindow_Vline
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
args
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
;
chtype
ch
;
...
@@ -1393,26 +1313,22 @@ static PyObject *ModDict;
...
@@ -1393,26 +1313,22 @@ static PyObject *ModDict;
*/
*/
#define NoArgNoReturnFunction(X) \
#define NoArgNoReturnFunction(X) \
static PyObject *PyCurses_ ## X (self, arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
PyCursesInitialised \
PyCursesInitialised \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
return PyCursesCheckERR(X(), # X); }
return PyCursesCheckERR(X(), # X); }
#define NoArgOrFlagNoReturnFunction(X) \
#define NoArgOrFlagNoReturnFunction(X) \
static PyObject *PyCurses_ ## X (self, arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
int flag = 0; \
int flag = 0; \
PyCursesInitialised \
PyCursesInitialised \
switch(ARG_COUNT(arg)) { \
switch(ARG_COUNT(arg
s
)) { \
case 0: \
case 0: \
return PyCursesCheckERR(X(), # X); \
return PyCursesCheckERR(X(), # X); \
case 1: \
case 1: \
if (!PyArg_Parse(arg, "i;True(1) or False(0)", &flag)) return NULL; \
if (!PyArg_Parse(arg
s
, "i;True(1) or False(0)", &flag)) return NULL; \
if (flag) return PyCursesCheckERR(X(), # X); \
if (flag) return PyCursesCheckERR(X(), # X); \
else return PyCursesCheckERR(no ## X (), # X); \
else return PyCursesCheckERR(no ## X (), # X); \
default: \
default: \
...
@@ -1420,31 +1336,25 @@ static PyObject *PyCurses_ ## X (self, arg) \
...
@@ -1420,31 +1336,25 @@ static PyObject *PyCurses_ ## X (self, arg) \
return NULL; } }
return NULL; } }
#define NoArgReturnIntFunction(X) \
#define NoArgReturnIntFunction(X) \
static PyObject *PyCurses_ ## X (self, arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
PyCursesInitialised \
PyCursesInitialised \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
return PyInt_FromLong((long) X()); }
return PyInt_FromLong((long) X()); }
#define NoArgReturnStringFunction(X) \
#define NoArgReturnStringFunction(X) \
static PyObject *PyCurses_ ## X (self, arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
PyCursesInitialised \
PyCursesInitialised \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
return PyString_FromString(X()); }
return PyString_FromString(X()); }
#define NoArgTrueFalseFunction(X) \
#define NoArgTrueFalseFunction(X) \
static PyObject * PyCurses_ ## X (self,arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
PyCursesInitialised \
PyCursesInitialised \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
if (X () == FALSE) { \
if (X () == FALSE) { \
Py_INCREF(Py_False); \
Py_INCREF(Py_False); \
return Py_False; \
return Py_False; \
...
@@ -1453,12 +1363,10 @@ static PyObject * PyCurses_ ## X (self,arg) \
...
@@ -1453,12 +1363,10 @@ static PyObject * PyCurses_ ## X (self,arg) \
return Py_True; }
return Py_True; }
#define NoArgNoReturnVoidFunction(X) \
#define NoArgNoReturnVoidFunction(X) \
static PyObject * PyCurses_ ## X (self,arg) \
static PyObject *PyCurses_ ## X (PyObject *self, PyObject *args) \
PyObject * self; \
PyObject * arg; \
{ \
{ \
PyCursesInitialised \
PyCursesInitialised \
if (!PyArg_NoArgs(arg)) return NULL; \
if (!PyArg_NoArgs(arg
s
)) return NULL; \
X(); \
X(); \
Py_INCREF(Py_None); \
Py_INCREF(Py_None); \
return Py_None; }
return Py_None; }
...
@@ -1499,22 +1407,20 @@ NoArgNoReturnVoidFunction(flushinp)
...
@@ -1499,22 +1407,20 @@ NoArgNoReturnVoidFunction(flushinp)
NoArgNoReturnVoidFunction
(
noqiflush
)
NoArgNoReturnVoidFunction
(
noqiflush
)
static
PyObject
*
static
PyObject
*
PyCurses_Color_Content
(
self
,
arg
)
PyCurses_Color_Content
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
short
color
,
r
,
g
,
b
;
short
color
,
r
,
g
,
b
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
if
(
ARG_COUNT
(
arg
)
!=
1
)
{
if
(
ARG_COUNT
(
arg
s
)
!=
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_SetString
(
PyExc_TypeError
,
"color_content requires 1 argument"
);
"color_content requires 1 argument"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"h;color"
,
&
color
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"h;color"
,
&
color
))
return
NULL
;
if
(
color_content
(
color
,
&
r
,
&
g
,
&
b
)
!=
ERR
)
if
(
color_content
(
color
,
&
r
,
&
g
,
&
b
)
!=
ERR
)
return
Py_BuildValue
(
"(iii)"
,
r
,
g
,
b
);
return
Py_BuildValue
(
"(iii)"
,
r
,
g
,
b
);
...
@@ -1526,38 +1432,34 @@ PyCurses_Color_Content(self, arg)
...
@@ -1526,38 +1432,34 @@ PyCurses_Color_Content(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_color_pair
(
self
,
arg
)
PyCurses_color_pair
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
n
;
int
n
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
if
(
ARG_COUNT
(
arg
)
!=
1
)
{
if
(
ARG_COUNT
(
arg
s
)
!=
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"color_pair requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"color_pair requires 1 argument"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"i;number"
,
&
n
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;number"
,
&
n
))
return
NULL
;
return
PyInt_FromLong
((
long
)
(
n
<<
8
));
return
PyInt_FromLong
((
long
)
(
n
<<
8
));
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Curs_Set
(
self
,
arg
)
PyCurses_Curs_Set
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
vis
,
erg
;
int
vis
,
erg
;
PyCursesInitialised
PyCursesInitialised
if
(
ARG_COUNT
(
arg
)
==
1
)
{
if
(
ARG_COUNT
(
arg
s
)
==
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"curs_set requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"curs_set requires 1 argument"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"i;int"
,
&
vis
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;int"
,
&
vis
))
return
NULL
;
erg
=
curs_set
(
vis
);
erg
=
curs_set
(
vis
);
if
(
erg
==
ERR
)
return
PyCursesCheckERR
(
erg
,
"curs_set"
);
if
(
erg
==
ERR
)
return
PyCursesCheckERR
(
erg
,
"curs_set"
);
...
@@ -1566,33 +1468,29 @@ PyCurses_Curs_Set(self, arg)
...
@@ -1566,33 +1468,29 @@ PyCurses_Curs_Set(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Delay_Output
(
self
,
arg
)
PyCurses_Delay_Output
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
ms
;
int
ms
;
PyCursesInitialised
PyCursesInitialised
if
(
ARG_COUNT
(
arg
)
==
1
)
{
if
(
ARG_COUNT
(
arg
s
)
==
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"delay_output requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"delay_output requires 1 argument"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"i;ms"
,
&
ms
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;ms"
,
&
ms
))
return
NULL
;
return
PyCursesCheckERR
(
delay_output
(
ms
),
"delay_output"
);
return
PyCursesCheckERR
(
delay_output
(
ms
),
"delay_output"
);
}
}
static
PyObject
*
static
PyObject
*
PyCurses_EraseChar
(
self
,
arg
)
PyCurses_EraseChar
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
char
ch
;
char
ch
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_NoArgs
(
arg
))
return
NULL
;
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
ch
=
erasechar
();
ch
=
erasechar
();
...
@@ -1600,15 +1498,13 @@ PyCurses_EraseChar(self,arg)
...
@@ -1600,15 +1498,13 @@ PyCurses_EraseChar(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_getsyx
(
self
,
arg
)
PyCurses_getsyx
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
x
,
y
;
int
x
,
y
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_NoArgs
(
arg
))
return
NULL
;
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
getsyx
(
y
,
x
);
getsyx
(
y
,
x
);
...
@@ -1617,15 +1513,13 @@ PyCurses_getsyx(self, arg)
...
@@ -1617,15 +1513,13 @@ PyCurses_getsyx(self, arg)
#ifdef NCURSES_MOUSE_VERSION
#ifdef NCURSES_MOUSE_VERSION
static
PyObject
*
static
PyObject
*
PyCurses_GetMouse
(
self
,
arg
)
PyCurses_GetMouse
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
rtn
;
int
rtn
;
MEVENT
event
;
MEVENT
event
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_NoArgs
(
arg
))
return
NULL
;
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
rtn
=
getmouse
(
&
event
);
rtn
=
getmouse
(
&
event
);
if
(
rtn
==
ERR
)
{
if
(
rtn
==
ERR
)
{
...
@@ -1639,9 +1533,7 @@ PyCurses_GetMouse(self,arg)
...
@@ -1639,9 +1533,7 @@ PyCurses_GetMouse(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_UngetMouse
(
self
,
args
)
PyCurses_UngetMouse
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
args
;
{
{
MEVENT
event
;
MEVENT
event
;
...
@@ -1657,16 +1549,14 @@ PyCurses_UngetMouse(self,args)
...
@@ -1657,16 +1549,14 @@ PyCurses_UngetMouse(self,args)
#endif
#endif
static
PyObject
*
static
PyObject
*
PyCurses_GetWin
(
self
,
arg
)
PyCurses_GetWin
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
PyCursesWindowObject
*
self
;
PyObject
*
arg
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
PyObject
*
temp
;
PyObject
*
temp
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"O;fileobj"
,
&
temp
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"O;fileobj"
,
&
temp
))
return
NULL
;
if
(
!
PyFile_Check
(
temp
))
{
if
(
!
PyFile_Check
(
temp
))
{
PyErr_SetString
(
PyExc_TypeError
,
"argument must be a file object"
);
PyErr_SetString
(
PyExc_TypeError
,
"argument must be a file object"
);
...
@@ -1684,17 +1574,15 @@ PyCurses_GetWin(self,arg)
...
@@ -1684,17 +1574,15 @@ PyCurses_GetWin(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_HalfDelay
(
self
,
arg
)
PyCurses_HalfDelay
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
unsigned
char
tenths
;
unsigned
char
tenths
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"b;tenths"
,
&
tenths
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"b;tenths"
,
&
tenths
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
"halfdelay requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"halfdelay requires 1 argument"
);
...
@@ -1706,15 +1594,13 @@ PyCurses_HalfDelay(self,arg)
...
@@ -1706,15 +1594,13 @@ PyCurses_HalfDelay(self,arg)
#if !defined(__sgi__) && !defined(__sun__)
#if !defined(__sgi__) && !defined(__sun__)
/* No has_key! */
/* No has_key! */
static
PyObject
*
PyCurses_has_key
(
self
,
arg
)
static
PyObject
*
PyCurses_has_key
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
ch
;
int
ch
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"i"
,
&
ch
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i"
,
&
ch
))
return
NULL
;
if
(
has_key
(
ch
)
==
FALSE
)
{
if
(
has_key
(
ch
)
==
FALSE
)
{
Py_INCREF
(
Py_False
);
Py_INCREF
(
Py_False
);
...
@@ -1726,18 +1612,16 @@ static PyObject * PyCurses_has_key(self,arg)
...
@@ -1726,18 +1612,16 @@ static PyObject * PyCurses_has_key(self,arg)
#endif
#endif
static
PyObject
*
static
PyObject
*
PyCurses_Init_Color
(
self
,
arg
)
PyCurses_Init_Color
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
short
color
,
r
,
g
,
b
;
short
color
,
r
,
g
,
b
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(hhhh);color,r,g,b"
,
&
color
,
&
r
,
&
g
,
&
b
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"(hhhh);color,r,g,b"
,
&
color
,
&
r
,
&
g
,
&
b
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
"init_color requires 4 arguments"
);
PyErr_SetString
(
PyExc_TypeError
,
"init_color requires 4 arguments"
);
...
@@ -1748,29 +1632,25 @@ PyCurses_Init_Color(self, arg)
...
@@ -1748,29 +1632,25 @@ PyCurses_Init_Color(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Init_Pair
(
self
,
arg
)
PyCurses_Init_Pair
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
short
pair
,
f
,
b
;
short
pair
,
f
,
b
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
if
(
ARG_COUNT
(
arg
)
==
3
)
{
if
(
ARG_COUNT
(
arg
s
)
==
3
)
{
PyErr_SetString
(
PyExc_TypeError
,
"init_pair requires 3 arguments"
);
PyErr_SetString
(
PyExc_TypeError
,
"init_pair requires 3 arguments"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"(hhh);pair, f, b"
,
&
pair
,
&
f
,
&
b
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"(hhh);pair, f, b"
,
&
pair
,
&
f
,
&
b
))
return
NULL
;
return
PyCursesCheckERR
(
init_pair
(
pair
,
f
,
b
),
"init_pair"
);
return
PyCursesCheckERR
(
init_pair
(
pair
,
f
,
b
),
"init_pair"
);
}
}
static
PyObject
*
static
PyObject
*
PyCurses_InitScr
(
self
,
args
)
PyCurses_InitScr
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
args
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
PyObject
*
lines
,
*
cols
;
PyObject
*
lines
,
*
cols
;
...
@@ -1855,17 +1735,15 @@ PyCurses_InitScr(self, args)
...
@@ -1855,17 +1735,15 @@ PyCurses_InitScr(self, args)
static
PyObject
*
static
PyObject
*
PyCurses_IntrFlush
(
self
,
arg
)
PyCurses_IntrFlush
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
ch
;
int
ch
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;True(1), False(0)"
,
&
ch
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;True(1), False(0)"
,
&
ch
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
"intrflush requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"intrflush requires 1 argument"
);
...
@@ -1876,16 +1754,14 @@ PyCurses_IntrFlush(self,arg)
...
@@ -1876,16 +1754,14 @@ PyCurses_IntrFlush(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_KeyName
(
self
,
arg
)
PyCurses_KeyName
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
const
char
*
knp
;
const
char
*
knp
;
int
ch
;
int
ch
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"i"
,
&
ch
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i"
,
&
ch
))
return
NULL
;
knp
=
keyname
(
ch
);
knp
=
keyname
(
ch
);
...
@@ -1893,13 +1769,11 @@ PyCurses_KeyName(self,arg)
...
@@ -1893,13 +1769,11 @@ PyCurses_KeyName(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_KillChar
(
self
,
arg
)
PyCurses_KillChar
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
char
ch
;
char
ch
;
if
(
!
PyArg_NoArgs
(
arg
))
return
NULL
;
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
ch
=
killchar
();
ch
=
killchar
();
...
@@ -1907,17 +1781,15 @@ PyObject * arg;
...
@@ -1907,17 +1781,15 @@ PyObject * arg;
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Meta
(
self
,
arg
)
PyCurses_Meta
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
ch
;
int
ch
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;True(1), False(0)"
,
&
ch
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;True(1), False(0)"
,
&
ch
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
"meta requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"meta requires 1 argument"
);
...
@@ -1929,28 +1801,24 @@ PyCurses_Meta(self,arg)
...
@@ -1929,28 +1801,24 @@ PyCurses_Meta(self,arg)
#ifdef NCURSES_MOUSE_VERSION
#ifdef NCURSES_MOUSE_VERSION
static
PyObject
*
static
PyObject
*
PyCurses_MouseInterval
(
self
,
arg
)
PyCurses_MouseInterval
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
interval
;
int
interval
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"i;interval"
,
&
interval
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;interval"
,
&
interval
))
return
NULL
;
return
NULL
;
return
PyCursesCheckERR
(
mouseinterval
(
interval
),
"mouseinterval"
);
return
PyCursesCheckERR
(
mouseinterval
(
interval
),
"mouseinterval"
);
}
}
static
PyObject
*
static
PyObject
*
PyCurses_MouseMask
(
self
,
arg
)
PyCurses_MouseMask
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
newmask
;
int
newmask
;
mmask_t
oldmask
,
availmask
;
mmask_t
oldmask
,
availmask
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"i;mousemask"
,
&
newmask
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;mousemask"
,
&
newmask
))
return
NULL
;
return
NULL
;
availmask
=
mousemask
(
newmask
,
&
oldmask
);
availmask
=
mousemask
(
newmask
,
&
oldmask
);
return
Py_BuildValue
(
"(ll)"
,
(
long
)
availmask
,
(
long
)
oldmask
);
return
Py_BuildValue
(
"(ll)"
,
(
long
)
availmask
,
(
long
)
oldmask
);
...
@@ -1958,16 +1826,14 @@ PyCurses_MouseMask(self,arg)
...
@@ -1958,16 +1826,14 @@ PyCurses_MouseMask(self,arg)
#endif
#endif
static
PyObject
*
static
PyObject
*
PyCurses_NewPad
(
self
,
arg
)
PyCurses_NewPad
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
int
nlines
,
ncols
;
int
nlines
,
ncols
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"(ii);nlines,ncols"
,
&
nlines
,
&
ncols
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);nlines,ncols"
,
&
nlines
,
&
ncols
))
return
NULL
;
win
=
newpad
(
nlines
,
ncols
);
win
=
newpad
(
nlines
,
ncols
);
...
@@ -1980,23 +1846,21 @@ PyCurses_NewPad(self,arg)
...
@@ -1980,23 +1846,21 @@ PyCurses_NewPad(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_NewWindow
(
self
,
arg
)
PyCurses_NewWindow
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
WINDOW
*
win
;
WINDOW
*
win
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
int
nlines
,
ncols
,
begin_y
,
begin_x
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
2
:
case
2
:
if
(
!
PyArg_Parse
(
arg
,
"(ii);nlines,ncols"
,
&
nlines
,
&
ncols
))
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);nlines,ncols"
,
&
nlines
,
&
ncols
))
return
NULL
;
return
NULL
;
win
=
newpad
(
nlines
,
ncols
);
win
=
newpad
(
nlines
,
ncols
);
break
;
break
;
case
4
:
case
4
:
if
(
!
PyArg_Parse
(
arg
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
if
(
!
PyArg_Parse
(
arg
s
,
"(iiii);nlines,ncols,begin_y,begin_x"
,
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
&
nlines
,
&
ncols
,
&
begin_y
,
&
begin_x
))
return
NULL
;
return
NULL
;
win
=
newwin
(
nlines
,
ncols
,
begin_y
,
begin_x
);
win
=
newwin
(
nlines
,
ncols
,
begin_y
,
begin_x
);
...
@@ -2015,18 +1879,16 @@ PyCurses_NewWindow(self,arg)
...
@@ -2015,18 +1879,16 @@ PyCurses_NewWindow(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Pair_Content
(
self
,
arg
)
PyCurses_Pair_Content
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
short
pair
,
f
,
b
;
short
pair
,
f
,
b
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"h;pair"
,
&
pair
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"h;pair"
,
&
pair
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
"pair_content requires 1 argument"
);
PyErr_SetString
(
PyExc_TypeError
,
"pair_content requires 1 argument"
);
...
@@ -2043,18 +1905,16 @@ PyCurses_Pair_Content(self, arg)
...
@@ -2043,18 +1905,16 @@ PyCurses_Pair_Content(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_pair_number
(
self
,
arg
)
PyCurses_pair_number
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
n
;
int
n
;
PyCursesInitialised
PyCursesInitialised
PyCursesInitialisedColor
PyCursesInitialisedColor
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;pairvalue"
,
&
n
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;pairvalue"
,
&
n
))
return
NULL
;
break
;
break
;
default:
default:
PyErr_SetString
(
PyExc_TypeError
,
PyErr_SetString
(
PyExc_TypeError
,
...
@@ -2066,32 +1926,28 @@ PyCurses_pair_number(self, arg)
...
@@ -2066,32 +1926,28 @@ PyCurses_pair_number(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Putp
(
self
,
arg
)
PyCurses_Putp
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
char
*
str
;
char
*
str
;
if
(
!
PyArg_Parse
(
arg
,
"s;str"
,
&
str
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"s;str"
,
&
str
))
return
NULL
;
return
PyCursesCheckERR
(
putp
(
str
),
"putp"
);
return
PyCursesCheckERR
(
putp
(
str
),
"putp"
);
}
}
static
PyObject
*
static
PyObject
*
PyCurses_QiFlush
(
self
,
arg
)
PyCurses_QiFlush
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
flag
=
0
;
int
flag
=
0
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
0
:
case
0
:
qiflush
();
qiflush
();
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
return
Py_None
;
return
Py_None
;
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;True(1) or False(0)"
,
&
flag
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;True(1) or False(0)"
,
&
flag
))
return
NULL
;
if
(
flag
)
qiflush
();
if
(
flag
)
qiflush
();
else
noqiflush
();
else
noqiflush
();
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
...
@@ -2103,20 +1959,18 @@ PyCurses_QiFlush(self, arg)
...
@@ -2103,20 +1959,18 @@ PyCurses_QiFlush(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_setsyx
(
self
,
arg
)
PyCurses_setsyx
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
y
,
x
;
int
y
,
x
;
PyCursesInitialised
PyCursesInitialised
if
(
ARG_COUNT
(
arg
)
!=
2
)
{
if
(
ARG_COUNT
(
arg
s
)
!=
2
)
{
PyErr_SetString
(
PyExc_TypeError
,
"setsyx requires 2 arguments"
);
PyErr_SetString
(
PyExc_TypeError
,
"setsyx requires 2 arguments"
);
return
NULL
;
return
NULL
;
}
}
if
(
!
PyArg_Parse
(
arg
,
"(ii);y, x"
,
&
y
,
&
x
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"(ii);y, x"
,
&
y
,
&
x
))
return
NULL
;
setsyx
(
y
,
x
);
setsyx
(
y
,
x
);
...
@@ -2125,16 +1979,14 @@ PyCurses_setsyx(self, arg)
...
@@ -2125,16 +1979,14 @@ PyCurses_setsyx(self, arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Start_Color
(
self
,
arg
)
PyCurses_Start_Color
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
code
;
int
code
;
PyObject
*
c
,
*
cp
;
PyObject
*
c
,
*
cp
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_NoArgs
(
arg
))
return
NULL
;
if
(
!
PyArg_NoArgs
(
arg
s
))
return
NULL
;
code
=
start_color
();
code
=
start_color
();
if
(
code
!=
ERR
)
{
if
(
code
!=
ERR
)
{
...
@@ -2154,15 +2006,13 @@ PyCurses_Start_Color(self,arg)
...
@@ -2154,15 +2006,13 @@ PyCurses_Start_Color(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_TypeAhead
(
self
,
arg
)
PyCurses_TypeAhead
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
fd
;
int
fd
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"i;fd"
,
&
fd
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"i;fd"
,
&
fd
))
return
NULL
;
PyCursesCheckERR
(
typeahead
(
fd
),
"typeahead"
);
PyCursesCheckERR
(
typeahead
(
fd
),
"typeahead"
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
...
@@ -2170,16 +2020,14 @@ PyCurses_TypeAhead(self,arg)
...
@@ -2170,16 +2020,14 @@ PyCurses_TypeAhead(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_UnCtrl
(
self
,
arg
)
PyCurses_UnCtrl
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
;
chtype
ch
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
if
(
PyInt_Check
(
temp
))
if
(
PyInt_Check
(
temp
))
ch
=
(
chtype
)
PyInt_AsLong
(
temp
);
ch
=
(
chtype
)
PyInt_AsLong
(
temp
);
...
@@ -2194,16 +2042,14 @@ PyCurses_UnCtrl(self,arg)
...
@@ -2194,16 +2042,14 @@ PyCurses_UnCtrl(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_UngetCh
(
self
,
arg
)
PyCurses_UngetCh
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
PyObject
*
temp
;
PyObject
*
temp
;
chtype
ch
;
chtype
ch
;
PyCursesInitialised
PyCursesInitialised
if
(
!
PyArg_Parse
(
arg
,
"O;ch or int"
,
&
temp
))
return
NULL
;
if
(
!
PyArg_Parse
(
arg
s
,
"O;ch or int"
,
&
temp
))
return
NULL
;
if
(
PyInt_Check
(
temp
))
if
(
PyInt_Check
(
temp
))
ch
=
(
chtype
)
PyInt_AsLong
(
temp
);
ch
=
(
chtype
)
PyInt_AsLong
(
temp
);
...
@@ -2218,17 +2064,15 @@ PyCurses_UngetCh(self,arg)
...
@@ -2218,17 +2064,15 @@ PyCurses_UngetCh(self,arg)
}
}
static
PyObject
*
static
PyObject
*
PyCurses_Use_Env
(
self
,
arg
)
PyCurses_Use_Env
(
PyObject
*
self
,
PyObject
*
args
)
PyObject
*
self
;
PyObject
*
arg
;
{
{
int
flag
;
int
flag
;
PyCursesInitialised
PyCursesInitialised
switch
(
ARG_COUNT
(
arg
))
{
switch
(
ARG_COUNT
(
arg
s
))
{
case
1
:
case
1
:
if
(
!
PyArg_Parse
(
arg
,
"i;True(1), False(0)"
,
&
flag
))
if
(
!
PyArg_Parse
(
arg
s
,
"i;True(1), False(0)"
,
&
flag
))
return
NULL
;
return
NULL
;
break
;
break
;
default:
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment