XS.xsp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. local_encoded_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. std::string
  95. path_to_filename(src)
  96. const char *src;
  97. CODE:
  98. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  99. OUTPUT: RETVAL
  100. local_encoded_string
  101. path_to_filename_raw(src)
  102. const char *src;
  103. CODE:
  104. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  105. OUTPUT: RETVAL
  106. std::string
  107. path_to_stem(src)
  108. const char *src;
  109. CODE:
  110. RETVAL = Slic3r::PerlUtils::path_to_stem(src);
  111. OUTPUT: RETVAL
  112. std::string
  113. path_to_extension(src)
  114. const char *src;
  115. CODE:
  116. RETVAL = Slic3r::PerlUtils::path_to_extension(src);
  117. OUTPUT: RETVAL
  118. std::string
  119. path_to_parent_path(src)
  120. const char *src;
  121. CODE:
  122. RETVAL = Slic3r::PerlUtils::path_to_parent_path(src);
  123. OUTPUT: RETVAL
  124. void
  125. xspp_test_croak_hangs_on_strawberry()
  126. CODE:
  127. try {
  128. throw 1;
  129. } catch (...) {
  130. croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
  131. }
  132. %}