xref: /dflybsd-src/contrib/dhcpcd/compat/strtou.c (revision 6e63cc1f9bd88f540fc1d20551f8a802f663f025)
1*6e63cc1fSRoy Marples /*	$NetBSD: strtou.c,v 1.3 2019/11/28 12:33:23 roy Exp $	*/
27827cba2SAaron LI 
37827cba2SAaron LI /*-
47827cba2SAaron LI  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
57827cba2SAaron LI  * Copyright (c) 2003 Citrus Project,
67827cba2SAaron LI  * All rights reserved.
77827cba2SAaron LI  *
87827cba2SAaron LI  * Redistribution and use in source and binary forms, with or without
97827cba2SAaron LI  * modification, are permitted provided that the following conditions
107827cba2SAaron LI  * are met:
117827cba2SAaron LI  * 1. Redistributions of source code must retain the above copyright
127827cba2SAaron LI  *    notice, this list of conditions and the following disclaimer.
137827cba2SAaron LI  * 2. Redistributions in binary form must reproduce the above copyright
147827cba2SAaron LI  *    notice, this list of conditions and the following disclaimer in the
157827cba2SAaron LI  *    documentation and/or other materials provided with the distribution.
167827cba2SAaron LI  *
177827cba2SAaron LI  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
187827cba2SAaron LI  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
197827cba2SAaron LI  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
207827cba2SAaron LI  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
217827cba2SAaron LI  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
227827cba2SAaron LI  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
237827cba2SAaron LI  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
247827cba2SAaron LI  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
257827cba2SAaron LI  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
267827cba2SAaron LI  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
277827cba2SAaron LI  * SUCH DAMAGE.
287827cba2SAaron LI  *
297827cba2SAaron LI  * Created by Kamil Rytarowski, based on ID:
307827cba2SAaron LI  * NetBSD: src/common/lib/libc/stdlib/strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp
317827cba2SAaron LI  */
327827cba2SAaron LI 
33*6e63cc1fSRoy Marples #ifdef _LIBC
347827cba2SAaron LI #include "namespace.h"
357827cba2SAaron LI #endif
367827cba2SAaron LI 
377827cba2SAaron LI #if defined(_KERNEL)
387827cba2SAaron LI #include <sys/param.h>
397827cba2SAaron LI #include <sys/types.h>
407827cba2SAaron LI #include <lib/libkern/libkern.h>
417827cba2SAaron LI #elif defined(_STANDALONE)
427827cba2SAaron LI #include <sys/param.h>
437827cba2SAaron LI #include <sys/types.h>
447827cba2SAaron LI #include <lib/libkern/libkern.h>
457827cba2SAaron LI #include <lib/libsa/stand.h>
467827cba2SAaron LI #else
477827cba2SAaron LI #include <stddef.h>
487827cba2SAaron LI #include <assert.h>
497827cba2SAaron LI #include <errno.h>
507827cba2SAaron LI #include <inttypes.h>
517827cba2SAaron LI #endif
527827cba2SAaron LI 
537827cba2SAaron LI #include "strtoi.h"
547827cba2SAaron LI 
557827cba2SAaron LI #define	_FUNCNAME	strtou
567827cba2SAaron LI #define	__TYPE		uintmax_t
577827cba2SAaron LI #define	__WRAPPED	strtoumax
587827cba2SAaron LI 
597827cba2SAaron LI #include "_strtoi.h"
607827cba2SAaron LI 
617827cba2SAaron LI #ifdef _LIBC
627827cba2SAaron LI __weak_alias(strtou, _strtou)
637827cba2SAaron LI __weak_alias(strtou_l, _strtou_l)
647827cba2SAaron LI #endif
657827cba2SAaron LI