Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.2 KiB

  1. /* -----------------------------------------------------------------------------
  2. * See the LICENSE file for information on copyright, usage and redistribution
  3. * of SWIG, and the README file for authors - http://www.swig.org/release.html.
  4. *
  5. * guile_gh.swg
  6. *
  7. * This SWIG interface file is processed if the Guile module is run
  8. * with gh_ flavor.
  9. * ----------------------------------------------------------------------------- */
  10. #define SWIGGUILE_GH
  11. %runtime "swigrun.swg"
  12. %runtime "guile_gh_run.swg"
  13. #define SWIG_convert_short(o) \
  14. SWIG_convert_integer(o, - (1 << (8 * sizeof(short) - 1)), \
  15. (1 << (8 * sizeof(short) - 1)) - 1, \
  16. FUNC_NAME, $argnum)
  17. #define SWIG_convert_unsigned_short(o) \
  18. SWIG_convert_unsigned_integer(o, 0, \
  19. (1 << (8 * sizeof(short))) - 1, \
  20. FUNC_NAME, $argnum)
  21. #define SWIG_convert_unsigned_int(o) \
  22. SWIG_convert_unsigned_integer(o, 0, UINT_MAX, \
  23. FUNC_NAME, $argnum)
  24. #define gh_scm2short(a) SWIG_convert_short(a)
  25. #define gh_scm2ushort(a) SWIG_convert_unsigned_short(a)
  26. #define gh_scm2uint(a) SWIG_convert_unsigned_int(a)
  27. %include <guile.i>
  28. %runtime %{
  29. /* scm_values was implemented on C level in 1.4.1, and the prototype
  30. is not included in libguile.h, so play safe and lookup `values'... */
  31. #define GUILE_MAYBE_VALUES \
  32. if (gswig_list_p) \
  33. gswig_result = gh_apply(gh_lookup("values"), gswig_result);
  34. #define GUILE_MAYBE_VECTOR \
  35. if (gswig_list_p) \
  36. gswig_result = gh_list_to_vector(gswig_result);
  37. #define SWIG_APPEND_VALUE(object) \
  38. if (gswig_result == SCM_UNSPECIFIED) { \
  39. gswig_result = object; \
  40. } else { \
  41. if (!gswig_list_p) { \
  42. gswig_list_p = 1; \
  43. gswig_result = gh_list(gswig_result, object, SCM_UNDEFINED); \
  44. } \
  45. else \
  46. gswig_result = gh_append2(gswig_result, \
  47. gh_list(object, SCM_UNDEFINED)); \
  48. }
  49. %}
  50. %init "swiginit.swg"
  51. %init %{
  52. static int _swig_module_smob_tag;
  53. SWIG_GUILE_INIT_STATIC void
  54. SWIG_init(void)
  55. {
  56. SWIG_InitializeModule(0);
  57. swig_module.clientdata = (void *) &_swig_module_smob_tag;
  58. SWIG_Guile_Init(&swig_module);
  59. %}