inttypes.h revision 103012
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: head/include/inttypes.h 103012 2002-09-06 11:24:06Z tjr $
2785892Smike */
2885892Smike
2985892Smike#ifndef _INTTYPES_H_
3085892Smike#define	_INTTYPES_H_
3185892Smike
3285892Smike#include <machine/_inttypes.h>
3385892Smike#include <sys/stdint.h>
3485892Smike
3599640Sobrien#ifndef	__cplusplus
36102227Smike#ifndef _WCHAR_T_DECLARED
37102227Smiketypedef	__wchar_t	wchar_t;
38102227Smike#define	_WCHAR_T_DECLARED
3985892Smike#endif
4099640Sobrien#endif
4185892Smike
4285892Smiketypedef struct {
4385892Smike	intmax_t	quot;		/* Quotient. */
4485892Smike	intmax_t	rem;		/* Remainder. */
4585892Smike} imaxdiv_t;
4685892Smike
4788962Smike__BEGIN_DECLS
4886368Smikeintmax_t	imaxabs(intmax_t) __pure2;
4986368Smikeimaxdiv_t	imaxdiv(intmax_t, intmax_t) __pure2;
5085892Smike
51103012Stjrintmax_t	strtoimax(const char * __restrict, char ** __restrict, int);
52103012Stjruintmax_t	strtoumax(const char * __restrict, char ** __restrict, int);
5385892Smike/* XXX: The following functions are missing the restrict type qualifier. */
5485892Smikeintmax_t	wcstoimax(const wchar_t *, wchar_t **, int);
5585892Smikeuintmax_t	wcstoumax(const wchar_t *, wchar_t **, int);
5688962Smike__END_DECLS
5785892Smike
5885892Smike#endif /* !_INTTYPES_H_ */
59