xref: /freebsd-src/include/inttypes.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
10ac2d551SMike Barcroft /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3e58eb3c4SPedro F. Giffuni  *
40ac2d551SMike Barcroft  * Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
50ac2d551SMike Barcroft  * All rights reserved.
60ac2d551SMike Barcroft  *
70ac2d551SMike Barcroft  * Redistribution and use in source and binary forms, with or without
80ac2d551SMike Barcroft  * modification, are permitted provided that the following conditions
90ac2d551SMike Barcroft  * are met:
100ac2d551SMike Barcroft  * 1. Redistributions of source code must retain the above copyright
110ac2d551SMike Barcroft  *    notice, this list of conditions and the following disclaimer.
120ac2d551SMike Barcroft  * 2. Redistributions in binary form must reproduce the above copyright
130ac2d551SMike Barcroft  *    notice, this list of conditions and the following disclaimer in the
140ac2d551SMike Barcroft  *    documentation and/or other materials provided with the distribution.
150ac2d551SMike Barcroft  *
160ac2d551SMike Barcroft  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
170ac2d551SMike Barcroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
180ac2d551SMike Barcroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
190ac2d551SMike Barcroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
200ac2d551SMike Barcroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
210ac2d551SMike Barcroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
220ac2d551SMike Barcroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
230ac2d551SMike Barcroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
240ac2d551SMike Barcroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
250ac2d551SMike Barcroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
260ac2d551SMike Barcroft  * SUCH DAMAGE.
270ac2d551SMike Barcroft  */
280ac2d551SMike Barcroft 
290ac2d551SMike Barcroft #ifndef _INTTYPES_H_
300ac2d551SMike Barcroft #define	_INTTYPES_H_
310ac2d551SMike Barcroft 
320ac2d551SMike Barcroft #include <machine/_inttypes.h>
330ac2d551SMike Barcroft #include <sys/stdint.h>
340ac2d551SMike Barcroft 
35745b1875SJuli Mallett #ifndef	__cplusplus
36745b1875SJuli Mallett #ifndef _WCHAR_T_DECLARED
370a4c54d6STijl Coosemans typedef	___wchar_t	wchar_t;
38745b1875SJuli Mallett #define	_WCHAR_T_DECLARED
39745b1875SJuli Mallett #endif
40745b1875SJuli Mallett #endif
41745b1875SJuli Mallett 
420ac2d551SMike Barcroft typedef struct {
430ac2d551SMike Barcroft 	intmax_t	quot;		/* Quotient. */
440ac2d551SMike Barcroft 	intmax_t	rem;		/* Remainder. */
450ac2d551SMike Barcroft } imaxdiv_t;
460ac2d551SMike Barcroft 
476304c952SMike Barcroft __BEGIN_DECLS
483ac9d659SDavid Chisnall #ifdef _XLOCALE_H_
493ac9d659SDavid Chisnall #include <xlocale/_inttypes.h>
503ac9d659SDavid Chisnall #endif
517a4a6327SMike Barcroft intmax_t	imaxabs(intmax_t) __pure2;
527a4a6327SMike Barcroft imaxdiv_t	imaxdiv(intmax_t, intmax_t) __pure2;
530ac2d551SMike Barcroft 
545618f724SRobert Drehmel intmax_t	strtoimax(const char * __restrict, char ** __restrict, int);
555618f724SRobert Drehmel uintmax_t	strtoumax(const char * __restrict, char ** __restrict, int);
56745b1875SJuli Mallett intmax_t	wcstoimax(const wchar_t * __restrict,
57745b1875SJuli Mallett 		    wchar_t ** __restrict, int);
58745b1875SJuli Mallett uintmax_t	wcstoumax(const wchar_t * __restrict,
59745b1875SJuli Mallett 		    wchar_t ** __restrict, int);
606304c952SMike Barcroft __END_DECLS
610ac2d551SMike Barcroft 
620ac2d551SMike Barcroft #endif /* !_INTTYPES_H_ */
63