comparison src/lisp.h @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 9ee227acff29
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
647 }; 647 };
648 648
649 /* unsafe! */ 649 /* unsafe! */
650 #define POINTER_TYPE_P(type) ((type) != Lisp_Int) 650 #define POINTER_TYPE_P(type) ((type) != Lisp_Int)
651 651
652 /* This should be the underlying type intowhich a Lisp_Object must fit. 652 /* This should be the underlying type into which a Lisp_Object must fit.
653 In a strict ANSI world, this must be `int', since ANSI says you can't 653 In a strict ANSI world, this must be `int', since ANSI says you can't
654 use bitfields on any type other than `int'. However, on a machine 654 use bitfields on any type other than `int'. However, on a machine
655 where `int' and `long' are not the same size, this should be the 655 where `int' and `long' are not the same size, this should be the
656 longer of the two. (This also must be something into which a pointer 656 longer of the two. (This also must be something into which a pointer
657 to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.) 657 to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.)
818 struct Lisp_String 818 struct Lisp_String
819 { 819 {
820 #ifdef LRECORD_STRING 820 #ifdef LRECORD_STRING
821 struct lrecord_header lheader; 821 struct lrecord_header lheader;
822 #endif 822 #endif
823 long _size; 823 Bytecount _size;
824 Bufbyte *_data; 824 Bufbyte *_data;
825 Lisp_Object plist; 825 Lisp_Object plist;
826 }; 826 };
827 827
828 #ifdef LRECORD_STRING 828 #ifdef LRECORD_STRING
850 850
851 # define bytecount_to_charcount(ptr, len) (len) 851 # define bytecount_to_charcount(ptr, len) (len)
852 # define charcount_to_bytecount(ptr, len) (len) 852 # define charcount_to_bytecount(ptr, len) (len)
853 853
854 #define string_length(s) ((s)->_size) 854 #define string_length(s) ((s)->_size)
855 #define XSTRING_length(s) string_length (XSTRING (s))
855 #define string_data(s) ((s)->_data + 0) 856 #define string_data(s) ((s)->_data + 0)
857 #define XSTRING_data(s) string_data (XSTRING (s))
856 #define string_byte(s, i) ((s)->_data[i] + 0) 858 #define string_byte(s, i) ((s)->_data[i] + 0)
859 #define XSTRING_byte(s, i) string_byte (XSTRING (s), i)
857 #define string_byte_addr(s, i) (&((s)->_data[i])) 860 #define string_byte_addr(s, i) (&((s)->_data[i]))
858 #define set_string_length(s, len) do { (s)->_size = (len); } while (0) 861 #define set_string_length(s, len) do { (s)->_size = (len); } while (0)
859 #define set_string_data(s, ptr) do { (s)->_data = (ptr); } while (0) 862 #define set_string_data(s, ptr) do { (s)->_data = (ptr); } while (0)
860 #define set_string_byte(s, i, c) do { (s)->_data[i] = (c); } while (0) 863 #define set_string_byte(s, i, c) do { (s)->_data[i] = (c); } while (0)
861 864
874 #ifdef LRECORD_VECTOR 877 #ifdef LRECORD_VECTOR
875 struct lrecord_header lheader; 878 struct lrecord_header lheader;
876 #endif 879 #endif
877 long size; 880 long size;
878 /* next is now chained through v->contents[size], terminated by Qzero. 881 /* next is now chained through v->contents[size], terminated by Qzero.
879 * This means that pure vectors don't need a "next" */ 882 This means that pure vectors don't need a "next" */
880 /* struct Lisp_Vector *next; */ 883 /* struct Lisp_Vector *next; */
881 Lisp_Object contents[1]; 884 Lisp_Object contents[1];
882 }; 885 };
883 886
884 #ifdef LRECORD_VECTOR 887 #ifdef LRECORD_VECTOR