PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/guile/guile_scm.swg

#
Unknown | 50 lines | 40 code | 10 blank | 0 comment | 0 complexity | 63c72f812a2969aa3098a83379425d1e MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* -----------------------------------------------------------------------------
  2. * guile_scm.swg
  3. *
  4. * This SWIG interface file is processed if the Guile module is run
  5. * with SCM_ flavor.
  6. * ----------------------------------------------------------------------------- */
  7. #define SWIGGUILE_SCM
  8. %runtime "swigrun.swg" // Common C API type-checking code
  9. %runtime "guile_scm_run.swg"
  10. %include <ghinterface.i>
  11. %include <guile.i>
  12. %runtime %{
  13. #define GUILE_MAYBE_VALUES \
  14. if (gswig_list_p) gswig_result = scm_values(gswig_result);
  15. #define GUILE_MAYBE_VECTOR \
  16. if (gswig_list_p) gswig_result = scm_vector(gswig_result);
  17. #define SWIG_APPEND_VALUE(object) \
  18. if (gswig_result == SCM_UNSPECIFIED) \
  19. gswig_result = object; \
  20. else { \
  21. if (!gswig_list_p) { \
  22. gswig_list_p = 1; \
  23. gswig_result = scm_listify(gswig_result, object, SCM_UNDEFINED); \
  24. } \
  25. else \
  26. gswig_result = scm_append(scm_listify(gswig_result, scm_listify(object, SCM_UNDEFINED), SCM_UNDEFINED)); \
  27. }
  28. /* used by Lib/exception.i */
  29. #define gh_symbol2scm scm_str2symbol
  30. /* useb by Lib/cdata.i */
  31. #define gh_str2scm scm_mem2string
  32. %}
  33. %insert(init) "swiginit.swg"
  34. %init %{
  35. SWIG_GUILE_INIT_STATIC void
  36. SWIG_init(void)
  37. {
  38. SWIG_InitializeModule(0);
  39. SWIG_PropagateClientData();
  40. %}