summaryrefslogtreecommitdiff
path: root/libguile/objects.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1999-07-24 11:36:30 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1999-07-24 11:36:30 +0000
commitd0efbe619919d41a256ab8f5050f22ec966fd598 (patch)
treee9bd11d8aea7546de25594ce819888b9cfd23a08 /libguile/objects.c
parent0e8a8468a3f89593c30fa510adcf37c8ff68d607 (diff)
downloadguile-d0efbe619919d41a256ab8f5050f22ec966fd598.tar.gz
* objects.c, objects.h (scm_port_class): Added.
(scm_class_of): Look up port class in scm_port_class. (SCM_IN_PCLASS_INDEX, SCM_OUT_PCLASS_INDEX, SCM_INOUT_PCLASS_INDEX): Added.
Diffstat (limited to 'libguile/objects.c')
-rw-r--r--libguile/objects.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libguile/objects.c b/libguile/objects.c
index 245d042d8..e1181745e 100644
--- a/libguile/objects.c
+++ b/libguile/objects.c
@@ -67,6 +67,7 @@ SCM scm_class_vector, scm_class_null;
SCM scm_class_integer, scm_class_real, scm_class_complex;
SCM scm_class_unknown;
+SCM *scm_port_class = 0;
SCM *scm_smob_class = 0;
SCM (*scm_make_extended_class) (char *type_name);
@@ -139,7 +140,11 @@ scm_class_of (SCM x)
return scm_class_procedure_with_setter;
case scm_tc7_port:
- return scm_class_unknown;
+ return scm_port_class[(SCM_CAR (x) | SCM_WRTNG
+ ? (SCM_CAR (x) | SCM_RDNG
+ ? SCM_INOUT_PCLASS_INDEX | SCM_PTOBNUM (x)
+ : SCM_OUT_PCLASS_INDEX | SCM_PTOBNUM (x))
+ : SCM_IN_PCLASS_INDEX | SCM_PTOBNUM (x))];
case scm_tc7_smob:
{
SCM type = SCM_TYP16 (x);