xref: /dflybsd-src/lib/libc/stdlib/strtoull.c (revision bc02bad172f588200885c1808f9320d55d94343a)
1984263bcSMatthew Dillon /*-
20b801f32SJoerg Sonnenberger  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
3d06bfb1eSJoerg Sonnenberger  * Copyright (c) 2003 Citrus Project,
4d06bfb1eSJoerg Sonnenberger  * All rights reserved.
5984263bcSMatthew Dillon  *
6984263bcSMatthew Dillon  * Redistribution and use in source and binary forms, with or without
7984263bcSMatthew Dillon  * modification, are permitted provided that the following conditions
8984263bcSMatthew Dillon  * are met:
9984263bcSMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
10984263bcSMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
11984263bcSMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
12984263bcSMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
13984263bcSMatthew Dillon  *    documentation and/or other materials provided with the distribution.
14984263bcSMatthew Dillon  *
15d06bfb1eSJoerg Sonnenberger  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16984263bcSMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17984263bcSMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18d06bfb1eSJoerg Sonnenberger  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19984263bcSMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20984263bcSMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21984263bcSMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22984263bcSMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23984263bcSMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24984263bcSMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25984263bcSMatthew Dillon  * SUCH DAMAGE.
26984263bcSMatthew Dillon  */
27984263bcSMatthew Dillon 
28d06bfb1eSJoerg Sonnenberger #include <assert.h>
29984263bcSMatthew Dillon #include <ctype.h>
30d06bfb1eSJoerg Sonnenberger #include <errno.h>
31d06bfb1eSJoerg Sonnenberger #include <limits.h>
32d06bfb1eSJoerg Sonnenberger #include <stdint.h>
33984263bcSMatthew Dillon #include <stdlib.h>
34*dd5515b8SJoris Giovannangeli #include "xlocale_private.h"
35984263bcSMatthew Dillon 
36d06bfb1eSJoerg Sonnenberger #define	_FUNCNAME	strtoull
37d06bfb1eSJoerg Sonnenberger #define	__UINT		unsigned long long int
38d06bfb1eSJoerg Sonnenberger #define	__UINT_MAX	ULLONG_MAX
39984263bcSMatthew Dillon 
40d06bfb1eSJoerg Sonnenberger #include "_strtoul.h"
41