PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/inttypes.i

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