*** empty log message ***
[bpt/guile.git] / libguile / weaks.h
index a31166e..26f9a02 100644 (file)
@@ -16,7 +16,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
  *
  * As a special exception, the Free Software Foundation gives permission
  * for additional uses of the text contained in its release of GUILE.
  *
  * If you write modifications of your own for GUILE, it is your choice
  * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  
- */
+ * If you do not wish that, delete this exception notice.  */
+
+/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
+   gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
 \f
 
-#include <libguile/__scm.h>
+#include "libguile/__scm.h"
 
 \f
 
 
-#define SCM_WVECTP(x) (SCM_TYP7(x)==scm_tc7_wvect)
-#define SCM_IS_WHVEC(X) (SCM_VELTS(X)[-1] == 1)
-#define SCM_IS_WHVEC_V(X) (SCM_VELTS(X)[-1] == 2)
-#define SCM_IS_WHVEC_B(X) (SCM_VELTS(X)[-1] == 3)
+#define SCM_WVECTP(x) (SCM_NIMP(x) && (SCM_TYP7(x)==scm_tc7_wvect))
+#define SCM_IS_WHVEC(X) (SCM_UNPACK (SCM_VELTS(X)[-1]) == 1)
+#define SCM_IS_WHVEC_V(X) (SCM_UNPACK (SCM_VELTS(X)[-1]) == 2)
+#define SCM_IS_WHVEC_B(X) (SCM_UNPACK (SCM_VELTS(X)[-1]) == 3)
 #define SCM_IS_WHVEC_ANY(X) (SCM_VELTS(X)[-1])
+#define SCM_WVECT_GC_CHAIN(X) (SCM_VELTS(X)[-2])
 
 \f
-#ifdef __STDC__
+
 extern SCM scm_make_weak_vector (SCM k, SCM fill);
 extern SCM scm_weak_vector (SCM l);
 extern SCM scm_weak_vector_p (SCM x);
@@ -68,19 +72,4 @@ extern SCM scm_weak_value_hash_table_p (SCM x);
 extern SCM scm_doubly_weak_hash_table_p (SCM x);
 extern void scm_init_weaks (void);
 
-#else /* STDC */
-extern SCM scm_make_weak_vector ();
-extern SCM scm_weak_vector ();
-extern SCM scm_weak_vector_p ();
-extern SCM scm_make_weak_key_hash_table ();
-extern SCM scm_make_weak_value_hash_table ();
-extern SCM scm_make_doubly_weak_hash_table ();
-extern SCM scm_weak_key_hash_table_p ();
-extern SCM scm_weak_value_hash_table_p ();
-extern SCM scm_doubly_weak_hash_table_p ();
-extern void scm_init_weaks ();
-
-#endif /* STDC */
-
-
 #endif  /* WEAKSH */