1/* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
4 *
5 * inttypes.i
6 *
7 * SWIG library file  for ISO C99 types: 7.8 Format conversion of integer types <inttypes.h>
8 * ----------------------------------------------------------------------------- */
9
10%{
11#include <inttypes.h>
12%}
13
14%include <stdint.i>
15%include <wchar.i>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#ifdef SWIGWORDSIZE64
22
23  /* We have to define the `uintmax_t' type using `ldiv_t'.  */
24  typedef struct
25  {
26    long int quot;		/* Quotient.  */
27    long int rem;		/* Remainder.  */
28  } imaxdiv_t;
29
30#else
31
32  /* We have to define the `uintmax_t' type using `lldiv_t'.  */
33  typedef struct
34  {
35    long long int quot;		/* Quotient.  */
36    long long int rem;		/* Remainder.  */
37  } imaxdiv_t;
38
39#endif
40
41  /* Compute absolute value of N.  */
42  extern intmax_t imaxabs (intmax_t n);
43
44  /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
45  extern imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
46
47  /* Like `strtol' but convert to `intmax_t'.  */
48  extern intmax_t strtoimax (const char *nptr, char **endptr, int base);
49
50  /* Like `strtoul' but convert to `uintmax_t'.  */
51  extern uintmax_t strtoumax (const char *nptr, char ** endptr, int base);
52
53#ifdef SWIG_WCHAR
54  /* Like `wcstol' but convert to `intmax_t'.  */
55  extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base);
56
57  /* Like `wcstoul' but convert to `uintmax_t'.  */
58  extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t ** endptr, int base);
59#endif
60
61#ifdef SWIGWORDSIZE64
62
63  /* Like `strtol' but convert to `intmax_t'.  */
64  extern  intmax_t strtoimax (const char *nptr, char **endptr, int base);
65
66  /* Like `strtoul' but convert to `uintmax_t'.  */
67  extern  uintmax_t strtoumax (const char *nptr, char **endptr,int base);
68
69#ifdef SWIG_WCHAR
70  /* Like `wcstol' but convert to `intmax_t'.  */
71  extern  intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base);
72
73  /* Like `wcstoul' but convert to `uintmax_t'.  */
74  extern  uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base);
75#endif
76
77#else /* SWIGWORDSIZE32 */
78
79  /* Like `strtol' but convert to `intmax_t'.  */
80  extern  intmax_t strtoimax (const char *nptr, char **endptr, int base);
81
82  /* Like `strtoul' but convert to `uintmax_t'.  */
83  extern  uintmax_t strtoumax (const char *nptr, char **endptr, int base);
84
85#ifdef SWIG_WCHAR
86  /* Like `wcstol' but convert to `intmax_t'.  */
87  extern  uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base);
88#endif
89
90#endif	/* SWIGWORDSIZE32 */
91
92#ifdef __cplusplus
93}
94#endif
95