diff options
author | Andy Wingo <wingo@pobox.com> | 2010-01-04 12:11:33 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-01-04 12:39:21 +0100 |
commit | e2c2a6994d05124760ea7f18caf5d28fb47e453c (patch) | |
tree | be4c3ae11905d89a8f9519bcc6fbebab4a003beb /libguile/goops.c | |
parent | 208fae8a0ebaa56b69105c89d69e337aef6a3e62 (diff) | |
download | guile-e2c2a6994d05124760ea7f18caf5d28fb47e453c.tar.gz |
add foreign value wrapper
* libguile/foreign.h:
* libguile/foreign.c: New files, implementing simple wrappers around
foreign values, such as those that one might link in dynamically from
a library.
* libguile/tags.h (scm_tc7_foreign): Take a tc7 for foreign values.
* libguile.h:
* libguile/init.c: Add foreign.h to headers and init.
* libguile/print.c (iprin1): Add printer for foreign values.
* libguile/gc.c (scm_i_tag_name): Case for foreign values.
* libguile/goops.c (scm_class_of, create_standard_classes): Add a class
for foreign values.
* libguile/evalext.c (scm_self_evaluating_p): Add case for foreign
values.
* libguile/Makefile.am: Add foreign.[ch] to the build.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r-- | libguile/goops.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 9fb6d4a6c..983fa5924 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008,2009 +/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008,2009,2010 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -157,6 +157,7 @@ SCM scm_class_protected_hidden, scm_class_protected_opaque, scm_class_protected_ SCM scm_class_scm; SCM scm_class_int, scm_class_float, scm_class_double; +static SCM class_foreign; static SCM class_hashtable; static SCM class_fluid; static SCM class_dynamic_state; @@ -213,6 +214,8 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0, case scm_tc7_vector: case scm_tc7_wvect: return scm_class_vector; + case scm_tc7_foreign: + return class_foreign; case scm_tc7_hashtable: return class_hashtable; case scm_tc7_fluid: @@ -2394,6 +2397,8 @@ create_standard_classes (void) scm_class_class, scm_class_top, SCM_EOL); make_stdcls (&scm_class_vector, "<vector>", scm_class_class, scm_class_top, SCM_EOL); + make_stdcls (&class_foreign, "<foreign>", + scm_class_class, scm_class_top, SCM_EOL); make_stdcls (&class_hashtable, "<hashtable>", scm_class_class, scm_class_top, SCM_EOL); make_stdcls (&class_fluid, "<fluid>", |