Bump version number for 1.9.3.
[bpt/guile.git] / libguile / tags.h
index a2bdb73..9a52093 100644 (file)
@@ -3,22 +3,23 @@
 #ifndef SCM_TAGS_H
 #define SCM_TAGS_H
 
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2008,2009
  * 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 as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3 of
+ * the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
  */
 
 \f
@@ -113,8 +114,14 @@ typedef unsigned long scm_t_bits;
   and that there is no performance hit.  However, the alternative is
   compiled, and does generate a warning when used with the wrong
   pointer type.
- */
+
+  The Tru64 and ia64-hp-hpux11.23 compilers fail on `case (0?0=0:x)'
+  statements, so for them type-checking is disabled.  */
+#if defined __DECC || defined __HP_cc
+#   define SCM_UNPACK(x) ((scm_t_bits) (x))
+#else
 #   define SCM_UNPACK(x) ((scm_t_bits) (0? (*(SCM*)0=(x)): x))
+#endif
 
 /*
   There is no typechecking on SCM_PACK, since all kinds of types
@@ -136,7 +143,7 @@ typedef unsigned long scm_t_bits;
 /* SCM values can not be compared by using the operator ==.  Use the following
  * macro instead, which is the equivalent of the scheme predicate 'eq?'.
  */
-#define SCM_EQ_P(x, y) (SCM_UNPACK (x) == SCM_UNPACK (y))
+#define scm_is_eq(x, y) (SCM_UNPACK (x) == SCM_UNPACK (y))
 
 \f
 
@@ -325,8 +332,8 @@ typedef unsigned long scm_t_bits;
  * tc8 (for objects with tc3==100):
  *   00000-100:  special objects ('flags')
  *   00001-100:  characters
- *   00010-100:  evaluator byte codes ('ilocs')
- *   00011-100:  evaluator byte codes ('isyms')
+ *   00010-100:  evaluator byte codes ('isyms')
+ *   00011-100:  evaluator byte codes ('ilocs')
  *
  *
  * Summary of type codes on the heap
@@ -367,10 +374,6 @@ typedef unsigned long scm_t_bits;
  * tc16 (for tc7==scm_tc7_smob):
  *   The largest part of the space of smob types is not subdivided in a
  *   predefined way, since smobs can be added arbitrarily by user C code.
- *   However, while Guile also defines a number of smob types throughout,
- *   there is one smob type, namely scm_tc_free_cell, for which Guile assumes
- *   that it is declared first and thus gets a known-in-advance tc16-code.
- *   The reason of requiring a fixed tc16-code for this type is performance.
  */
 
 \f
@@ -383,14 +386,15 @@ typedef unsigned long scm_t_bits;
 
 /* Checking if a SCM variable holds an immediate integer: See numbers.h for
  * the definition of the following macros: SCM_I_FIXNUM_BIT,
- * SCM_MOST_POSITIVE_FIXNUM, SCM_INUMP, SCM_MAKINUM, SCM_INUM.  */
+ * SCM_MOST_POSITIVE_FIXNUM, SCM_I_INUMP, SCM_I_MAKINUM, SCM_I_INUM.  */
 
 /* Checking if a SCM variable holds a pair (for historical reasons, in Guile
  * also known as a cons-cell): This is done by first checking that the SCM
  * variable holds a non-immediate, and second, by checking that tc1==0 holds
- * for the SCM_CELL_TYPE of the SCM variable.  */
-#define SCM_CONSP(x)  (!SCM_IMP (x) && ((1 & SCM_CELL_TYPE (x)) == 0))
-#define SCM_NCONSP(x) (!SCM_CONSP (x))
+ * for the SCM_CELL_TYPE of the SCM variable.  
+*/
+
+#define SCM_I_CONSP(x)  (!SCM_IMP (x) && ((1 & SCM_CELL_TYPE (x)) == 0))
 
 \f
 
@@ -429,6 +433,8 @@ typedef unsigned long scm_t_bits;
 
 #define scm_tc7_string         21
 #define scm_tc7_number         23
+#define scm_tc7_stringbuf       39
+#define scm_tc7_bytevector     77
 
 /* Many of the following should be turned
  * into structs or smobs.  We need back some
@@ -436,22 +442,18 @@ typedef unsigned long scm_t_bits;
 
 #define scm_tc7_pws            31
 
-#if SCM_HAVE_ARRAYS
-#define scm_tc7_llvect          29
-#define scm_tc7_uvect          37
-/* free                         39 */
-#define scm_tc7_fvect          45
-#define scm_tc7_dvect          47
-#define scm_tc7_cvect          53
-#define scm_tc7_svect          55
-#define scm_tc7_bvect          71
-#define scm_tc7_byvect         77
-#define scm_tc7_ivect          79
-#endif
+#define scm_tc7_unused_1        29
+#define scm_tc7_unused_2       37
+#define scm_tc7_unused_3       45
+#define scm_tc7_unused_4       47
+#define scm_tc7_unused_5       53
+#define scm_tc7_unused_6       55
+#define scm_tc7_unused_7       71
 
 #define scm_tc7_dsubr          61
-#define scm_tc7_cclo           63
+#define scm_tc7_gsubr          63
 #define scm_tc7_rpsubr         69
+#define scm_tc7_program                79
 #define scm_tc7_subr_0         85
 #define scm_tc7_subr_1         87
 #define scm_tc7_cxr            93
@@ -478,12 +480,6 @@ typedef unsigned long scm_t_bits;
 #define SCM_TYP16_PREDICATE(tag, x) (!SCM_IMP (x) && SCM_TYP16 (x) == (tag))
 
 
-/* Here is the first smob subtype.  */
-
-/* scm_tc_free_cell is the 0th smob type.  We place this in free cells to tell
- * the conservative marker not to trace it.  */
-#define scm_tc_free_cell       (scm_tc7_smob + 0 * 256L)
-
 \f
 
 /* {Immediate Values}
@@ -531,7 +527,7 @@ enum scm_tc8_tags
 #define SCM_ELISP_NIL          SCM_MAKIFLAG (7)
 
 
-#define SCM_UNBNDP(x)          (SCM_EQ_P ((x), SCM_UNDEFINED))
+#define SCM_UNBNDP(x)          (scm_is_eq ((x), SCM_UNDEFINED))
 
 \f
 
@@ -542,10 +538,6 @@ enum scm_tc8_tags
 
 #define SCM_ISYMP(n)           (SCM_ITAG8 (n) == scm_tc8_isym)
 #define SCM_MAKISYM(n)                 SCM_MAKE_ITAG8 ((n), scm_tc8_isym)
-#define SCM_ISYMNUM(n)                 (SCM_ITAG8_DATA (n))
-
-SCM_API char *scm_isymnames[];   /* defined in print.c */
-#define SCM_ISYMCHARS(n)       (scm_isymnames[SCM_ISYMNUM (n)])
 
 #define SCM_IM_AND              SCM_MAKISYM (0)
 #define SCM_IM_BEGIN            SCM_MAKISYM (1)
@@ -676,7 +668,8 @@ SCM_API char *scm_isymnames[];   /* defined in print.c */
   case scm_tc7_subr_1o:\
   case scm_tc7_subr_2o:\
   case scm_tc7_lsubr_2:\
-  case scm_tc7_lsubr
+  case scm_tc7_lsubr: \
+  case scm_tc7_gsubr
 
 \f