xref: /illumos-gate/usr/src/lib/libxcurses/src/libc/xcurses/addwchn.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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  * addwchn.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/addwchn.c 1.1 1995/05/30 13:39:41 ant Exp $";
41 #endif
42 #endif
43 
44 #include <private.h>
45 
46 #undef add_wchnstr
47 
48 int
49 add_wchnstr(ccs, n)
50 const cchar_t *ccs;
51 int n;
52 {
53 	int code;
54 
55 #ifdef M_CURSES_TRACE
56 	__m_trace("add_wchnstr(%p, %d)", ccs, n);
57 #endif
58 
59 	code = wadd_wchnstr(stdscr, ccs, n);
60 
61 	return __m_return_code("add_wchnstr", code);
62 }
63 
64 #undef mvadd_wchnstr
65 
66 int
67 mvadd_wchnstr(y, x, ccs, n)
68 int y, x;
69 const cchar_t *ccs;
70 int n;
71 {
72 	int code;
73 
74 #ifdef M_CURSES_TRACE
75 	__m_trace("mvadd_wchnstr(%d, %d, %p, %d)", y, x, ccs, n);
76 #endif
77 
78 	if ((code = wmove(stdscr, y, x)) == OK)
79 		code = wadd_wchnstr(stdscr, ccs, n);
80 
81 	return __m_return_code("mvadd_wchnstr", code);
82 }
83 
84 #undef mvwadd_wchnstr
85 
86 int
87 mvwadd_wchnstr(w, y, x, ccs, n)
88 WINDOW *w;
89 int y, x;
90 const cchar_t *ccs;
91 int n;
92 {
93 	int code;
94 
95 #ifdef M_CURSES_TRACE
96 	__m_trace("mvwadd_wchnstr(%p, %d, %d, %p, %d)", w, y, x, ccs, n);
97 #endif
98 
99 	if ((code = wmove(w, y, x)) == OK)
100 		code = wadd_wchnstr(w, ccs, n);
101 
102 	return __m_return_code("mvwadd_wchnstr", code);
103 }
104 
105 #undef add_wchstr
106 
107 int
108 add_wchstr(ccs)
109 const cchar_t *ccs;
110 {
111 	int code;
112 
113 #ifdef M_CURSES_TRACE
114 	__m_trace("add_wchstr(%p)", ccs);
115 #endif
116 
117 	code = wadd_wchnstr(stdscr, ccs, -1);
118 
119 	return __m_return_code("add_wchstr", code);
120 }
121 
122 #undef mvadd_wchstr
123 
124 int
125 mvadd_wchstr(y, x, ccs)
126 int y, x;
127 const cchar_t *ccs;
128 {
129 	int code;
130 
131 #ifdef M_CURSES_TRACE
132 	__m_trace("mvadd_wchstr(%d, %d, %p)", y, x, ccs);
133 #endif
134 
135 	if ((code = wmove(stdscr, y, x)) == OK)
136 		code = wadd_wchnstr(stdscr, ccs, -1);
137 
138 	return __m_return_code("mvadd_wchstr", code);
139 }
140 
141 #undef mvwadd_wchstr
142 
143 int
144 mvwadd_wchstr(w, y, x, ccs)
145 WINDOW *w;
146 int y, x;
147 const cchar_t *ccs;
148 {
149 	int code;
150 
151 #ifdef M_CURSES_TRACE
152 	__m_trace("mvwadd_wchstr(%p, %d, %d, %p)", w, y, x, ccs);
153 #endif
154 
155 	if ((code = wmove(w, y, x)) == OK)
156 		code = wadd_wchnstr(w, ccs, -1);
157 
158 	return __m_return_code("mvwadd_wchstr", code);
159 }
160 
161 #undef wadd_wchstr
162 
163 int
164 wadd_wchstr(w, ccs)
165 WINDOW *w;
166 const cchar_t *ccs;
167 {
168 	int code;
169 
170 #ifdef M_CURSES_TRACE
171 	__m_trace("wadd_wchstr(%p, %p)", w, ccs);
172 #endif
173 
174 	code = wadd_wchnstr(w, ccs, -1);
175 
176 	return __m_return_code("wadd_wchstr", code);
177 }
178 
179