PageRenderTime 39ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Lib/inttypes.i

#
Swig | 94 lines | 46 code | 25 blank | 23 comment | 0 complexity | 3ec069c9d8814a776c37c657c37b31c0 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  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. #include <inttypes.h>
  11. %}
  12. %include <stdint.i>
  13. %include <wchar.i>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifdef SWIGWORDSIZE64
  18. /* We have to define the `uintmax_t' type using `ldiv_t'. */
  19. typedef struct
  20. {
  21. long int quot; /* Quotient. */
  22. long int rem; /* Remainder. */
  23. } imaxdiv_t;
  24. #else
  25. /* We have to define the `uintmax_t' type using `lldiv_t'. */
  26. typedef struct
  27. {
  28. long long int quot; /* Quotient. */
  29. long long int rem; /* Remainder. */
  30. } imaxdiv_t;
  31. #endif
  32. /* Compute absolute value of N. */
  33. extern intmax_t imaxabs (intmax_t n);
  34. /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
  35. extern imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
  36. /* Like `strtol' but convert to `intmax_t'. */
  37. extern intmax_t strtoimax (const char *nptr, char **endptr, int base);
  38. /* Like `strtoul' but convert to `uintmax_t'. */
  39. extern uintmax_t strtoumax (const char *nptr, char ** endptr, int base);
  40. #ifdef SWIG_WCHAR
  41. /* Like `wcstol' but convert to `intmax_t'. */
  42. extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base);
  43. /* Like `wcstoul' but convert to `uintmax_t'. */
  44. extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t ** endptr, int base);
  45. #endif
  46. #ifdef SWIGWORDSIZE64
  47. /* Like `strtol' but convert to `intmax_t'. */
  48. extern intmax_t strtoimax (const char *nptr, char **endptr, int base);
  49. /* Like `strtoul' but convert to `uintmax_t'. */
  50. extern uintmax_t strtoumax (const char *nptr, char **endptr,int base);
  51. #ifdef SWIG_WCHAR
  52. /* Like `wcstol' but convert to `intmax_t'. */
  53. extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base);
  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. #else /* SWIGWORDSIZE32 */
  58. /* Like `strtol' but convert to `intmax_t'. */
  59. extern intmax_t strtoimax (const char *nptr, char **endptr, int base);
  60. /* Like `strtoul' but convert to `uintmax_t'. */
  61. extern uintmax_t strtoumax (const char *nptr, char **endptr, int base);
  62. #ifdef SWIG_WCHAR
  63. /* Like `wcstol' but convert to `intmax_t'. */
  64. extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base);
  65. #endif
  66. #endif /* SWIGWORDSIZE32 */
  67. #ifdef __cplusplus
  68. }
  69. #endif