XS.xsp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. %module{Slic3r::XS};
  2. %package{Slic3r::XS};
  3. #include <xsinit.h>
  4. #include "Utils.hpp"
  5. %{
  6. %}
  7. %package{Slic3r};
  8. %{
  9. SV*
  10. VERSION()
  11. CODE:
  12. RETVAL = newSVpv(SLIC3R_VERSION, 0);
  13. OUTPUT: RETVAL
  14. SV*
  15. BUILD()
  16. CODE:
  17. RETVAL = newSVpv(SLIC3R_BUILD, 0);
  18. OUTPUT: RETVAL
  19. SV*
  20. DEBUG_OUT_PATH_PREFIX()
  21. CODE:
  22. RETVAL = newSVpv(SLIC3R_DEBUG_OUT_PATH_PREFIX, 0);
  23. OUTPUT: RETVAL
  24. SV*
  25. FORK_NAME()
  26. CODE:
  27. RETVAL = newSVpv(SLIC3R_FORK_NAME, 0);
  28. OUTPUT: RETVAL
  29. void
  30. set_logging_level(level)
  31. unsigned int level;
  32. CODE:
  33. Slic3r::set_logging_level(level);
  34. void
  35. trace(level, message)
  36. unsigned int level;
  37. char *message;
  38. CODE:
  39. Slic3r::trace(level, message);
  40. void
  41. set_var_dir(dir)
  42. char *dir;
  43. CODE:
  44. Slic3r::set_var_dir(dir);
  45. char*
  46. var_dir()
  47. CODE:
  48. RETVAL = const_cast<char*>(Slic3r::var_dir().c_str());
  49. OUTPUT: RETVAL
  50. void
  51. set_resources_dir(dir)
  52. char *dir;
  53. CODE:
  54. Slic3r::set_resources_dir(dir);
  55. char*
  56. resources_dir()
  57. CODE:
  58. RETVAL = const_cast<char*>(Slic3r::resources_dir().c_str());
  59. OUTPUT: RETVAL
  60. std::string
  61. var(file_name)
  62. const char *file_name;
  63. CODE:
  64. RETVAL = Slic3r::var(file_name);
  65. OUTPUT: RETVAL
  66. void
  67. set_data_dir(dir)
  68. char *dir;
  69. CODE:
  70. Slic3r::set_data_dir(dir);
  71. char*
  72. data_dir()
  73. CODE:
  74. RETVAL = const_cast<char*>(Slic3r::data_dir().c_str());
  75. OUTPUT: RETVAL
  76. std::string
  77. encode_path(src)
  78. const char *src;
  79. CODE:
  80. RETVAL = Slic3r::encode_path(src);
  81. OUTPUT: RETVAL
  82. std::string
  83. decode_path(src)
  84. const char *src;
  85. CODE:
  86. RETVAL = Slic3r::decode_path(src);
  87. OUTPUT: RETVAL
  88. std::string
  89. normalize_utf8_nfc(src)
  90. const char *src;
  91. CODE:
  92. RETVAL = Slic3r::normalize_utf8_nfc(src);
  93. OUTPUT: RETVAL
  94. void
  95. xspp_test_croak_hangs_on_strawberry()
  96. CODE:
  97. try {
  98. throw 1;
  99. } catch (...) {
  100. croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
  101. }
  102. %}