XS.xsp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. FORK_NAME()
  21. CODE:
  22. RETVAL = newSVpv(SLIC3R_APP_NAME, 0);
  23. OUTPUT: RETVAL
  24. void
  25. set_logging_level(level)
  26. unsigned int level;
  27. CODE:
  28. Slic3r::set_logging_level(level);
  29. void
  30. trace(level, message)
  31. unsigned int level;
  32. char *message;
  33. CODE:
  34. Slic3r::trace(level, message);
  35. void
  36. disable_multi_threading()
  37. CODE:
  38. Slic3r::disable_multi_threading();
  39. void
  40. set_var_dir(dir)
  41. char *dir;
  42. CODE:
  43. Slic3r::set_var_dir(dir);
  44. void
  45. set_local_dir(dir)
  46. char *dir;
  47. CODE:
  48. Slic3r::set_local_dir(dir);
  49. char*
  50. var_dir()
  51. CODE:
  52. RETVAL = const_cast<char*>(Slic3r::var_dir().c_str());
  53. OUTPUT: RETVAL
  54. void
  55. set_resources_dir(dir)
  56. char *dir;
  57. CODE:
  58. Slic3r::set_resources_dir(dir);
  59. char*
  60. resources_dir()
  61. CODE:
  62. RETVAL = const_cast<char*>(Slic3r::resources_dir().c_str());
  63. OUTPUT: RETVAL
  64. std::string
  65. var(file_name)
  66. const char *file_name;
  67. CODE:
  68. RETVAL = Slic3r::var(file_name);
  69. OUTPUT: RETVAL
  70. void
  71. set_data_dir(dir)
  72. char *dir;
  73. CODE:
  74. Slic3r::set_data_dir(dir);
  75. char*
  76. data_dir()
  77. CODE:
  78. RETVAL = const_cast<char*>(Slic3r::data_dir().c_str());
  79. OUTPUT: RETVAL
  80. local_encoded_string
  81. encode_path(src)
  82. const char *src;
  83. CODE:
  84. RETVAL = Slic3r::encode_path(src);
  85. OUTPUT: RETVAL
  86. std::string
  87. decode_path(src)
  88. const char *src;
  89. CODE:
  90. RETVAL = Slic3r::decode_path(src);
  91. OUTPUT: RETVAL
  92. std::string
  93. normalize_utf8_nfc(src)
  94. const char *src;
  95. CODE:
  96. RETVAL = Slic3r::normalize_utf8_nfc(src);
  97. OUTPUT: RETVAL
  98. std::string
  99. path_to_filename(src)
  100. const char *src;
  101. CODE:
  102. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  103. OUTPUT: RETVAL
  104. local_encoded_string
  105. path_to_filename_raw(src)
  106. const char *src;
  107. CODE:
  108. RETVAL = Slic3r::PerlUtils::path_to_filename(src);
  109. OUTPUT: RETVAL
  110. std::string
  111. path_to_stem(src)
  112. const char *src;
  113. CODE:
  114. RETVAL = Slic3r::PerlUtils::path_to_stem(src);
  115. OUTPUT: RETVAL
  116. std::string
  117. path_to_extension(src)
  118. const char *src;
  119. CODE:
  120. RETVAL = Slic3r::PerlUtils::path_to_extension(src);
  121. OUTPUT: RETVAL
  122. std::string
  123. path_to_parent_path(src)
  124. const char *src;
  125. CODE:
  126. RETVAL = Slic3r::PerlUtils::path_to_parent_path(src);
  127. OUTPUT: RETVAL
  128. void
  129. xspp_test_croak_hangs_on_strawberry()
  130. CODE:
  131. try {
  132. throw 1;
  133. } catch (...) {
  134. croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
  135. }
  136. %}