[Python-checkins] CVS: python/dist/src/Modules cursesmodule.c,2.21,2.22

A.M. Kuchling python-dev@python.org
Tue, 23 May 2000 09:24:57 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27546

Modified Files:
	cursesmodule.c 
Log Message:
Changes by AMK: Use HAVE_NCURSES_H to include correct header file
Lots of typo fixes (a bit too much cut-and-paste in this module)
Aliases removed: attr_on, attr_off, attr_set
Lowercased the names COLOR_PAIR and PAIR_NUMBER
#ifdef's for compiling on Solaris added (need to understand SYSV curses
    versions better and generalize this)
Bumped version number bumped to 1.6


Index: cursesmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cursesmodule.c,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -r2.21 -r2.22
*** cursesmodule.c	2000/05/23 16:18:03	2.21
--- cursesmodule.c	2000/05/23 16:24:54	2.22
***************
*** 1,14 ****
  /*
!  *   This is a curses implementation for Python.
   *
!  *   Based on a prior work by Lance Ellinghaus
!  *   (version 1.2 of this module
!  *    Copyright 1994 by Lance Ellinghouse,
!  *    Cathedral City, California Republic, United States of America.)
!  *   Updated, fixed and heavily extended by Oliver Andrich
   *
!  *   Copyright 1996,1997 by Oliver Andrich,
!  *   Koblenz, Germany
   *
   *   Permission is hereby granted, free of charge, to any person obtaining
   *   a copy of this source file to use, copy, modify, merge, or publish it
--- 1,14 ----
  /*
!  *   This is a curses module for Python.
   *
!  *   Based on prior work by Lance Ellinghaus and Oliver Andrich
!  *   Version 1.2 of this module: Copyright 1994 by Lance Ellinghouse,
!  *    Cathedral City, California Republic, United States of America.
   *
!  *   Version 1.5b1, heavily extended for ncurses by Oliver Andrich:
!  *   Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany.
   *
+  *   Tidied for Python 1.6, and currently maintained by AMK (amk1@bigfoot.com)
+  *
   *   Permission is hereby granted, free of charge, to any person obtaining
   *   a copy of this source file to use, copy, modify, merge, or publish it
***************
*** 32,47 ****
   */
  
! /* CVS: $Id: cursesmodule.c,v 2.21 2000/05/23 16:18:03 akuchling Exp $ */
  
  /* Release Number */
  
! char *PyCursesVersion = "1.5b1";
  
  /* Includes */
  
  #include "Python.h"
  #include <curses.h>
  
! #ifdef __sgi__
   /* No attr_t type is available */
  typedef chtype attr_t;
--- 32,52 ----
   */
  
! /* CVS: $Id: cursesmodule.c,v 2.22 2000/05/23 16:24:54 akuchling Exp $ */
  
  /* Release Number */
  
! char *PyCursesVersion = "1.6";
  
  /* Includes */
  
  #include "Python.h"
+ 
+ #ifdef HAVE_NCURSES_H
+ #include <ncurses.h>
+ #else
  #include <curses.h>
+ #endif
  
! #if defined(__sgi__) || defined(__sun__)
   /* No attr_t type is available */
  typedef chtype attr_t;
***************
*** 90,95 ****
       char *fname;
  {
-   char buf[100];
- 
    if (code != ERR) {
      Py_INCREF(Py_None);
--- 95,98 ----
***************
*** 99,105 ****
        PyErr_SetString(PyCursesError, catchall_ERR);
      } else {
!       strcpy(buf, fname);
!       strcat(buf, "() returned ERR");
!       PyErr_SetString(PyCursesError, buf);
      }
      return NULL;
--- 102,106 ----
        PyErr_SetString(PyCursesError, catchall_ERR);
      } else {
!       PyErr_Format(PyCursesError, "%s() returned ERR", fname);
      }
      return NULL;
***************
*** 107,111 ****
  }
  
! int 
  PyCurses_ConvertToChtype(obj, ch)
          PyObject *obj;
--- 108,112 ----
  }
  
! static int 
  PyCurses_ConvertToChtype(obj, ch)
          PyObject *obj;
***************
*** 242,246 ****
  Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
  Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
! Window_OneArgNoReturnFunction(winsdelln, int, "i;cnt")
  Window_OneArgNoReturnFunction(syncok, int, "i;True(1) or False(0)")
  
--- 243,247 ----
  Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
  Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
! Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
  Window_OneArgNoReturnFunction(syncok, int, "i;True(1) or False(0)")
  
***************
*** 248,256 ****
  Window_TwoArgNoReturnFunction(mvderwin, int, "(ii);y,x")
  Window_TwoArgNoReturnFunction(wmove, int, "(ii);y,x")
! #ifndef __sgi__
  Window_TwoArgNoReturnFunction(wresize, int, "(ii);lines,columns")
  #endif
  
! /* Allocation and Deallocation of Window Objects */
  
  static PyObject *
--- 249,257 ----
  Window_TwoArgNoReturnFunction(mvderwin, int, "(ii);y,x")
  Window_TwoArgNoReturnFunction(wmove, int, "(ii);y,x")
! #if !defined(__sgi__) && !defined(__sun__)
  Window_TwoArgNoReturnFunction(wresize, int, "(ii);lines,columns")
  #endif
  
! /* Allocation and deallocation of Window Objects */
  
  static PyObject *
***************
*** 476,480 ****
  
    if (!PyCurses_ConvertToChtype(temp, &bkgd)) {
!     PyErr_SetString(PyExc_TypeError, "argument 1 or 3 must be a ch or an int");
      return NULL;
    }
--- 477,481 ----
  
    if (!PyCurses_ConvertToChtype(temp, &bkgd)) {
!     PyErr_SetString(PyExc_TypeError, "argument 1 must be a ch or an int");
      return NULL;
    }
***************
*** 664,668 ****
      break;
    default:
!     PyErr_SetString(PyExc_TypeError, "getch requires 0 or 2 arguments");
      return NULL;
    }
--- 665,669 ----
      break;
    default:
!     PyErr_SetString(PyExc_TypeError, "getkey requires 0 or 2 arguments");
      return NULL;
    }
***************
*** 699,703 ****
      if (!PyArg_Parse(arg,"(iii);y,x,n", &y, &x, &n))
        return NULL;
! #ifdef __sgi__
   /* Untested */
      rtn2 = wmove(self->win,y,x)==ERR ? ERR :
--- 700,704 ----
      if (!PyArg_Parse(arg,"(iii);y,x,n", &y, &x, &n))
        return NULL;
! #if defined(__sgi__) || defined(__sun__)
   /* Untested */
      rtn2 = wmove(self->win,y,x)==ERR ? ERR :
***************
*** 736,740 ****
      break;
    case 4:
!     if (!PyArg_Parse(args, "(iiOi);y,x,ch o int,n", &y, &x, &temp, &n))
        return NULL;
      code = wmove(self->win, y, x);
--- 737,741 ----
      break;
    case 4:
!     if (!PyArg_Parse(args, "(iiOi);y,x,ch or int,n", &y, &x, &temp, &n))
        return NULL;
      code = wmove(self->win, y, x);
***************
*** 1101,1112 ****
    int nlines, ncols, begin_y, begin_x;
  
!   if (!PyArg_Parse(arg, "(iiii);nlines,ncols,begin_y,begin_x",
  		   &nlines,&ncols,&begin_y,&begin_x))
      return NULL;
  
    if (self->win->_flags & _ISPAD)
      win = subpad(self->win, nlines, ncols, begin_y, begin_x);
    else
!     win = subwin(self->win,nlines,ncols,begin_y,begin_x);
  
    if (win == NULL) {
--- 1102,1127 ----
    int nlines, ncols, begin_y, begin_x;
  
!   nlines = 0;
!   ncols  = 0;
!   switch (ARG_COUNT(arg)) {
!   case 2:
!     if (!PyArg_Parse(arg,"(ii);begin_y,begin_x",&begin_y,&begin_x))
!       return NULL;
!     break;
!   case 4:
!     if (!PyArg_Parse(arg, "(iiii);nlines,ncols,begin_y,begin_x",
  		   &nlines,&ncols,&begin_y,&begin_x))
+       return NULL;
+     break;
+   default:
+     PyErr_SetString(PyExc_TypeError, "subwin requires 2 or 4 arguments");
      return NULL;
+   }
  
+   printf("Subwin: %i %i %i %i   \n", nlines, ncols, begin_y, begin_x);
    if (self->win->_flags & _ISPAD)
      win = subpad(self->win, nlines, ncols, begin_y, begin_x);
    else
!     win = subwin(self->win, nlines, ncols, begin_y, begin_x);
  
    if (win == NULL) {
***************
*** 1180,1184 ****
      break;
    case 4:
!     if (!PyArg_Parse(args, "(iiOi);y,x,ch o int,n", &y, &x, &temp, &n))
        return NULL;
      code = wmove(self->win, y, x);
--- 1195,1199 ----
      break;
    case 4:
!     if (!PyArg_Parse(args, "(iiOi);y,x,ch or int,n", &y, &x, &temp, &n))
        return NULL;
      code = wmove(self->win, y, x);
***************
*** 1200,1204 ****
        return NULL;
      }
!     return PyCursesCheckERR(whline(self->win, ch | attr, n), "vline");
    } else
      return PyCursesCheckERR(code, "wmove");
--- 1215,1219 ----
        return NULL;
      }
!     return PyCursesCheckERR(wvline(self->win, ch | attr, n), "vline");
    } else
      return PyCursesCheckERR(code, "wmove");
***************
*** 1209,1218 ****
  	{"addnstr",         (PyCFunction)PyCursesWindow_AddNStr},
  	{"addstr",          (PyCFunction)PyCursesWindow_AddStr},
- 	{"attron",          (PyCFunction)PyCursesWindow_wattron},
- 	{"attr_on",         (PyCFunction)PyCursesWindow_wattron},
  	{"attroff",         (PyCFunction)PyCursesWindow_wattroff},
! 	{"attr_off",        (PyCFunction)PyCursesWindow_wattroff},
  	{"attrset",         (PyCFunction)PyCursesWindow_wattrset},
- 	{"attr_set",        (PyCFunction)PyCursesWindow_wattrset},
  	{"bkgd",            (PyCFunction)PyCursesWindow_Bkgd},
  	{"bkgdset",         (PyCFunction)PyCursesWindow_BkgdSet},
--- 1224,1230 ----
  	{"addnstr",         (PyCFunction)PyCursesWindow_AddNStr},
  	{"addstr",          (PyCFunction)PyCursesWindow_AddStr},
  	{"attroff",         (PyCFunction)PyCursesWindow_wattroff},
! 	{"attron",          (PyCFunction)PyCursesWindow_wattron},
  	{"attrset",         (PyCFunction)PyCursesWindow_wattrset},
  	{"bkgd",            (PyCFunction)PyCursesWindow_Bkgd},
  	{"bkgdset",         (PyCFunction)PyCursesWindow_BkgdSet},
***************
*** 1238,1243 ****
  	{"getyx",           (PyCFunction)PyCursesWindow_getyx},
  	{"hline",           (PyCFunction)PyCursesWindow_Hline},
- 	{"idlok",           (PyCFunction)PyCursesWindow_idlok},
  	{"idcok",           (PyCFunction)PyCursesWindow_idcok},
  	{"immedok",         (PyCFunction)PyCursesWindow_immedok},
  	{"inch",            (PyCFunction)PyCursesWindow_InCh},
--- 1250,1255 ----
  	{"getyx",           (PyCFunction)PyCursesWindow_getyx},
  	{"hline",           (PyCFunction)PyCursesWindow_Hline},
  	{"idcok",           (PyCFunction)PyCursesWindow_idcok},
+ 	{"idlok",           (PyCFunction)PyCursesWindow_idlok},
  	{"immedok",         (PyCFunction)PyCursesWindow_immedok},
  	{"inch",            (PyCFunction)PyCursesWindow_InCh},
***************
*** 1253,1266 ****
  	{"leaveok",         (PyCFunction)PyCursesWindow_leaveok},
  	{"move",            (PyCFunction)PyCursesWindow_wmove},
- 	{"mvwin",           (PyCFunction)PyCursesWindow_mvwin},
  	{"mvderwin",        (PyCFunction)PyCursesWindow_mvderwin},
  	{"nodelay",         (PyCFunction)PyCursesWindow_nodelay},
- 	{"noutrefresh",     (PyCFunction)PyCursesWindow_NoOutRefresh},
  	{"notimeout",       (PyCFunction)PyCursesWindow_notimeout},
  	{"putwin",          (PyCFunction)PyCursesWindow_PutWin},
- 	{"redrawwin",       (PyCFunction)PyCursesWindow_redrawwin},
  	{"redrawln",        (PyCFunction)PyCursesWindow_RedrawLine},
  	{"refresh",         (PyCFunction)PyCursesWindow_Refresh},
! #ifndef __sgi__
  	{"resize",          (PyCFunction)PyCursesWindow_wresize},
  #endif
--- 1265,1278 ----
  	{"leaveok",         (PyCFunction)PyCursesWindow_leaveok},
  	{"move",            (PyCFunction)PyCursesWindow_wmove},
  	{"mvderwin",        (PyCFunction)PyCursesWindow_mvderwin},
+ 	{"mvwin",           (PyCFunction)PyCursesWindow_mvwin},
  	{"nodelay",         (PyCFunction)PyCursesWindow_nodelay},
  	{"notimeout",       (PyCFunction)PyCursesWindow_notimeout},
+ 	{"noutrefresh",     (PyCFunction)PyCursesWindow_NoOutRefresh},
  	{"putwin",          (PyCFunction)PyCursesWindow_PutWin},
  	{"redrawln",        (PyCFunction)PyCursesWindow_RedrawLine},
+ 	{"redrawwin",       (PyCFunction)PyCursesWindow_redrawwin},
  	{"refresh",         (PyCFunction)PyCursesWindow_Refresh},
! #if !defined(__sgi__) && !defined(__sun__)
  	{"resize",          (PyCFunction)PyCursesWindow_wresize},
  #endif
***************
*** 1349,1353 ****
      else return PyCursesCheckERR(no ## X (), # X); \
    default: \
!     PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 argument"); \
      return NULL; } }
  
--- 1361,1365 ----
      else return PyCursesCheckERR(no ## X (), # X); \
    default: \
!     PyErr_SetString(PyExc_TypeError, # X " requires 0 or 1 arguments"); \
      return NULL; } }
  
***************
*** 1427,1431 ****
  NoArgTrueFalseFunction(has_il)
  NoArgTrueFalseFunction(isendwin)
- 
  NoArgNoReturnVoidFunction(filter)
  NoArgNoReturnVoidFunction(flushinp)
--- 1439,1442 ----
***************
*** 1460,1464 ****
  
  static PyObject *
! PyCurses_COLOR_PAIR(self, arg)
       PyObject * self;
       PyObject * arg;
--- 1471,1475 ----
  
  static PyObject *
! PyCurses_color_pair(self, arg)
       PyObject * self;
       PyObject * arg;
***************
*** 1470,1474 ****
  
    if (ARG_COUNT(arg)!=1) {
!     PyErr_SetString(PyExc_TypeError, "COLOR_PAIR requires 1 argument");
      return NULL;
    }
--- 1481,1485 ----
  
    if (ARG_COUNT(arg)!=1) {
!     PyErr_SetString(PyExc_TypeError, "color_pair requires 1 argument");
      return NULL;
    }
***************
*** 1597,1601 ****
  }
  
! #ifndef __sgi__
   /* No has_key! */
  static PyObject * PyCurses_has_key(self,arg)
--- 1608,1612 ----
  }
  
! #if !defined(__sgi__) && !defined(__sun__)
   /* No has_key! */
  static PyObject * PyCurses_has_key(self,arg)
***************
*** 1684,1687 ****
--- 1695,1750 ----
    initialised = TRUE;
  
+ /* This was moved from initcurses() because it core dumped on SGI,
+    where they're not defined until you've called initscr() */
+ #define SetDictInt(string,ch) \
+ 	PyDict_SetItemString(ModDict,string,PyInt_FromLong((long) (ch)));
+ 
+ 	/* Here are some graphic symbols you can use */
+         SetDictInt("ACS_ULCORNER",      (ACS_ULCORNER));
+ 	SetDictInt("ACS_LLCORNER",      (ACS_LLCORNER));
+ 	SetDictInt("ACS_URCORNER",      (ACS_URCORNER));
+ 	SetDictInt("ACS_LRCORNER",      (ACS_LRCORNER));
+ 	SetDictInt("ACS_LTEE",          (ACS_LTEE));
+ 	SetDictInt("ACS_RTEE",          (ACS_RTEE));
+ 	SetDictInt("ACS_BTEE",          (ACS_BTEE));
+ 	SetDictInt("ACS_TTEE",          (ACS_TTEE));
+ 	SetDictInt("ACS_HLINE",         (ACS_HLINE));
+ 	SetDictInt("ACS_VLINE",         (ACS_VLINE));
+ 	SetDictInt("ACS_PLUS",          (ACS_PLUS));
+ 	SetDictInt("ACS_S1",            (ACS_S1));
+ 	SetDictInt("ACS_S9",            (ACS_S9));
+ 	SetDictInt("ACS_DIAMOND",       (ACS_DIAMOND));
+ 	SetDictInt("ACS_CKBOARD",       (ACS_CKBOARD));
+ 	SetDictInt("ACS_DEGREE",        (ACS_DEGREE));
+ 	SetDictInt("ACS_PLMINUS",       (ACS_PLMINUS));
+ 	SetDictInt("ACS_BULLET",        (ACS_BULLET));
+ 	SetDictInt("ACS_LARROW",        (ACS_LARROW));
+ 	SetDictInt("ACS_RARROW",        (ACS_RARROW));
+ 	SetDictInt("ACS_DARROW",        (ACS_DARROW));
+ 	SetDictInt("ACS_UARROW",        (ACS_UARROW));
+ 	SetDictInt("ACS_BOARD",         (ACS_BOARD));
+ 	SetDictInt("ACS_LANTERN",       (ACS_LANTERN));
+ 	SetDictInt("ACS_BLOCK",         (ACS_BLOCK));
+ 	SetDictInt("ACS_BSSB",          (ACS_ULCORNER));
+ 	SetDictInt("ACS_SSBB",          (ACS_LLCORNER));
+ 	SetDictInt("ACS_BBSS",          (ACS_URCORNER));
+ 	SetDictInt("ACS_SBBS",          (ACS_LRCORNER));
+ 	SetDictInt("ACS_SBSS",          (ACS_RTEE));
+ 	SetDictInt("ACS_SSSB",          (ACS_LTEE));
+ 	SetDictInt("ACS_SSBS",          (ACS_BTEE));
+ 	SetDictInt("ACS_BSSS",          (ACS_TTEE));
+ 	SetDictInt("ACS_BSBS",          (ACS_HLINE));
+ 	SetDictInt("ACS_SBSB",          (ACS_VLINE));
+ 	SetDictInt("ACS_SSSS",          (ACS_PLUS));
+ #if !defined(__sgi__) && !defined(__sun__)
+   /* The following are never available on IRIX 5.3 */
+ 	SetDictInt("ACS_S3",            (ACS_S3));
+ 	SetDictInt("ACS_LEQUAL",        (ACS_LEQUAL));
+ 	SetDictInt("ACS_GEQUAL",        (ACS_GEQUAL));
+ 	SetDictInt("ACS_PI",            (ACS_PI));
+ 	SetDictInt("ACS_NEQUAL",        (ACS_NEQUAL));
+ 	SetDictInt("ACS_STERLING",      (ACS_STERLING));
+ #endif
+ 
    lines = PyInt_FromLong((long) LINES);
    PyDict_SetItemString(ModDict, "LINES", lines);
***************
*** 1854,1858 ****
  
  static PyObject *
! PyCurses_PAIR_NUMBER(self, arg)
       PyObject * self;
       PyObject * arg;
--- 1917,1921 ----
  
  static PyObject *
! PyCurses_pair_number(self, arg)
       PyObject * self;
       PyObject * arg;
***************
*** 1869,1873 ****
    default:
      PyErr_SetString(PyExc_TypeError,
!                     "PAIR_NUMBER requires 1 argument");
      return NULL;
    }
--- 1932,1936 ----
    default:
      PyErr_SetString(PyExc_TypeError,
!                     "pair_number requires 1 argument");
      return NULL;
    }
***************
*** 1908,1912 ****
      return Py_None;
    default:
!     PyErr_SetString(PyExc_TypeError, "nl requires 0 or 1 argument");
      return NULL;
    }
--- 1971,1975 ----
      return Py_None;
    default:
!     PyErr_SetString(PyExc_TypeError, "qiflush requires 0 or 1 arguments");
      return NULL;
    }
***************
*** 1922,1927 ****
    PyCursesInitialised
  
!   if (ARG_COUNT(arg)!=3) {
!     PyErr_SetString(PyExc_TypeError, "curs_set requires 3 argument");
      return NULL;
    }
--- 1985,1990 ----
    PyCursesInitialised
  
!   if (ARG_COUNT(arg)!=2) {
!     PyErr_SetString(PyExc_TypeError, "setsyx requires 2 arguments");
      return NULL;
    }
***************
*** 2043,2047 ****
    {"cbreak",              (PyCFunction)PyCurses_cbreak},
    {"color_content",       (PyCFunction)PyCurses_Color_Content},
!   {"COLOR_PAIR",          (PyCFunction)PyCurses_COLOR_PAIR},
    {"curs_set",            (PyCFunction)PyCurses_Curs_Set},
    {"def_prog_mode",       (PyCFunction)PyCurses_def_prog_mode},
--- 2106,2110 ----
    {"cbreak",              (PyCFunction)PyCurses_cbreak},
    {"color_content",       (PyCFunction)PyCurses_Color_Content},
!   {"color_pair",          (PyCFunction)PyCurses_color_pair},
    {"curs_set",            (PyCFunction)PyCurses_Curs_Set},
    {"def_prog_mode",       (PyCFunction)PyCurses_def_prog_mode},
***************
*** 2060,2064 ****
    {"has_ic",              (PyCFunction)PyCurses_has_ic},
    {"has_il",              (PyCFunction)PyCurses_has_il},
! #ifndef __sgi__
    {"has_key",             (PyCFunction)PyCurses_has_key},
  #endif
--- 2123,2127 ----
    {"has_ic",              (PyCFunction)PyCurses_has_ic},
    {"has_il",              (PyCFunction)PyCurses_has_il},
! #if !defined(__sgi__) && !defined(__sun__)
    {"has_key",             (PyCFunction)PyCurses_has_key},
  #endif
***************
*** 2082,2086 ****
    {"noraw",               (PyCFunction)PyCurses_noraw},
    {"pair_content",        (PyCFunction)PyCurses_Pair_Content},
!   {"PAIR_NUMBER",         (PyCFunction)PyCurses_PAIR_NUMBER},
    {"putp",                (PyCFunction)PyCurses_Putp},
    {"qiflush",             (PyCFunction)PyCurses_QiFlush},
--- 2145,2149 ----
    {"noraw",               (PyCFunction)PyCurses_noraw},
    {"pair_content",        (PyCFunction)PyCurses_Pair_Content},
!   {"pair_number",         (PyCFunction)PyCurses_pair_number},
    {"putp",                (PyCFunction)PyCurses_Putp},
    {"qiflush",             (PyCFunction)PyCurses_QiFlush},
***************
*** 2124,2191 ****
  	/* Here are some attributes you can add to chars to print */
  	
- #define SetDictInt(string,ch) \
- 	PyDict_SetItemString(ModDict,string,PyInt_FromLong((long) (ch)));
- 
- #ifndef __sgi__
-   /* On IRIX 5.3, the ACS characters aren't available until initscr() has been called.  */
-         SetDictInt("ACS_ULCORNER",      (ACS_ULCORNER));
- 	SetDictInt("ACS_LLCORNER",      (ACS_LLCORNER));
- 	SetDictInt("ACS_URCORNER",      (ACS_URCORNER));
- 	SetDictInt("ACS_LRCORNER",      (ACS_LRCORNER));
- 	SetDictInt("ACS_LTEE",          (ACS_LTEE));
- 	SetDictInt("ACS_RTEE",          (ACS_RTEE));
- 	SetDictInt("ACS_BTEE",          (ACS_BTEE));
- 	SetDictInt("ACS_TTEE",          (ACS_TTEE));
- 	SetDictInt("ACS_HLINE",         (ACS_HLINE));
- 	SetDictInt("ACS_VLINE",         (ACS_VLINE));
- 	SetDictInt("ACS_PLUS",          (ACS_PLUS));
- 	SetDictInt("ACS_S1",            (ACS_S1));
- 	SetDictInt("ACS_S9",            (ACS_S9));
- 	SetDictInt("ACS_DIAMOND",       (ACS_DIAMOND));
- 	SetDictInt("ACS_CKBOARD",       (ACS_CKBOARD));
- 	SetDictInt("ACS_DEGREE",        (ACS_DEGREE));
- 	SetDictInt("ACS_PLMINUS",       (ACS_PLMINUS));
- 	SetDictInt("ACS_BULLET",        (ACS_BULLET));
- 	SetDictInt("ACS_LARROW",        (ACS_LARROW));
- 	SetDictInt("ACS_RARROW",        (ACS_RARROW));
- 	SetDictInt("ACS_DARROW",        (ACS_DARROW));
- 	SetDictInt("ACS_UARROW",        (ACS_UARROW));
- 	SetDictInt("ACS_BOARD",         (ACS_BOARD));
- 	SetDictInt("ACS_LANTERN",       (ACS_LANTERN));
- 	SetDictInt("ACS_BLOCK",         (ACS_BLOCK));
- #ifndef __sgi__
-   /* The following are never available on IRIX 5.3 */
- 	SetDictInt("ACS_S3",            (ACS_S3));
- 	SetDictInt("ACS_LEQUAL",        (ACS_LEQUAL));
- 	SetDictInt("ACS_GEQUAL",        (ACS_GEQUAL));
- 	SetDictInt("ACS_PI",            (ACS_PI));
- 	SetDictInt("ACS_NEQUAL",        (ACS_NEQUAL));
- 	SetDictInt("ACS_STERLING",      (ACS_STERLING));
- #endif
- 	SetDictInt("ACS_BSSB",          (ACS_ULCORNER));
- 	SetDictInt("ACS_SSBB",          (ACS_LLCORNER));
- 	SetDictInt("ACS_BBSS",          (ACS_URCORNER));
- 	SetDictInt("ACS_SBBS",          (ACS_LRCORNER));
- 	SetDictInt("ACS_SBSS",          (ACS_RTEE));
- 	SetDictInt("ACS_SSSB",          (ACS_LTEE));
- 	SetDictInt("ACS_SSBS",          (ACS_BTEE));
- 	SetDictInt("ACS_BSSS",          (ACS_TTEE));
- 	SetDictInt("ACS_BSBS",          (ACS_HLINE));
- 	SetDictInt("ACS_SBSB",          (ACS_VLINE));
- 	SetDictInt("ACS_SSSS",          (ACS_PLUS));
- #endif
- 
  	SetDictInt("A_ATTRIBUTES",      A_ATTRIBUTES);
! 	SetDictInt("A_NORMAL",		    A_NORMAL);
! 	SetDictInt("A_STANDOUT",	    A_STANDOUT);
! 	SetDictInt("A_UNDERLINE",	    A_UNDERLINE);
! 	SetDictInt("A_REVERSE",		    A_REVERSE);
! 	SetDictInt("A_BLINK",		    A_BLINK);
! 	SetDictInt("A_DIM",		        A_DIM);
! 	SetDictInt("A_BOLD",		    A_BOLD);
! 	SetDictInt("A_ALTCHARSET",	    A_ALTCHARSET);
  	SetDictInt("A_INVIS",           A_INVIS);
  	SetDictInt("A_PROTECT",         A_PROTECT);
! #ifndef __sgi__
  	SetDictInt("A_HORIZONTAL",      A_HORIZONTAL);
  	SetDictInt("A_LEFT",            A_LEFT);
--- 2187,2204 ----
  	/* Here are some attributes you can add to chars to print */
  	
  	SetDictInt("A_ATTRIBUTES",      A_ATTRIBUTES);
! 	SetDictInt("A_NORMAL",		A_NORMAL);
! 	SetDictInt("A_STANDOUT",	A_STANDOUT);
! 	SetDictInt("A_UNDERLINE",	A_UNDERLINE);
! 	SetDictInt("A_REVERSE",		A_REVERSE);
! 	SetDictInt("A_BLINK",		A_BLINK);
! 	SetDictInt("A_DIM",		A_DIM);
! 	SetDictInt("A_BOLD",		A_BOLD);
! 	SetDictInt("A_ALTCHARSET",	A_ALTCHARSET);
  	SetDictInt("A_INVIS",           A_INVIS);
  	SetDictInt("A_PROTECT",         A_PROTECT);
! 	SetDictInt("A_CHARTEXT",        A_CHARTEXT);
! 	SetDictInt("A_COLOR",           A_COLOR);
! #if !defined(__sgi__) && !defined(__sun__)
  	SetDictInt("A_HORIZONTAL",      A_HORIZONTAL);
  	SetDictInt("A_LEFT",            A_LEFT);
***************
*** 2194,2219 ****
  	SetDictInt("A_TOP",             A_TOP);
  	SetDictInt("A_VERTICAL",        A_VERTICAL);
- #endif
- 	SetDictInt("A_CHARTEXT",        A_CHARTEXT);
- 	SetDictInt("A_COLOR",           A_COLOR);
- #ifndef __sgi__
- 	SetDictInt("WA_ATTRIBUTES",     WA_ATTRIBUTES);
- 	SetDictInt("WA_NORMAL",		    WA_NORMAL);
- 	SetDictInt("WA_STANDOUT",	    WA_STANDOUT);
- 	SetDictInt("WA_UNDERLINE",	    WA_UNDERLINE);
- 	SetDictInt("WA_REVERSE",	    WA_REVERSE);
- 	SetDictInt("WA_BLINK",		    WA_BLINK);
- 	SetDictInt("WA_DIM",		    WA_DIM);
- 	SetDictInt("WA_BOLD",		    WA_BOLD);
- 	SetDictInt("WA_ALTCHARSET",	    WA_ALTCHARSET);
- 	SetDictInt("WA_INVIS",          WA_INVIS);
- 	SetDictInt("WA_PROTECT",        WA_PROTECT);
- 	SetDictInt("WA_HORIZONTAL",     WA_HORIZONTAL);
- 	SetDictInt("WA_LEFT",           WA_LEFT);
- 	SetDictInt("WA_LOW",            WA_LOW);
- 	SetDictInt("WA_RIGHT",          WA_RIGHT);
- 	SetDictInt("WA_TOP",            WA_TOP);
- 	SetDictInt("WA_VERTICAL",       WA_VERTICAL);
  #endif
  	SetDictInt("COLOR_BLACK",       COLOR_BLACK);
  	SetDictInt("COLOR_RED",         COLOR_RED);
--- 2207,2212 ----
  	SetDictInt("A_TOP",             A_TOP);
  	SetDictInt("A_VERTICAL",        A_VERTICAL);
  #endif
+ 
  	SetDictInt("COLOR_BLACK",       COLOR_BLACK);
  	SetDictInt("COLOR_RED",         COLOR_RED);
***************
*** 2261,2264 ****
  		Py_FatalError("can't initialize module curses");
  }
- 
- 
--- 2254,2255 ----