* General: A lot of typo, texinfo markup and layout corrections.
[bpt/guile.git] / libguile / objects.h
index 4b8d7b9..649d3fb 100644 (file)
@@ -1,9 +1,9 @@
 /* classes: h_files */
 
-#ifndef OBJECTSH
-#define OBJECTSH
+#ifndef SCM_OBJECTS_H
+#define SCM_OBJECTS_H
 
-/*     Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1999,2000,2001 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -67,9 +67,8 @@
  * certain class or its subclasses when traversal of the inheritance
  * graph would be too costly.
  */
-#define SCM_CLASS_FLAGS(class) (SCM_STRUCT_DATA (class)[scm_struct_i_flags])
-#define SCM_OBJ_CLASS_FLAGS(obj)\
-(SCM_STRUCT_VTABLE_DATA (obj)[scm_struct_i_flags])
+#define SCM_CLASS_FLAGS(class) (SCM_STRUCT_DATA (class) [scm_struct_i_flags])
+#define SCM_OBJ_CLASS_FLAGS(obj) (SCM_STRUCT_VTABLE_DATA (obj) [scm_struct_i_flags])
 #define SCM_SET_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) |= (f))
 #define SCM_CLEAR_CLASS_FLAGS(c, f) (SCM_CLASS_FLAGS (c) &= ~(f))
 #define SCM_CLASSF_MASK SCM_STRUCTF_MASK
@@ -80,7 +79,7 @@
 #define SCM_CLASSF_OPERATOR    (1L << 29)
 
 #define SCM_I_OPERATORP(obj)\
-((SCM_OBJ_CLASS_FLAGS (obj) & SCM_CLASSF_OPERATOR) != 0)
+       ((SCM_OBJ_CLASS_FLAGS (obj) & SCM_CLASSF_OPERATOR) != 0)
 #define SCM_OPERATOR_CLASS(obj)\
 ((struct scm_metaclass_operator *) SCM_STRUCT_DATA (obj))
 #define SCM_OBJ_OPERATOR_CLASS(obj)\
 #define SCM_OPERATOR_SETTER(obj) (SCM_OBJ_OPERATOR_CLASS (obj)->setter)
 
 #define SCM_I_ENTITYP(obj)\
-((SCM_OBJ_CLASS_FLAGS (obj) & SCM_CLASSF_ENTITY) != 0)
+       ((SCM_OBJ_CLASS_FLAGS (obj) & SCM_CLASSF_ENTITY) != 0)
 #define SCM_ENTITY_PROCEDURE(obj) \
-        (SCM_STRUCT_DATA (obj)[scm_struct_i_procedure])
-#define SCM_ENTITY_SETTER(obj) (SCM_STRUCT_DATA (obj)[scm_struct_i_setter])
+        (SCM_PACK (SCM_STRUCT_DATA (obj) [scm_struct_i_procedure]))
+#define SCM_SET_ENTITY_PROCEDURE(obj,v) \
+        (SCM_STRUCT_DATA (obj) [scm_struct_i_procedure] = SCM_UNPACK (v))
+#define SCM_ENTITY_SETTER(obj) (SCM_PACK (SCM_STRUCT_DATA (obj)[scm_struct_i_setter]))
+#define SCM_SET_ENTITY_SETTER(obj, v) \
+        (SCM_STRUCT_DATA (obj) [scm_struct_i_setter] = SCM_UNPACK (v))
 
 #define SCM_SET_CLASS_DESTRUCTOR(c, d) SCM_SET_VTABLE_DESTRUCTOR (c, d)
 #define SCM_SET_CLASS_INSTANCE_SIZE(c, s) \
-(SCM_STRUCT_DATA (c)[scm_struct_i_size] \
= (SCM_STRUCT_DATA (c)[scm_struct_i_size] & SCM_STRUCTF_MASK) | s)
+  (SCM_STRUCT_DATA (c)[scm_struct_i_size] \
  = (SCM_STRUCT_DATA (c) [scm_struct_i_size] & SCM_STRUCTF_MASK) | s)
 
 /* {Operator classes}
  *
@@ -173,7 +176,7 @@ struct scm_metaclass_operator {
 #define scm_si_redefined         6
 #define scm_si_hashsets          7
 #define SCM_CLASS_OF(x)         SCM_STRUCT_VTABLE (x)
-#define SCM_OBJ_CLASS_REDEF(x)  (SCM_STRUCT_VTABLE_DATA(x)[scm_si_redefined])
+#define SCM_OBJ_CLASS_REDEF(x)  (SCM_PACK (SCM_STRUCT_VTABLE_DATA (x) [scm_si_redefined]))
 
 typedef struct scm_effective_slot_definition {
   SCM name;
@@ -207,25 +210,26 @@ extern SCM *scm_smob_class;
 
 extern SCM scm_no_applicable_method;
 
-/* Plugin Goops functions. */
-extern SCM (*scm_make_extended_class) (char *type_name);
-extern void (*scm_make_port_classes) (int ptobnum, char *type_name);
-extern void (*scm_change_object_class) (SCM, SCM, SCM);
-extern SCM (*scm_memoize_method) (SCM x, SCM args);
+/* Goops functions. */
+extern SCM scm_make_extended_class (char *type_name);
+extern void scm_make_port_classes (long ptobnum, char *type_name);
+extern void scm_change_object_class (SCM, SCM, SCM);
+extern SCM scm_memoize_method (SCM x, SCM args);
 
 extern SCM scm_class_of (SCM obj);
 extern SCM scm_mcache_lookup_cmethod (SCM cache, SCM args);
 extern SCM scm_mcache_compute_cmethod (SCM cache, SCM args);
-extern SCM scm_call_generic_0 (SCM gf);
 /* The following are declared in __scm.h
+extern SCM scm_call_generic_0 (SCM gf);
 extern SCM scm_call_generic_1 (SCM gf, SCM a1);
 extern SCM scm_call_generic_2 (SCM gf, SCM a1, SCM a2);
+extern SCM scm_apply_generic (SCM gf, SCM args);
 */
 extern SCM scm_call_generic_3 (SCM gf, SCM a1, SCM a2, SCM a3);
-extern SCM scm_apply_generic (SCM gf, SCM args);
 extern SCM scm_entity_p (SCM obj);
 extern SCM scm_operator_p (SCM obj);
-extern SCM scm_set_object_procedure_x (SCM obj, SCM procs);
+extern SCM scm_valid_object_procedure_p (SCM proc);
+extern SCM scm_set_object_procedure_x (SCM obj, SCM proc);
 #ifdef GUILE_DEBUG
 extern SCM scm_object_procedure (SCM obj);
 #endif
@@ -236,4 +240,10 @@ extern SCM scm_i_make_class_object (SCM metaclass, SCM layout_string,
                                    unsigned long flags);
 extern void scm_init_objects (void);
 
-#endif /* OBJECTSH */
+#endif /* SCM_OBJECTS_H */
+
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/