xref: /netbsd-src/lib/libc/locale/wcstoul.c (revision dafcd17c4911cb6642aa438986e20e9fe53ff9b6)
1*dafcd17cShubertf /*	$NetBSD: wcstoul.c,v 1.4 2007/03/10 00:12:23 hubertf Exp $	*/
25e700978Sitojun 
35e700978Sitojun /*-
45e700978Sitojun  * Copyright (c)2003 Citrus Project,
55e700978Sitojun  * All rights reserved.
65e700978Sitojun  *
75e700978Sitojun  * Redistribution and use in source and binary forms, with or without
85e700978Sitojun  * modification, are permitted provided that the following conditions
95e700978Sitojun  * are met:
105e700978Sitojun  * 1. Redistributions of source code must retain the above copyright
115e700978Sitojun  *    notice, this list of conditions and the following disclaimer.
125e700978Sitojun  * 2. Redistributions in binary form must reproduce the above copyright
135e700978Sitojun  *    notice, this list of conditions and the following disclaimer in the
145e700978Sitojun  *    documentation and/or other materials provided with the distribution.
155e700978Sitojun  *
165e700978Sitojun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
175e700978Sitojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
185e700978Sitojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
195e700978Sitojun  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
205e700978Sitojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
215e700978Sitojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
225e700978Sitojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
235e700978Sitojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
245e700978Sitojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
255e700978Sitojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
265e700978Sitojun  * SUCH DAMAGE.
275e700978Sitojun  */
28a9c5a86aSyamt 
29a9c5a86aSyamt #include <sys/cdefs.h>
30a9c5a86aSyamt #if defined(LIBC_SCCS) && !defined(lint)
31*dafcd17cShubertf __RCSID("$NetBSD: wcstoul.c,v 1.4 2007/03/10 00:12:23 hubertf Exp $");
32a9c5a86aSyamt #endif /* LIBC_SCCS and not lint */
33a9c5a86aSyamt 
34a9c5a86aSyamt #include <assert.h>
35a9c5a86aSyamt #include <errno.h>
36a9c5a86aSyamt #include <limits.h>
37a9c5a86aSyamt #include <stdlib.h>
38a9c5a86aSyamt #include <wchar.h>
39a9c5a86aSyamt #include <wctype.h>
40a9c5a86aSyamt 
41a9c5a86aSyamt #include "__wctoint.h"
42a9c5a86aSyamt 
433f9925f7Stshiozak #define	_FUNCNAME	wcstoul
443f9925f7Stshiozak #define	__UINT		unsigned long
453f9925f7Stshiozak #define	__UINT_MAX	ULONG_MAX
46a9c5a86aSyamt 
473f9925f7Stshiozak #include "_wcstoul.h"
48