[Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.49,2.50

A.M. Kuchling akuchling@users.sourceforge.net
Mon, 29 Jan 2001 12:48:01 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv1445

Modified Files:
	_cursesmodule.c 
Log Message:
Patch #103485 from Donn Cave: patches to make the module compile on AIX and 
    NetBSD


Index: _cursesmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -r2.49 -r2.50
*** _cursesmodule.c	2001/01/29 20:31:29	2.49
--- _cursesmodule.c	2001/01/29 20:47:59	2.50
***************
*** 124,127 ****
--- 124,131 ----
  #endif
  
+ #if defined(_AIX)
+ #define STRICT_SYSV_CURSES
+ #endif
+ 
  /* Definition of exception curses.error */
  
***************
*** 311,317 ****
--- 315,329 ----
  Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
  Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
+ #if defined(__NetBSD__)
+ Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)")
+ #else
  Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)")
+ #endif
  Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)")
+ #if defined(__NetBSD__)
+ Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)")
+ #else
  Window_OneArgNoReturnFunction(nodelay, int, "i;True(1) or False(0)")
+ #endif
  Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
  Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
***************
*** 656,663 ****
--- 668,677 ----
    }
    
+ #if !defined(__NetBSD__)
    if (self->win->_flags & _ISPAD)
      return PyCursesCheckERR(pechochar(self->win, ch | attr), 
  			    "echochar");
    else
+ #endif
      return PyCursesCheckERR(wechochar(self->win, ch | attr), 
  			    "echochar");
***************
*** 736,740 ****
--- 750,758 ----
      return Py_BuildValue("c", rtn);
    else
+ #if defined(__NetBSD__)
+     return PyString_FromString(unctrl(rtn));
+ #else
      return PyString_FromString((char *)keyname(rtn));
+ #endif
  }
  
***************
*** 1055,1059 ****
--- 1073,1081 ----
    int rtn;
  
+ #if defined(__NetBSD__)
+   if (0) {
+ #else
    if (self->win->_flags & _ISPAD) {
+ #endif
      switch(ARG_COUNT(args)) {
      case 6:
***************
*** 1193,1197 ****
--- 1215,1223 ----
    int rtn;
    
+ #if defined(__NetBSD__)
+   if (0) {
+ #else
    if (self->win->_flags & _ISPAD) {
+ #endif
      switch(ARG_COUNT(args)) {
      case 6:
***************
*** 1257,1263 ****
--- 1283,1291 ----
  
    /* printf("Subwin: %i %i %i %i   \n", nlines, ncols, begin_y, begin_x); */
+ #if !defined(__NetBSD__)
    if (self->win->_flags & _ISPAD)
      win = subpad(self->win, nlines, ncols, begin_y, begin_x);
    else
+ #endif
      win = subwin(self->win, nlines, ncols, begin_y, begin_x);
  
***************
*** 1913,1916 ****
--- 1941,1945 ----
  }
  
+ #if !defined(__NetBSD__)
  static PyObject *
  PyCurses_KeyName(PyObject *self, PyObject *args)
***************
*** 1927,1930 ****
--- 1956,1960 ----
    return PyString_FromString((knp == NULL) ? "" : (char *)knp);
  }
+ #endif
  
  static PyObject *  
***************
*** 2389,2393 ****
--- 2419,2425 ----
    {"intrflush",           (PyCFunction)PyCurses_IntrFlush},
    {"isendwin",            (PyCFunction)PyCurses_isendwin},
+ #if !defined(__NetBSD__)
    {"keyname",             (PyCFunction)PyCurses_KeyName},
+ #endif
    {"killchar",            (PyCFunction)PyCurses_KillChar}, 
    {"longname",            (PyCFunction)PyCurses_longname}, 
***************
*** 2483,2487 ****
--- 2515,2521 ----
  	SetDictInt("A_BOLD",		A_BOLD);
  	SetDictInt("A_ALTCHARSET",	A_ALTCHARSET);
+ #if !defined(__NetBSD__)
  	SetDictInt("A_INVIS",           A_INVIS);
+ #endif
  	SetDictInt("A_PROTECT",         A_PROTECT);
  	SetDictInt("A_CHARTEXT",        A_CHARTEXT);
***************
*** 2555,2558 ****
--- 2589,2593 ----
  	  char *key_n;
  	  char *key_n2;
+ #if !defined(__NetBSD__)
  	  for (key=KEY_MIN;key < KEY_MAX; key++) {
  	    key_n = (char *)keyname(key);
***************
*** 2578,2581 ****
--- 2613,2617 ----
  	      free(key_n2);
  	  }
+ #endif
  	  SetDictInt("KEY_MIN", KEY_MIN);
  	  SetDictInt("KEY_MAX", KEY_MAX);