guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Add `scm_smob_type_class()'.


From: Andy Wingo
Subject: [Guile-commits] 01/01: Add `scm_smob_type_class()'.
Date: Tue, 10 Feb 2015 14:55:59 +0000

wingo pushed a commit to branch master
in repository guile.

commit 1bbf7f75805c10c4d7715853cd7d6c3e8226d5fc
Author: Andy Wingo <address@hidden>
Date:   Tue Feb 10 14:35:35 2015 +0100

    Add `scm_smob_type_class()'.
    
    * libguile/smob.h:
    * libguile/smob.c (scm_smob_type_class): New function, to access the
      GOOPS class for a SMOB type.
---
 libguile/smob.c |   12 ++++++++++++
 libguile/smob.h |    4 +++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/libguile/smob.c b/libguile/smob.c
index 2a6c96f..eecefd3 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -443,6 +443,18 @@ scm_i_new_double_smob (scm_t_bits tc, scm_t_bits data1,
   return ret;
 }
 
+
+
+
+SCM
+scm_smob_type_class (scm_t_bits tc)
+{
+  scm_load_goops ();
+
+  return scm_i_smob_class[SCM_TC2SMOBNUM (tc)];
+}
+
+
 
 void
 scm_smob_prehistory ()
diff --git a/libguile/smob.h b/libguile/smob.h
index 0e59f89..561a6d1 100644
--- a/libguile/smob.h
+++ b/libguile/smob.h
@@ -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 */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]