PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/ruby/rubytypemaps.swg

#
Unknown | 62 lines | 44 code | 18 blank | 0 comment | 0 complexity | a9a7f0b14e230b066dfc57f7cdf92ea1 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* ------------------------------------------------------------
  2. * Typemap specializations for Ruby
  3. * ------------------------------------------------------------ */
  4. /* ------------------------------------------------------------
  5. * Fragment section
  6. * ------------------------------------------------------------ */
  7. /* bool is dangerous in Ruby, change precedence */
  8. #undef SWIG_TYPECHECK_BOOL
  9. %define SWIG_TYPECHECK_BOOL 10000 %enddef
  10. /* Include fundamental fragemt definitions */
  11. %include <typemaps/fragments.swg>
  12. /* Look for user fragments file. */
  13. %include <rubyfragments.swg>
  14. /* Ruby fragments for primitive types */
  15. %include <rubyprimtypes.swg>
  16. /* Ruby fragments for char* strings */
  17. %include <rubystrings.swg>
  18. /* Backward compatibility output helper */
  19. %fragment("output_helper","header") %{
  20. #define output_helper SWIG_Ruby_AppendOutput
  21. %}
  22. /* ------------------------------------------------------------
  23. * Unified typemap section
  24. * ------------------------------------------------------------ */
  25. /* Directors are supported in Ruby */
  26. #ifndef SWIG_DIRECTOR_TYPEMAPS
  27. #define SWIG_DIRECTOR_TYPEMAPS
  28. #endif
  29. /* Ruby types */
  30. #define SWIG_Object VALUE
  31. #define VOID_Object Qnil
  32. /* Overload of the output/constant/exception handling */
  33. /* append output */
  34. #define SWIG_AppendOutput(result,obj) SWIG_Ruby_AppendOutput(result, obj)
  35. /* set constant */
  36. #define SWIG_SetConstant(name, obj) rb_define_const($module, name, obj)
  37. /* raise */
  38. #define SWIG_Raise(obj, type, desc) rb_exc_raise(SWIG_Ruby_ExceptionType(desc, obj))
  39. /* Get the address of the 'Ruby self' object */
  40. %typemap(in,numinputs=0,noblock=1) VALUE* RUBY_SELF {
  41. $1 = &self;
  42. }
  43. /* Include the unified typemap library */
  44. %include <typemaps/swigtypemaps.swg>