185892Smike/*-
285892Smike * Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
385892Smike * All rights reserved.
485892Smike *
585892Smike * Redistribution and use in source and binary forms, with or without
685892Smike * modification, are permitted provided that the following conditions
785892Smike * are met:
885892Smike * 1. Redistributions of source code must retain the above copyright
985892Smike *    notice, this list of conditions and the following disclaimer.
1085892Smike * 2. Redistributions in binary form must reproduce the above copyright
1185892Smike *    notice, this list of conditions and the following disclaimer in the
1285892Smike *    documentation and/or other materials provided with the distribution.
1385892Smike *
1485892Smike * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1585892Smike * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1685892Smike * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1785892Smike * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1885892Smike * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1985892Smike * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2085892Smike * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2185892Smike * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2285892Smike * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2385892Smike * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2485892Smike * SUCH DAMAGE.
2585892Smike *
2685892Smike * $FreeBSD$
2785892Smike */
2885892Smike
2985892Smike#ifndef _INTTYPES_H_
3085892Smike#define	_INTTYPES_H_
3185892Smike
3285892Smike#include <machine/_inttypes.h>
3385892Smike#include <sys/stdint.h>
3485892Smike
35205954Sjmallett#ifndef	__cplusplus
36205954Sjmallett#ifndef _WCHAR_T_DECLARED
37263998Stijltypedef	___wchar_t	wchar_t;
38205954Sjmallett#define	_WCHAR_T_DECLARED
39205954Sjmallett#endif
40205954Sjmallett#endif
41205954Sjmallett
4285892Smiketypedef struct {
4385892Smike	intmax_t	quot;		/* Quotient. */
4485892Smike	intmax_t	rem;		/* Remainder. */
4585892Smike} imaxdiv_t;
4685892Smike
4788962Smike__BEGIN_DECLS
48233600Stheraven#ifdef _XLOCALE_H_
49233600Stheraven#include <xlocale/_inttypes.h>
50233600Stheraven#endif
5186368Smikeintmax_t	imaxabs(intmax_t) __pure2;
5286368Smikeimaxdiv_t	imaxdiv(intmax_t, intmax_t) __pure2;
5385892Smike
54103012Stjrintmax_t	strtoimax(const char * __restrict, char ** __restrict, int);
55103012Stjruintmax_t	strtoumax(const char * __restrict, char ** __restrict, int);
56205954Sjmallettintmax_t	wcstoimax(const wchar_t * __restrict,
57205954Sjmallett		    wchar_t ** __restrict, int);
58205954Sjmallettuintmax_t	wcstoumax(const wchar_t * __restrict,
59205954Sjmallett		    wchar_t ** __restrict, int);
6088962Smike__END_DECLS
6185892Smike
6285892Smike#endif /* !_INTTYPES_H_ */
63