Advertisement
Guest User

SWIG test

a guest
Sep 15th, 2022
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 8.05 KB | Source Code | 0 0
  1. /* ----------------------------------------------------------------------------
  2.  * This file was automatically generated by SWIG (http://www.swig.org).
  3.  * Version 4.1.0
  4.  *
  5.  * This file is not intended to be easily readable and contains a number of
  6.  * coding conventions designed to improve portability and efficiency. Do not make
  7.  * changes to this file unless you know what you are doing--modify the SWIG
  8.  * interface file instead.
  9.  * ----------------------------------------------------------------------------- */
  10.  
  11.  
  12. #ifndef SWIGD
  13. #define SWIGD
  14. #endif
  15.  
  16.  
  17.  
  18. #ifdef __cplusplus
  19. /* SwigValueWrapper is described in swig.swg */
  20. template<typename T> class SwigValueWrapper {
  21.   struct SwigMovePointer {
  22.     T *ptr;
  23.     SwigMovePointer(T *p) : ptr(p) { }
  24.     ~SwigMovePointer() { delete ptr; }
  25.     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  26.   } pointer;
  27.   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  28.   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
  29. public:
  30.   SwigValueWrapper() : pointer(0) { }
  31.   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  32.   operator T&() const { return *pointer.ptr; }
  33.   T *operator&() { return pointer.ptr; }
  34. };
  35.  
  36. template <typename T> T SwigValueInit() {
  37.   return T();
  38. }
  39. #endif
  40.  
  41. /* -----------------------------------------------------------------------------
  42.  *  This section contains generic SWIG labels for method/variable
  43.  *  declarations/attributes, and other compiler dependent labels.
  44.  * ----------------------------------------------------------------------------- */
  45.  
  46. /* template workaround for compilers that cannot correctly implement the C++ standard */
  47. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  48. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  49. #  define SWIGTEMPLATEDISAMBIGUATOR template
  50. # elif defined(__HP_aCC)
  51. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  52. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  53. #  define SWIGTEMPLATEDISAMBIGUATOR template
  54. # else
  55. #  define SWIGTEMPLATEDISAMBIGUATOR
  56. # endif
  57. #endif
  58.  
  59. /* inline attribute */
  60. #ifndef SWIGINLINE
  61. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  62. #   define SWIGINLINE inline
  63. # else
  64. #   define SWIGINLINE
  65. # endif
  66. #endif
  67.  
  68. /* attribute recognised by some compilers to avoid 'unused' warnings */
  69. #ifndef SWIGUNUSED
  70. # if defined(__GNUC__)
  71. #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  72. #     define SWIGUNUSED __attribute__ ((__unused__))
  73. #   else
  74. #     define SWIGUNUSED
  75. #   endif
  76. # elif defined(__ICC)
  77. #   define SWIGUNUSED __attribute__ ((__unused__))
  78. # else
  79. #   define SWIGUNUSED
  80. # endif
  81. #endif
  82.  
  83. #ifndef SWIG_MSC_UNSUPPRESS_4505
  84. # if defined(_MSC_VER)
  85. #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
  86. # endif
  87. #endif
  88.  
  89. #ifndef SWIGUNUSEDPARM
  90. # ifdef __cplusplus
  91. #   define SWIGUNUSEDPARM(p)
  92. # else
  93. #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
  94. # endif
  95. #endif
  96.  
  97. /* internal SWIG method */
  98. #ifndef SWIGINTERN
  99. # define SWIGINTERN static SWIGUNUSED
  100. #endif
  101.  
  102. /* internal inline SWIG method */
  103. #ifndef SWIGINTERNINLINE
  104. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  105. #endif
  106.  
  107. /* exporting methods */
  108. #if defined(__GNUC__)
  109. #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  110. #    ifndef GCC_HASCLASSVISIBILITY
  111. #      define GCC_HASCLASSVISIBILITY
  112. #    endif
  113. #  endif
  114. #endif
  115.  
  116. #ifndef SWIGEXPORT
  117. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  118. #   if defined(STATIC_LINKED)
  119. #     define SWIGEXPORT
  120. #   else
  121. #     define SWIGEXPORT __declspec(dllexport)
  122. #   endif
  123. # else
  124. #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  125. #     define SWIGEXPORT __attribute__ ((visibility("default")))
  126. #   else
  127. #     define SWIGEXPORT
  128. #   endif
  129. # endif
  130. #endif
  131.  
  132. /* calling conventions for Windows */
  133. #ifndef SWIGSTDCALL
  134. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  135. #   define SWIGSTDCALL __stdcall
  136. # else
  137. #   define SWIGSTDCALL
  138. # endif
  139. #endif
  140.  
  141. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  142. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  143. # define _CRT_SECURE_NO_DEPRECATE
  144. #endif
  145.  
  146. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  147. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  148. # define _SCL_SECURE_NO_DEPRECATE
  149. #endif
  150.  
  151. /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
  152. #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
  153. # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
  154. #endif
  155.  
  156. /* Intel's compiler complains if a variable which was never initialised is
  157.  * cast to void, which is a common idiom which we use to indicate that we
  158.  * are aware a variable isn't used.  So we just silence that warning.
  159.  * See: https://github.com/swig/swig/issues/192 for more discussion.
  160.  */
  161. #ifdef __INTEL_COMPILER
  162. # pragma warning disable 592
  163. #endif
  164.  
  165.  
  166. #include <stdlib.h>
  167. #include <string.h>
  168. #include <stdio.h>
  169.  
  170. /* Contract support. */
  171. #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_DSetPendingException(SWIG_DException, msg); return nullreturn; } else
  172.  
  173.  
  174. // Support for throwing D exceptions from C/C++.
  175. typedef enum {
  176.   SWIG_DException = 0,
  177.   SWIG_DIllegalArgumentException,
  178.   SWIG_DIllegalElementException,
  179.   SWIG_DIOException,
  180.   SWIG_DNoSuchElementException
  181. } SWIG_DExceptionCodes;
  182.  
  183. typedef void (* SWIG_DExceptionCallback_t)(const char *);
  184.  
  185. typedef struct {
  186.   SWIG_DExceptionCodes code;
  187.   SWIG_DExceptionCallback_t callback;
  188. } SWIG_DException_t;
  189.  
  190. static SWIG_DException_t SWIG_d_exceptions[] = {
  191.   { SWIG_DException, NULL },
  192.   { SWIG_DIllegalArgumentException, NULL },
  193.   { SWIG_DIllegalElementException, NULL },
  194.   { SWIG_DIOException, NULL },
  195.   { SWIG_DNoSuchElementException, NULL }
  196. };
  197.  
  198. static void SWIGUNUSED SWIG_DSetPendingException(SWIG_DExceptionCodes code, const char *msg) {
  199.   if ((size_t)code < sizeof(SWIG_d_exceptions)/sizeof(SWIG_DException_t)) {
  200.     SWIG_d_exceptions[code].callback(msg);
  201.   } else {
  202.     SWIG_d_exceptions[SWIG_DException].callback(msg);
  203.   }
  204. }
  205.  
  206. #ifdef __cplusplus
  207. extern "C"
  208. #endif
  209. SWIGEXPORT void SWIGRegisterExceptionCallbacks_test(
  210.   SWIG_DExceptionCallback_t exceptionCallback,
  211.   SWIG_DExceptionCallback_t illegalArgumentCallback,
  212.   SWIG_DExceptionCallback_t illegalElementCallback,
  213.   SWIG_DExceptionCallback_t ioCallback,
  214.   SWIG_DExceptionCallback_t noSuchElementCallback) {
  215.   SWIG_d_exceptions[SWIG_DException].callback = exceptionCallback;
  216.   SWIG_d_exceptions[SWIG_DIllegalArgumentException].callback = illegalArgumentCallback;
  217.   SWIG_d_exceptions[SWIG_DIllegalElementException].callback = illegalElementCallback;
  218.   SWIG_d_exceptions[SWIG_DIOException].callback = ioCallback;
  219.   SWIG_d_exceptions[SWIG_DNoSuchElementException].callback = noSuchElementCallback;
  220. }
  221.  
  222.  
  223. // Callback for returning strings to D without leaking memory.
  224. typedef char * (* SWIG_DStringHelperCallback)(const char *);
  225. static SWIG_DStringHelperCallback SWIG_d_string_callback = NULL;
  226.  
  227. #ifdef __cplusplus
  228. extern "C"
  229. #endif
  230. SWIGEXPORT void SWIGRegisterStringCallback_test(SWIG_DStringHelperCallback callback) {
  231.   SWIG_d_string_callback = callback;
  232. }
  233.  
  234.  
  235.  
  236.  
  237.  
  238. #ifdef __cplusplus
  239. extern "C" {
  240. #endif
  241.  
  242. SWIGEXPORT void * D_new_Test__SWIG_0() {
  243.   void * jresult ;
  244.   Test *result = 0 ;
  245.  
  246.   result = (Test *)new Test();
  247.   jresult = (void *)result;
  248.   return jresult;
  249. }
  250.  
  251.  
  252. SWIGEXPORT void * D_new_Test__SWIG_1(int jarg1) {
  253.   void * jresult ;
  254.   int arg1 ;
  255.   Test *result = 0 ;
  256.  
  257.   arg1 = (int)jarg1;
  258.   result = (Test *)new Test(arg1);
  259.   jresult = (void *)result;
  260.   return jresult;
  261. }
  262.  
  263.  
  264. SWIGEXPORT void D_delete_Test(void * jarg1) {
  265.   Test *arg1 = (Test *) 0 ;
  266.  
  267.   arg1 = (Test *)jarg1;
  268.   delete arg1;
  269. }
  270.  
  271.  
  272. #ifdef __cplusplus
  273. }
  274. #endif
  275.  
  276.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement