comparison src/print.c @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents e121b013d1f0
children b405438285a2
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
926 if (print_depth > PRINT_CIRCLE) 926 if (print_depth > PRINT_CIRCLE)
927 error ("Apparently circular structure being printed"); 927 error ("Apparently circular structure being printed");
928 928
929 switch (XTYPE (obj)) 929 switch (XTYPE (obj))
930 { 930 {
931 case Lisp_Int: 931 case Lisp_Type_Int:
932 { 932 {
933 sprintf (buf, "%ld", (long) XINT (obj)); 933 sprintf (buf, "%ld", (long) XINT (obj));
934 write_c_string (buf, printcharfun); 934 write_c_string (buf, printcharfun);
935 break; 935 break;
936 } 936 }
937 937
938 case Lisp_Char: 938 case Lisp_Type_Char:
939 { 939 {
940 /* God intended that this be #\..., you know. */ 940 /* God intended that this be #\..., you know. */
941 Emchar ch = XCHAR (obj); 941 Emchar ch = XCHAR (obj);
942 write_c_string ("?", printcharfun); 942 write_c_string ("?", printcharfun);
943 if (ch == '\n') 943 if (ch == '\n')
972 } 972 }
973 write_c_string (buf, printcharfun); 973 write_c_string (buf, printcharfun);
974 break; 974 break;
975 } 975 }
976 976
977 case Lisp_String: 977 case Lisp_Type_String:
978 { 978 {
979 Bytecount size = XSTRING_LENGTH (obj); 979 Bytecount size = XSTRING_LENGTH (obj);
980 struct gcpro gcpro1, gcpro2; 980 struct gcpro gcpro1, gcpro2;
981 int max = size; 981 int max = size;
982 GCPRO2 (obj, printcharfun); 982 GCPRO2 (obj, printcharfun);
1039 } 1039 }
1040 UNGCPRO; 1040 UNGCPRO;
1041 break; 1041 break;
1042 } 1042 }
1043 1043
1044 case Lisp_Cons: 1044 case Lisp_Type_Cons:
1045 { 1045 {
1046 struct gcpro gcpro1, gcpro2; 1046 struct gcpro gcpro1, gcpro2;
1047 1047
1048 /* If deeper than spec'd depth, print placeholder. */ 1048 /* If deeper than spec'd depth, print placeholder. */
1049 if (INTP (Vprint_level) 1049 if (INTP (Vprint_level)
1102 write_char_internal (")", printcharfun); 1102 write_char_internal (")", printcharfun);
1103 break; 1103 break;
1104 } 1104 }
1105 1105
1106 #ifndef LRECORD_VECTOR 1106 #ifndef LRECORD_VECTOR
1107 case Lisp_Vector: 1107 case Lisp_Type_Vector:
1108 { 1108 {
1109 /* If deeper than spec'd depth, print placeholder. */ 1109 /* If deeper than spec'd depth, print placeholder. */
1110 if (INTP (Vprint_level) 1110 if (INTP (Vprint_level)
1111 && print_depth > XINT (Vprint_level)) 1111 && print_depth > XINT (Vprint_level))
1112 { 1112 {
1119 break; 1119 break;
1120 } 1120 }
1121 #endif /* !LRECORD_VECTOR */ 1121 #endif /* !LRECORD_VECTOR */
1122 1122
1123 #ifndef LRECORD_SYMBOL 1123 #ifndef LRECORD_SYMBOL
1124 case Lisp_Symbol: 1124 case Lisp_Type_Symbol:
1125 { 1125 {
1126 print_symbol (obj, printcharfun, escapeflag); 1126 print_symbol (obj, printcharfun, escapeflag);
1127 break; 1127 break;
1128 } 1128 }
1129 #endif /* !LRECORD_SYMBOL */ 1129 #endif /* !LRECORD_SYMBOL */
1130 1130
1131 case Lisp_Record: 1131 case Lisp_Type_Record:
1132 { 1132 {
1133 struct lrecord_header *lheader = XRECORD_LHEADER (obj); 1133 struct lrecord_header *lheader = XRECORD_LHEADER (obj);
1134 struct gcpro gcpro1, gcpro2; 1134 struct gcpro gcpro1, gcpro2;
1135 1135
1136 GCPRO2 (obj, printcharfun); 1136 GCPRO2 (obj, printcharfun);
1638 This is a %-spec like those accepted by `printf' in C, 1638 This is a %-spec like those accepted by `printf' in C,
1639 but with some restrictions. It must start with the two characters `%.'. 1639 but with some restrictions. It must start with the two characters `%.'.
1640 After that comes an integer precision specification, 1640 After that comes an integer precision specification,
1641 and then a letter which controls the format. 1641 and then a letter which controls the format.
1642 The letters allowed are `e', `f' and `g'. 1642 The letters allowed are `e', `f' and `g'.
1643 Use `e' for exponential notation \"DIG.DIGITSeEXPT\" 1643 Use `e' for exponential notation "DIG.DIGITSeEXPT"
1644 Use `f' for decimal point notation \"DIGITS.DIGITS\". 1644 Use `f' for decimal point notation "DIGITS.DIGITS".
1645 Use `g' to choose the shorter of those two formats for the number at hand. 1645 Use `g' to choose the shorter of those two formats for the number at hand.
1646 The precision in any of these cases is the number of digits following 1646 The precision in any of these cases is the number of digits following
1647 the decimal point. With `f', a precision of 0 means to omit the 1647 the decimal point. With `f', a precision of 0 means to omit the
1648 decimal point. 0 is not allowed with `f' or `g'. 1648 decimal point. 0 is not allowed with `f' or `g'.
1649 1649
1695 If non-nil, then uninterned symbols will be printed specially. 1695 If non-nil, then uninterned symbols will be printed specially.
1696 Uninterned symbols are those which are not present in `obarray', that is, 1696 Uninterned symbols are those which are not present in `obarray', that is,
1697 those which were made with `make-symbol' or by calling `intern' with a 1697 those which were made with `make-symbol' or by calling `intern' with a
1698 second argument. 1698 second argument.
1699 1699
1700 When print-gensym is true, such symbols will be preceded by \"#:\", which 1700 When print-gensym is true, such symbols will be preceded by "#:", which
1701 causes the reader to create a new symbol instead of interning and returning 1701 causes the reader to create a new symbol instead of interning and returning
1702 an existing one. Beware: the #: syntax creates a new symbol each time it is 1702 an existing one. Beware: the #: syntax creates a new symbol each time it is
1703 seen, so if you print an object which contains two pointers to the same 1703 seen, so if you print an object which contains two pointers to the same
1704 uninterned symbol, `read' will not duplicate that structure. 1704 uninterned symbol, `read' will not duplicate that structure.
1705 1705