inttypes.h revision 233600
1151912Sphk/*- 2151912Sphk * Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org> 3209440Smav * All rights reserved. 4151912Sphk * 5151912Sphk * Redistribution and use in source and binary forms, with or without 6151912Sphk * modification, are permitted provided that the following conditions 7151912Sphk * are met: 8151912Sphk * 1. Redistributions of source code must retain the above copyright 9151912Sphk * notice, this list of conditions and the following disclaimer. 10151912Sphk * 2. Redistributions in binary form must reproduce the above copyright 11151912Sphk * notice, this list of conditions and the following disclaimer in the 12151912Sphk * documentation and/or other materials provided with the distribution. 13151912Sphk * 14151912Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15151912Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16151912Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17151912Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18151912Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19151912Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20151912Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21151912Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22151912Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23151912Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24151912Sphk * SUCH DAMAGE. 25151912Sphk * 26151912Sphk * $FreeBSD: head/include/inttypes.h 233600 2012-03-28 12:11:54Z theraven $ 27151912Sphk */ 28151912Sphk 29151912Sphk#ifndef _INTTYPES_H_ 30151912Sphk#define _INTTYPES_H_ 31151912Sphk 32209402Smav#include <machine/_inttypes.h> 33209371Smav#include <sys/stdint.h> 34209371Smav 35209371Smav#ifndef __cplusplus 36209371Smav#ifndef _WCHAR_T_DECLARED 37151912Sphktypedef __wchar_t wchar_t; 38159217Snjl#define _WCHAR_T_DECLARED 39151912Sphk#endif 40151912Sphk#endif 41209371Smav 42151912Sphktypedef struct { 43151912Sphk intmax_t quot; /* Quotient. */ 44209371Smav intmax_t rem; /* Remainder. */ 45209371Smav} imaxdiv_t; 46209371Smav 47151912Sphk__BEGIN_DECLS 48159217Snjl#ifdef _XLOCALE_H_ 49193530Sjkim#include <xlocale/_inttypes.h> 50193530Sjkim#endif 51193530Sjkimintmax_t imaxabs(intmax_t) __pure2; 52151912Sphkimaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; 53175385Sjhb 54151912Sphkintmax_t strtoimax(const char * __restrict, char ** __restrict, int); 55209371Smavuintmax_t strtoumax(const char * __restrict, char ** __restrict, int); 56209371Smavintmax_t wcstoimax(const wchar_t * __restrict, 57209371Smav wchar_t ** __restrict, int); 58209371Smavuintmax_t wcstoumax(const wchar_t * __restrict, 59203062Savg wchar_t ** __restrict, int); 60240286Smav__END_DECLS 61203062Savg 62213302Smav#endif /* !_INTTYPES_H_ */ 63232797Smav