11.4Sjoerg/* $NetBSD: citrus_bcs_strtoul.c,v 1.5 2013/04/26 21:20:48 joerg Exp $ */
21.1Stnozaki
31.1Stnozaki/*-
41.1Stnozaki * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
51.1Stnozaki * Copyright (c) 2003, 2008 Citrus Project,
61.1Stnozaki * All rights reserved.
71.1Stnozaki *
81.1Stnozaki * Redistribution and use in source and binary forms, with or without
91.1Stnozaki * modification, are permitted provided that the following conditions
101.1Stnozaki * are met:
111.1Stnozaki * 1. Redistributions of source code must retain the above copyright
121.1Stnozaki *    notice, this list of conditions and the following disclaimer.
131.1Stnozaki * 2. Redistributions in binary form must reproduce the above copyright
141.1Stnozaki *    notice, this list of conditions and the following disclaimer in the
151.1Stnozaki *    documentation and/or other materials provided with the distribution.
161.1Stnozaki *
171.1Stnozaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
181.1Stnozaki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191.1Stnozaki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201.1Stnozaki * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
211.1Stnozaki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221.1Stnozaki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231.1Stnozaki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241.1Stnozaki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251.1Stnozaki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261.1Stnozaki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271.1Stnozaki * SUCH DAMAGE.
281.1Stnozaki */
291.1Stnozaki
301.2Sdogcow#if HAVE_NBTOOL_CONFIG_H
311.2Sdogcow#include "nbtool_config.h"
321.2Sdogcow#endif
331.2Sdogcow
341.1Stnozaki#include <sys/cdefs.h>
351.1Stnozaki#if !defined(lint)
361.4Sjoerg__RCSID("$NetBSD: citrus_bcs_strtoul.c,v 1.5 2013/04/26 21:20:48 joerg Exp $");
371.1Stnozaki#endif /* not lint */
381.1Stnozaki
391.1Stnozaki#include <assert.h>
401.1Stnozaki#include <errno.h>
411.1Stnozaki#include <limits.h>
421.1Stnozaki#include <stdint.h>
431.1Stnozaki#include <stdlib.h>
441.1Stnozaki
451.1Stnozaki#include "citrus_namespace.h"
461.1Stnozaki#include "citrus_bcs.h"
471.1Stnozaki
481.5Sjoerg#define	BCS_ONLY
491.5Sjoerg
501.5Sjoerg#define	_FUNCNAME	_bcs_strtoul
511.5Sjoerg#define	__UINT		unsigned long int
521.5Sjoerg#define	__UINT_MAX	ULONG_MAX
531.5Sjoerg
541.5Sjoerg#undef isspace
551.5Sjoerg#define isspace(c)	_bcs_isspace(c)
561.5Sjoerg
571.5Sjoerg#undef isdigit
581.5Sjoerg#define isdigit(c)	_bcs_isdigit(c)
591.5Sjoerg
601.5Sjoerg#undef isalpha
611.5Sjoerg#define isalpha(c)	_bcs_isalpha(c)
621.5Sjoerg
631.5Sjoerg#undef isupper
641.5Sjoerg#define isupper(c)	_bcs_isupper(c)
651.5Sjoerg
661.5Sjoerg#include "_strtoul.h"
67