]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/cxx-function-smob.cc
Add CVS HEAD trap.
[lilypond.git] / lily / cxx-function-smob.cc
index b17c4cb38aa2fa67b6589ee28e430c30c6b57894..4bdd4df7019c53bf26494bfe8f970e52759eaf6a 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -31,9 +31,8 @@ free_smob (SCM)
   return 0;
 }
 
-
-SCM
-cxx_function_type_p (SCM x)
+LY_DEFINE(cxx_function_type, "c++-function?", 1, 0, 0, (SCM x),
+         "Is this an encapsulated C++ function ?")
 {
   return (SCM_CELL_TYPE (x)) == callback_tag ? SCM_BOOL_T : SCM_BOOL_F; 
 }
@@ -45,20 +44,13 @@ void init_cxx_function_smobs ()
   scm_set_smob_free (callback_tag, free_smob);
   scm_set_smob_print (callback_tag, print_smob);
   scm_set_smob_equalp (callback_tag, 0);
-
-  scm_c_define_gsubr ("c++-function?", 1, 0, 0,
-                     (Scheme_function_unknown) cxx_function_type_p);
 }
 
 SCM
 smobify_cxx_function (Cxx_function cb)
 {
   SCM z;
-  
-  SCM_NEWCELL (z);
-  SCM_SETCDR (z, (SCM)cb);
-  SCM_SETCAR (z, (SCM)callback_tag);
-
+  SCM_NEWSMOB(z,callback_tag, cb) ;
   return z;
 }