gsubr.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* classes: h_files */
  2. #ifndef SCM_GSUBR_H
  3. #define SCM_GSUBR_H
  4. /* Copyright (C) 1995,1996,1998,2000,2001, 2006 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "libguile/__scm.h"
  21. #define SCM_GSUBR_MAKTYPE(req, opt, rst) ((req)|((opt)<<4)|((rst)<<8))
  22. #define SCM_GSUBR_REQ(x) ((long)(x)&0xf)
  23. #define SCM_GSUBR_OPT(x) (((long)(x)&0xf0)>>4)
  24. #define SCM_GSUBR_REST(x) ((long)(x)>>8)
  25. #define SCM_GSUBR_MAX 10
  26. #define SCM_GSUBR_TYPE(cclo) (SCM_CCLO_REF ((cclo), 1))
  27. #define SCM_SET_GSUBR_TYPE(cclo, type) (SCM_CCLO_SET ((cclo), 1, (type)))
  28. #define SCM_GSUBR_PROC(cclo) (SCM_CCLO_REF ((cclo), 2))
  29. #define SCM_SET_GSUBR_PROC(cclo, proc) (SCM_CCLO_SET ((cclo), 2, (proc)))
  30. SCM_API SCM scm_f_gsubr_apply;
  31. SCM_API SCM scm_c_make_gsubr (const char *name,
  32. int req, int opt, int rst, SCM (*fcn) ());
  33. SCM_API SCM scm_c_make_gsubr_with_generic (const char *name,
  34. int req, int opt, int rst,
  35. SCM (*fcn) (), SCM *gf);
  36. SCM_API SCM scm_c_define_gsubr (const char *name,
  37. int req, int opt, int rst, SCM (*fcn) ());
  38. SCM_API SCM scm_c_define_gsubr_with_generic (const char *name,
  39. int req, int opt, int rst,
  40. SCM (*fcn) (), SCM *gf);
  41. SCM_API SCM scm_gsubr_apply (SCM args);
  42. SCM_API void scm_init_gsubr (void);
  43. #endif /* SCM_GSUBR_H */
  44. /*
  45. Local Variables:
  46. c-file-style: "gnu"
  47. End:
  48. */