XS.xsp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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_ID, 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_APP_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. disable_multi_threading()
  42. CODE:
  43. Slic3r::disable_multi_threading();
  44. void
  45. set_var_dir(dir)
  46. char *dir;
  47. CODE:
  48. Slic3r::set_var_dir(dir);
  49. void
  50. set_local_dir(dir)
  51. char *dir;
  52. CODE:
  53. Slic3r::set_local_dir(dir);
  54. char*
  55. var_dir()
  56. CODE:
  57. RETVAL = const_cast<char*>(Slic3r::var_dir().c_str());
  58. OUTPUT: RETVAL
  59. void
  60. set_resources_dir(dir)
  61. char *dir;
  62. CODE:
  63. Slic3r::set_resources_dir(dir);
  64. char*
  65. resources_dir()
  66. CODE:
  67. RETVAL = const_cast<char*>(Slic3r::resources_dir().c_str());
  68. OUTPUT: RETVAL
  69. std::string
  70. var(file_name)
  71. const char *file_name;
  72. CODE:
  73. RETVAL = Slic3r::var(file_name);
  74. OUTPUT: RETVAL
  75. void
  76. set_data_dir(dir)
  77. char *dir;
  78. CODE:
  79. Slic3r::set_data_dir(dir);
  80. char*
  81. data_dir()
  82. CODE:
  83. RETVAL = const_cast<char*>(Slic3r::data_dir().c_str());
  84. OUTPUT: RETVAL
  85. local_encoded_string
  86. encode_path(src)
  87. const char *src;
  88. CODE:
  89. RETVAL = Slic3r::encode_path(src);
  90. OUTPUT: RETVAL
  91. std::string
  92. decode_path(src)
  93. const char *src;
  94. CODE:
  95. RETVAL = Slic3r::decode_path(src);
  96. OUTPUT: RETVAL
  97. std::string
  98. normalize_utf8_nfc(src)
  99. const char *src;
  100. CODE:
  101. RETVAL = Slic3r::normalize_utf8_nfc(src);
  102. OUTPUT: RETVAL
  103. std::string
  104. path_to_filename(src)
  105. const char *src;
  106. CODE:
  107. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  108. OUTPUT: RETVAL
  109. local_encoded_string
  110. path_to_filename_raw(src)
  111. const char *src;
  112. CODE:
  113. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  114. OUTPUT: RETVAL
  115. std::string
  116. path_to_stem(src)
  117. const char *src;
  118. CODE:
  119. RETVAL = Slic3r::PerlUtils::path_to_stem(src);
  120. OUTPUT: RETVAL
  121. std::string
  122. path_to_extension(src)
  123. const char *src;
  124. CODE:
  125. RETVAL = Slic3r::PerlUtils::path_to_extension(src);
  126. OUTPUT: RETVAL
  127. std::string
  128. path_to_parent_path(src)
  129. const char *src;
  130. CODE:
  131. RETVAL = Slic3r::PerlUtils::path_to_parent_path(src);
  132. OUTPUT: RETVAL
  133. void
  134. xspp_test_croak_hangs_on_strawberry()
  135. CODE:
  136. try {
  137. throw 1;
  138. } catch (...) {
  139. croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
  140. }
  141. %}