Rewrite %method-more-specific? to be in Scheme
[bpt/guile.git] / libguile / foreign.c
index ac7cf8c..0cab6b8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010, 2011, 2012, 2013  Free Software Foundation, Inc.
+/* Copyright (C) 2010-2013  Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -766,10 +766,10 @@ SCM_DEFINE (scm_pointer_to_procedure, "pointer->procedure", 3, 0, 0,
 /* We support calling foreign functions with up to 100 arguments. */
 
 #define CODE(nreq)                                                  \
-  SCM_PACK_RTL_24 (scm_rtl_op_assert_nargs_ee, nreq + 1),           \
-  SCM_PACK_RTL_12_12 (scm_rtl_op_foreign_call, 0, 1)
+  SCM_PACK_OP_24 (assert_nargs_ee, nreq + 1),                       \
+  SCM_PACK_OP_12_12 (foreign_call, 0, 1)
 
-#define CODE_10(n)                                               \
+#define CODE_10(n)                                                      \
   CODE (n + 0), CODE (n + 1), CODE (n + 2), CODE (n + 3), CODE (n + 4), \
   CODE (n + 5), CODE (n + 6), CODE (n + 7), CODE (n + 8), CODE (n + 9)
 
@@ -796,7 +796,7 @@ get_foreign_stub_code (unsigned int nargs)
 int
 scm_i_foreign_arity (SCM foreign, int *req, int *opt, int *rest)
 {
-  const scm_t_uint32 *code = SCM_RTL_PROGRAM_CODE (foreign);
+  const scm_t_uint32 *code = SCM_PROGRAM_CODE (foreign);
 
   if (code < foreign_stub_code)
     return 0;
@@ -821,10 +821,10 @@ cif_to_procedure (SCM cif, SCM func_ptr)
 
   c_cif = (ffi_cif *) SCM_POINTER_VALUE (cif);
 
-  ret = scm_words (scm_tc7_rtl_program | (nfree << 16) | flags, nfree + 2);
+  ret = scm_words (scm_tc7_program | (nfree << 16) | flags, nfree + 2);
   SCM_SET_CELL_WORD_1 (ret, get_foreign_stub_code (c_cif->nargs));
-  SCM_RTL_PROGRAM_FREE_VARIABLE_SET (ret, 0, cif);
-  SCM_RTL_PROGRAM_FREE_VARIABLE_SET (ret, 1, func_ptr);
+  SCM_PROGRAM_FREE_VARIABLE_SET (ret, 0, cif);
+  SCM_PROGRAM_FREE_VARIABLE_SET (ret, 1, func_ptr);
   
   return ret;
 }