]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_chgat.c
ncurses 5.3
[ncurses.git] / ncurses / base / lib_chgat.c
index 7690ae4a2af3b685c488c15b526bb60bc147edcc..54e66ed1ffae6743b0d9b4e21f44c080b74da4af 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_chgat.c,v 1.2 1998/02/11 12:14:00 tom Exp $")
+MODULE_ID("$Id: lib_chgat.c,v 1.5 2001/06/03 00:05:02 skimo Exp $")
 
-int wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
+NCURSES_EXPORT(int)
+wchgat
+(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
 {
-    int        i;
+    int i;
 
     T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color));
 
     if (win) {
-      toggle_attr_on(attr,COLOR_PAIR(color));
+       toggle_attr_on(attr, COLOR_PAIR(color));
 
-      for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++)
-       win->_line[win->_cury].text[i]
-         = TextOf(win->_line[win->_cury].text[i]) | attr;
+       for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++)
+           SetAttr(win->_line[win->_cury].text[i], attr);
 
-      returnCode(OK);
-    }
-    else
-      returnCode(ERR);
+       returnCode(OK);
+    } else
+       returnCode(ERR);
 }