xref: /netbsd-src/lib/libc/stdlib/strtoq.c (revision 245e0863216f2e322e734df6d0e4602535807ffa)
1*245e0863Sjoerg /* $NetBSD: strtoq.c,v 1.19 2008/08/20 12:42:26 joerg Exp $ */
2bd906777Schristos 
3bfc2593aSjtc /*-
4*245e0863Sjoerg  * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>
5*245e0863Sjoerg  * All rights reserved.
6bfc2593aSjtc  *
7bfc2593aSjtc  * Redistribution and use in source and binary forms, with or without
8bfc2593aSjtc  * modification, are permitted provided that the following conditions
9bfc2593aSjtc  * are met:
10bfc2593aSjtc  * 1. Redistributions of source code must retain the above copyright
11bfc2593aSjtc  *    notice, this list of conditions and the following disclaimer.
12bfc2593aSjtc  * 2. Redistributions in binary form must reproduce the above copyright
13bfc2593aSjtc  *    notice, this list of conditions and the following disclaimer in the
14bfc2593aSjtc  *    documentation and/or other materials provided with the distribution.
15bfc2593aSjtc  *
16*245e0863Sjoerg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17bfc2593aSjtc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18bfc2593aSjtc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*245e0863Sjoerg  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20bfc2593aSjtc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21bfc2593aSjtc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22bfc2593aSjtc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23bfc2593aSjtc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24bfc2593aSjtc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25bfc2593aSjtc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26bfc2593aSjtc  * SUCH DAMAGE.
27bfc2593aSjtc  */
28bfc2593aSjtc 
29bd906777Schristos #include <sys/cdefs.h>
30*245e0863Sjoerg __RCSID("$NetBSD: strtoq.c,v 1.19 2008/08/20 12:42:26 joerg Exp $");
31bfc2593aSjtc 
32b48252f3Slukem #include <assert.h>
33bfc2593aSjtc #include <ctype.h>
34e0c0c474Smycroft #include <errno.h>
35e0c0c474Smycroft #include <limits.h>
36*245e0863Sjoerg #include <stdint.h>
37bfc2593aSjtc #include <stdlib.h>
38bfc2593aSjtc 
39*245e0863Sjoerg #define	_FUNCNAME	strtoq
40*245e0863Sjoerg #define	__INT		quad_t
41*245e0863Sjoerg #define	__INT_MIN	QUAD_MIN
42*245e0863Sjoerg #define	__INT_MAX	QUAD_MAX
43bfc2593aSjtc 
44*245e0863Sjoerg #include "_strtol.h"
45