1*14744ddaSdrochner /* $NetBSD: strtouq.c,v 1.20 2008/08/26 12:21:24 drochner Exp $ */ 2bd906777Schristos 3bfc2593aSjtc /*- 4245e0863Sjoerg * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org> 5245e0863Sjoerg * 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 * 16245e0863Sjoerg * 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 19245e0863Sjoerg * 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*14744ddaSdrochner __RCSID("$NetBSD: strtouq.c,v 1.20 2008/08/26 12:21:24 drochner Exp $"); 31bfc2593aSjtc 32b48252f3Slukem #include <assert.h> 33bfc2593aSjtc #include <ctype.h> 34e0c0c474Smycroft #include <errno.h> 35e0c0c474Smycroft #include <limits.h> 36245e0863Sjoerg #include <stdint.h> 37bfc2593aSjtc #include <stdlib.h> 38bfc2593aSjtc 39245e0863Sjoerg #define _FUNCNAME strtouq 40245e0863Sjoerg #define __UINT u_quad_t 41*14744ddaSdrochner #define __UINT_MAX UQUAD_MAX 4251c4c84eSmycroft 43245e0863Sjoerg #include "_strtoul.h" 44