strtoumax.c revision 1.2
11.2Sjoerg/* $NetBSD: strtoumax.c,v 1.2 2008/08/20 12:42:26 joerg Exp $ */
21.1Sthorpej
31.2Sjoerg/*-
41.2Sjoerg * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
51.2Sjoerg * Copyright (c) 2003 Citrus Project,
61.2Sjoerg * All rights reserved.
71.1Sthorpej *
81.1Sthorpej * Redistribution and use in source and binary forms, with or without
91.1Sthorpej * modification, are permitted provided that the following conditions
101.1Sthorpej * are met:
111.1Sthorpej * 1. Redistributions of source code must retain the above copyright
121.1Sthorpej *    notice, this list of conditions and the following disclaimer.
131.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
141.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
151.1Sthorpej *    documentation and/or other materials provided with the distribution.
161.1Sthorpej *
171.2Sjoerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
181.1Sthorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191.1Sthorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201.2Sjoerg * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
211.1Sthorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221.1Sthorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231.1Sthorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241.1Sthorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251.1Sthorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261.1Sthorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271.1Sthorpej * SUCH DAMAGE.
281.1Sthorpej */
291.1Sthorpej
301.1Sthorpej#include <sys/cdefs.h>
311.2Sjoerg__RCSID("$NetBSD: strtoumax.c,v 1.2 2008/08/20 12:42:26 joerg Exp $");
321.1Sthorpej
331.2Sjoerg#if !defined(_KERNEL) && !defined(_STANDALONE)
341.1Sthorpej#include <assert.h>
351.1Sthorpej#include <ctype.h>
361.1Sthorpej#include <errno.h>
371.2Sjoerg#include <limits.h>
381.1Sthorpej#include <inttypes.h>
391.2Sjoerg#include <stdint.h>
401.2Sjoerg#include <stdlib.h>
411.2Sjoerg#else
421.2Sjoerg#include <sys/param.h>
431.2Sjoerg#include <lib/libkern/libkern.h>
441.2Sjoerg#endif
451.1Sthorpej
461.2Sjoerg#define	_FUNCNAME	strtoumax
471.2Sjoerg#define	__UINT		uintmax_t
481.2Sjoerg#define	__UINT_MAX	UINTMAX_MAX
491.1Sthorpej
501.2Sjoerg#include "_strtoul.h"
511.1Sthorpej
521.2Sjoerg#if !defined(_KERNEL) && !defined(_STANDALONE)
531.2Sjoerg__strong_alias(_strtoumax, strtoumax)
541.1Sthorpej#endif
55