strtoull.c revision 1.5
11.5Sjoerg/* $NetBSD: strtoull.c,v 1.5 2008/09/10 18:08:58 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.5Sjoerg#if HAVE_NBTOOL_CONFIG_H
311.5Sjoerg#include "nbtool_config.h"
321.5Sjoerg#endif
331.5Sjoerg
341.1Sthorpej#include <sys/cdefs.h>
351.5Sjoerg__RCSID("$NetBSD: strtoull.c,v 1.5 2008/09/10 18:08:58 joerg Exp $");
361.4Smatt
371.4Smatt#ifdef _LIBC
381.4Smatt#include "namespace.h"
391.4Smatt#endif
401.1Sthorpej
411.3Soster#if defined(_KERNEL)
421.3Soster#include <sys/param.h>
431.3Soster#include <lib/libkern/libkern.h>
441.3Soster#elif defined(_STANDALONE)
451.3Soster#include <sys/param.h>
461.3Soster#include <lib/libkern/libkern.h>
471.3Soster#include <lib/libsa/stand.h>
481.3Soster#else
491.1Sthorpej#include <assert.h>
501.1Sthorpej#include <ctype.h>
511.1Sthorpej#include <errno.h>
521.1Sthorpej#include <limits.h>
531.2Sjoerg#include <stdint.h>
541.1Sthorpej#include <stdlib.h>
551.1Sthorpej#endif
561.1Sthorpej
571.2Sjoerg#define	_FUNCNAME	strtoull
581.2Sjoerg#define	__UINT		unsigned long long int
591.2Sjoerg#define	__UINT_MAX	ULLONG_MAX
601.2Sjoerg
611.2Sjoerg#include "_strtoul.h"
621.2Sjoerg
631.4Smatt#ifdef _LIBC
641.4Smatt__weak_alias(strtoull, _strtoull)
651.1Sthorpej#endif
66