Add `scm_smob_type_class()'.
authorAndy Wingo <wingo@pobox.com>
Tue, 10 Feb 2015 13:35:35 +0000 (14:35 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 10 Feb 2015 13:35:35 +0000 (14:35 +0100)
* libguile/smob.h:
* libguile/smob.c (scm_smob_type_class): New function, to access the
  GOOPS class for a SMOB type.

libguile/smob.c
libguile/smob.h

index 2a6c96f..eecefd3 100644 (file)
@@ -443,6 +443,18 @@ scm_i_new_double_smob (scm_t_bits tc, scm_t_bits data1,
   return ret;
 }
 
+
+\f
+
+SCM
+scm_smob_type_class (scm_t_bits tc)
+{
+  scm_load_goops ();
+
+  return scm_i_smob_class[SCM_TC2SMOBNUM (tc)];
+}
+
+
 \f
 void
 scm_smob_prehistory ()
index 0e59f89..561a6d1 100644 (file)
@@ -4,7 +4,7 @@
 #define SCM_SMOB_H
 
 /* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2004, 2006, 2009,
- *   2010, 2011, 2012 Free Software Foundation, Inc.
+ *   2010, 2011, 2012, 2015 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
@@ -190,6 +190,8 @@ SCM_API void scm_set_smob_apply (scm_t_bits tc,
                                 unsigned int opt,
                                 unsigned int rst);
 
+SCM_API SCM scm_smob_type_class (scm_t_bits tc);
+
 SCM_API void scm_assert_smob_type (scm_t_bits tag, SCM val);
 
 /* Function for creating smobs */