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-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /* LINTLIBRARY */
30 
31 /*
32  * innstr.c
33  *
34  * XCurses Library
35  *
36  * Copyright 1990, 1995 by Mortice Kern Systems Inc.  All rights reserved.
37  *
38  */
39 
40 #if M_RCSID
41 #ifndef lint
42 static char rcsID[] =
43 "$Header: /team/ps/sun_xcurses/archive/local_changes/xcurses/src/lib/"
44 "libxcurses/src/libc/xcurses/rcs/innstr.c 1.2 1998/04/30 20:30:22 "
45 "cbates Exp $";
46 #endif
47 #endif
48 
49 #include <private.h>
50 
51 #undef innstr
52 
53 int
54 innstr(char *s, int n)
55 {
56 	int code;
57 
58 	code = winnstr(stdscr, s, n);
59 
60 	return (code);
61 }
62 
63 #undef mvinnstr
64 
65 int
66 mvinnstr(int y, int x, char *s, int n)
67 {
68 	int code;
69 
70 	if ((code = wmove(stdscr, y, x)) == OK)
71 		code = winnstr(stdscr, s, n);
72 
73 	return (code);
74 }
75 
76 #undef mvwinnstr
77 
78 int
79 mvwinnstr(WINDOW *w, int y, int x, char *s, int n)
80 {
81 	int code;
82 
83 	if ((code = wmove(w, y, x)) == OK)
84 		code = winnstr(w, s, n);
85 
86 	return (code);
87 }
88 
89 #undef instr
90 
91 int
92 instr(char *s)
93 {
94 	int code;
95 
96 	code = winnstr(stdscr, s, -1);
97 
98 	return ((code == ERR) ? ERR : OK);
99 }
100 
101 #undef mvinstr
102 
103 int
104 mvinstr(int y, int x, char *s)
105 {
106 	int code;
107 
108 	if ((code = wmove(stdscr, y, x)) == OK)
109 		code = winnstr(stdscr, s, -1);
110 
111 	return ((code == ERR) ? ERR : OK);
112 }
113 
114 #undef mvwinstr
115 
116 int
117 mvwinstr(WINDOW *w, int y, int x, char *s)
118 {
119 	int code;
120 
121 	if ((code = wmove(w, y, x)) == OK)
122 		code = winnstr(w, s, -1);
123 
124 	return ((code == ERR) ? ERR : OK);
125 }
126 
127 #undef winstr
128 
129 int
130 winstr(WINDOW *w, char *s)
131 {
132 	int	code;
133 
134 	code = winnstr(w, s, -1);
135 
136 	return ((code == ERR) ? ERR : OK);
137 }
138