xref: /titanic_51/usr/src/lib/libxcurses/src/libc/xcurses/addnws.c (revision 91e1e26ac6a73ce959289cf7d3d96c4baedbe0b8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1995, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * addnws.c
31  *
32  * XCurses Library
33  *
34  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
35  *
36  */
37 
38 #if M_RCSID
39 #ifndef lint
40 static char rcsID[] = "$Header: /rd/src/libc/xcurses/rcs/addnws.c 1.2 1995/05/18 20:55:00 ant Exp $";
41 #endif
42 #endif
43 
44 #include <private.h>
45 
46 #undef addnwstr
47 
48 int
49 addnwstr(wcs, n)
50 const wchar_t *wcs;
51 int n;
52 {
53 	int code;
54 
55 #ifdef M_CURSES_TRACE
56 	__m_trace("addnwstr(%p, %d)", wcs, n);
57 #endif
58 
59 	code = waddnwstr(stdscr, wcs, n);
60 
61 	return __m_return_code("addnwstr", code);
62 }
63 
64 #undef mvaddnwstr
65 
66 int
67 mvaddnwstr(y, x, wcs, n)
68 int y, x;
69 const wchar_t *wcs;
70 int n;
71 {
72 	int code;
73 
74 #ifdef M_CURSES_TRACE
75 	__m_trace("mvaddnwstr(%d, %d, %p, %d)", y, x, wcs, n);
76 #endif
77 
78 	if ((code = wmove(stdscr, y, x)) == OK)
79 		code = waddnwstr(stdscr, wcs, n);
80 
81 	return __m_return_code("mvaddnwstr", code);
82 }
83 
84 #undef mvwaddnwstr
85 
86 int
87 mvwaddnwstr(w, y, x, wcs, n)
88 WINDOW *w;
89 int y, x;
90 const wchar_t *wcs;
91 int n;
92 {
93 	int code;
94 
95 #ifdef M_CURSES_TRACE
96 	__m_trace("mvwaddnwstr(%p, %d, %d, %p, %d)", w, y, x, wcs, n);
97 #endif
98 
99 	if ((code = wmove(w, y, x)) == OK)
100 		code = waddnwstr(w, wcs, n);
101 
102 	return __m_return_code("mvwaddnwstr", code);
103 }
104 
105 #undef addwstr
106 
107 int
108 addwstr(wcs)
109 const wchar_t *wcs;
110 {
111 	int code;
112 
113 #ifdef M_CURSES_TRACE
114 	__m_trace("addwstr(%p)", wcs);
115 #endif
116 
117 	code = waddnwstr(stdscr, wcs, -1);
118 
119 	return __m_return_code("addwstr", code);
120 }
121 
122 #undef mvaddwstr
123 
124 int
125 mvaddwstr(y, x, wcs)
126 int y, x;
127 const wchar_t *wcs;
128 {
129 	int code;
130 
131 #ifdef M_CURSES_TRACE
132 	__m_trace("mvaddwstr(%d, %d, %p)", y, x, wcs);
133 #endif
134 
135 	if ((code = wmove(stdscr, y, x)) == OK)
136 		code = waddnwstr(stdscr, wcs, -1);
137 
138 	return __m_return_code("mvaddwstr", code);
139 }
140 
141 #undef mvwaddwstr
142 
143 int
144 mvwaddwstr(w, y, x, wcs)
145 WINDOW *w;
146 int y, x;
147 const wchar_t *wcs;
148 {
149 	int code;
150 
151 #ifdef M_CURSES_TRACE
152 	__m_trace("mvwaddwstr(%p, %d, %d, %p)", w, y, x, wcs);
153 #endif
154 
155 	if ((code = wmove(w, y, x)) == OK)
156 		code = waddnwstr(w, wcs, -1);
157 
158 	return __m_return_code("mvwaddwstr", code);
159 }
160 
161 #undef waddwstr
162 
163 int
164 waddwstr(w, wcs)
165 WINDOW *w;
166 const wchar_t *wcs;
167 {
168 	int code;
169 
170 #ifdef M_CURSES_TRACE
171 	__m_trace("waddwstr(%p, %p)", w, wcs);
172 #endif
173 
174 	code = waddnwstr(w, wcs, -1);
175 
176 	return __m_return_code("waddwstr", code);
177 }
178 
179