| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: attributes.c,v 1.28 2018/11/23 11:15:14 uwe Exp $ */ | | 1 | /* $NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Julian Coleman. | | 8 | * by Julian Coleman. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | __RCSID("$NetBSD: attributes.c,v 1.28 2018/11/23 11:15:14 uwe Exp $"); | | 34 | __RCSID("$NetBSD: attributes.c,v 1.29 2018/11/23 11:16:59 uwe Exp $"); |
35 | #endif /* not lint */ | | 35 | #endif /* not lint */ |
36 | | | 36 | |
37 | #include "curses.h" | | 37 | #include "curses.h" |
38 | #include "curses_private.h" | | 38 | #include "curses_private.h" |
39 | | | 39 | |
40 | static int __wattr_off(WINDOW *, attr_t); | | 40 | static int __wattr_off(WINDOW *, attr_t); |
41 | static int __wattr_on(WINDOW *, attr_t); | | 41 | static int __wattr_on(WINDOW *, attr_t); |
42 | static void __wcolor_set(WINDOW *, attr_t); | | 42 | static void __wcolor_set(WINDOW *, attr_t); |
43 | | | 43 | |
44 | | | 44 | |
45 | #ifndef _CURSES_USE_MACROS | | 45 | #ifndef _CURSES_USE_MACROS |
46 | /* | | 46 | /* |
47 | * attr_get -- | | 47 | * attr_get -- |
| @@ -194,27 +194,27 @@ wattr_set(WINDOW *win, attr_t attr, shor | | | @@ -194,27 +194,27 @@ wattr_set(WINDOW *win, attr_t attr, shor |
194 | #ifdef DEBUG | | 194 | #ifdef DEBUG |
195 | __CTRACE(__CTRACE_ATTR, "wattr_set: win %p, attr %08x, pair %d\n", | | 195 | __CTRACE(__CTRACE_ATTR, "wattr_set: win %p, attr %08x, pair %d\n", |
196 | win, attr, pair); | | 196 | win, attr, pair); |
197 | #endif | | 197 | #endif |
198 | if (__predict_false(opts != NULL)) | | 198 | if (__predict_false(opts != NULL)) |
199 | return ERR; | | 199 | return ERR; |
200 | | | 200 | |
201 | /* | | 201 | /* |
202 | * This overwrites any colour setting from the attributes | | 202 | * This overwrites any colour setting from the attributes |
203 | * and is compatible with ncurses. | | 203 | * and is compatible with ncurses. |
204 | */ | | 204 | */ |
205 | attr = (attr & ~__COLOR) | COLOR_PAIR(pair); | | 205 | attr = (attr & ~__COLOR) | COLOR_PAIR(pair); |
206 | | | 206 | |
207 | __wattr_off(win, __ATTRIBUTES); | | 207 | __wattr_off(win, WA_ATTRIBUTES); |
208 | __wattr_on(win, attr); | | 208 | __wattr_on(win, attr); |
209 | return OK; | | 209 | return OK; |
210 | } | | 210 | } |
211 | | | 211 | |
212 | /* | | 212 | /* |
213 | * wcolor_set -- | | 213 | * wcolor_set -- |
214 | * Set color pair on window | | 214 | * Set color pair on window |
215 | */ | | 215 | */ |
216 | /* ARGSUSED */ | | 216 | /* ARGSUSED */ |
217 | int | | 217 | int |
218 | wcolor_set(WINDOW *win, short pair, void *opts) | | 218 | wcolor_set(WINDOW *win, short pair, void *opts) |
219 | { | | 219 | { |
220 | #ifdef DEBUG | | 220 | #ifdef DEBUG |