xref: /openbsd-src/lib/libc/stdio/getwchar.c (revision 3873297b3ceb92a1a9dda56e7a1c900b37c83638)
1*3873297bSjsg /*	$OpenBSD: getwchar.c,v 1.3 2021/10/24 10:05:23 jsg Exp $	*/
2c2fb3212Sespie /* $NetBSD: getwchar.c,v 1.2 2003/01/18 11:29:55 thorpej Exp $ */
3c2fb3212Sespie 
4c2fb3212Sespie /*-
5c2fb3212Sespie  * Copyright (c)2001 Citrus Project,
6c2fb3212Sespie  * All rights reserved.
7c2fb3212Sespie  *
8c2fb3212Sespie  * Redistribution and use in source and binary forms, with or without
9c2fb3212Sespie  * modification, are permitted provided that the following conditions
10c2fb3212Sespie  * are met:
11c2fb3212Sespie  * 1. Redistributions of source code must retain the above copyright
12c2fb3212Sespie  *    notice, this list of conditions and the following disclaimer.
13c2fb3212Sespie  * 2. Redistributions in binary form must reproduce the above copyright
14c2fb3212Sespie  *    notice, this list of conditions and the following disclaimer in the
15c2fb3212Sespie  *    documentation and/or other materials provided with the distribution.
16c2fb3212Sespie  *
17c2fb3212Sespie  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18c2fb3212Sespie  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19c2fb3212Sespie  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20c2fb3212Sespie  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21c2fb3212Sespie  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22c2fb3212Sespie  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23c2fb3212Sespie  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24c2fb3212Sespie  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25c2fb3212Sespie  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26c2fb3212Sespie  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27c2fb3212Sespie  * SUCH DAMAGE.
28c2fb3212Sespie  *
29c2fb3212Sespie  * $Citrus$
30c2fb3212Sespie  */
31c2fb3212Sespie 
32c2fb3212Sespie #include <stdio.h>
33c2fb3212Sespie #include <wchar.h>
34c2fb3212Sespie 
35c2fb3212Sespie /*
36c2fb3212Sespie  * A subroutine version of the macro getwchar.
37c2fb3212Sespie  */
38c2fb3212Sespie #undef getwchar
39c2fb3212Sespie 
40c2fb3212Sespie wint_t
getwchar(void)41*3873297bSjsg getwchar(void)
42c2fb3212Sespie {
43c2fb3212Sespie 
44c2fb3212Sespie 	return fgetwc(stdin);
45c2fb3212Sespie }
469b9d2a55Sguenther DEF_STRONG(getwchar);
47