Mercurial > emacs
comparison src/lisp.h @ 17404:73012b195cf3
(DOWNCASE): Return int, not Lisp_Object.
(UPPERCASEP): Use DOWNCASE.
(UPCASE_TABLE): New macro.
(NOCASEP, UPCASE1): Use UPCASE_TABLE.
[!NO_UNION_TYPE] (make_number): Declare.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 11 Apr 1997 21:58:13 +0000 |
parents | bd34aa57f3f5 |
children | 80330736ac67 |
comparison
equal
deleted
inserted
replaced
17403:5c3cd24dd8ee | 17404:73012b195cf3 |
---|---|
370 #define XPNTR(a) ((a).u.val) | 370 #define XPNTR(a) ((a).u.val) |
371 | 371 |
372 #define XSET(var, vartype, ptr) \ | 372 #define XSET(var, vartype, ptr) \ |
373 (((var).s.type = ((char) (vartype))), ((var).s.val = ((int) (ptr)))) | 373 (((var).s.type = ((char) (vartype))), ((var).s.val = ((int) (ptr)))) |
374 | 374 |
375 extern Lisp_Object make_number (); | |
376 | |
375 /* During garbage collection, XGCTYPE must be used for extracting types | 377 /* During garbage collection, XGCTYPE must be used for extracting types |
376 so that the mark bit is ignored. XMARKBIT access the markbit. | 378 so that the mark bit is ignored. XMARKBIT access the markbit. |
377 Markbits are used only in particular slots of particular structure types. | 379 Markbits are used only in particular slots of particular structure types. |
378 Other markbits are always zero. | 380 Other markbits are always zero. |
379 Outside of garbage collection, all mark bits are always zero. */ | 381 Outside of garbage collection, all mark bits are always zero. */ |
572 group of characters of the same charsets or a specific character of | 574 group of characters of the same charsets or a specific character of |
573 a charset. A sub char-table has the same structure as a char table | 575 a charset. A sub char-table has the same structure as a char table |
574 except for that the former omits several slots at the tail. A sub | 576 except for that the former omits several slots at the tail. A sub |
575 char table appears only in an element of a char table, and there's | 577 char table appears only in an element of a char table, and there's |
576 no way to access it directly from Emacs Lisp program. */ | 578 no way to access it directly from Emacs Lisp program. */ |
577 | 579 |
578 /* This is the number of slots that apply to characters or character | 580 /* This is the number of slots that apply to characters or character |
579 sets. The first 128 are for ASCII, the next 128 are for 8-bit | 581 sets. The first 128 are for ASCII, the next 128 are for 8-bit |
580 European characters, and the last 128 are for multibyte characters. | 582 European characters, and the last 128 are for multibyte characters. |
581 The first 256 are indexed by the code itself, but the last 128 are | 583 The first 256 are indexed by the code itself, but the last 128 are |
582 indexed by (charset-id + 128). */ | 584 indexed by (charset-id + 128). */ |
596 sub char tables respectively. */ | 598 sub char tables respectively. */ |
597 #define SUB_CHAR_TABLE_ORDINARY_SLOTS 128 | 599 #define SUB_CHAR_TABLE_ORDINARY_SLOTS 128 |
598 | 600 |
599 /* This is the number of slots that every sub char table must have. | 601 /* This is the number of slots that every sub char table must have. |
600 This counts the ordinary slots and the top and defalt slot. */ | 602 This counts the ordinary slots and the top and defalt slot. */ |
601 #define SUB_CHAR_TABLE_STANDARD_SLOTS (SUB_CHAR_TABLE_ORDINARY_SLOTS + 2) | 603 #define SUB_CHAR_TABLE_STANDARD_SLOTS (SUB_CHAR_TABLE_ORDINARY_SLOTS + 2) |
602 | 604 |
603 /* Return the number of "extra" slots in the char table CT. */ | 605 /* Return the number of "extra" slots in the char table CT. */ |
604 | 606 |
605 #define CHAR_TABLE_EXTRA_SLOTS(CT) \ | 607 #define CHAR_TABLE_EXTRA_SLOTS(CT) \ |
606 (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) | 608 (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) |
686 defsubr makes it into a Lisp object. | 688 defsubr makes it into a Lisp object. |
687 | 689 |
688 This type is treated in most respects as a pseudovector, | 690 This type is treated in most respects as a pseudovector, |
689 but since we never dynamically allocate or free them, | 691 but since we never dynamically allocate or free them, |
690 we don't need a next-vector field. */ | 692 we don't need a next-vector field. */ |
691 | 693 |
692 struct Lisp_Subr | 694 struct Lisp_Subr |
693 { | 695 { |
694 EMACS_INT size; | 696 EMACS_INT size; |
695 Lisp_Object (*function) (); | 697 Lisp_Object (*function) (); |
696 short min_args, max_args; | 698 short min_args, max_args; |
850 | 852 |
851 #ifdef LISP_FLOAT_TYPE | 853 #ifdef LISP_FLOAT_TYPE |
852 /* Optional Lisp floating point type */ | 854 /* Optional Lisp floating point type */ |
853 struct Lisp_Float | 855 struct Lisp_Float |
854 { | 856 { |
855 Lisp_Object type; /* essentially used for mark-bit | 857 Lisp_Object type; /* essentially used for mark-bit |
856 and chaining when on free-list */ | 858 and chaining when on free-list */ |
857 double data; | 859 double data; |
858 }; | 860 }; |
859 #endif /* LISP_FLOAT_TYPE */ | 861 #endif /* LISP_FLOAT_TYPE */ |
860 | 862 |
861 /* A character, declared with the following typedef, is a member | 863 /* A character, declared with the following typedef, is a member |
862 of some character set associated with the current buffer. */ | 864 of some character set associated with the current buffer. */ |
1097 | 1099 |
1098 #define CHECK_WINDOW(x, i) \ | 1100 #define CHECK_WINDOW(x, i) \ |
1099 do { if (!WINDOWP ((x))) x = wrong_type_argument (Qwindowp, (x)); } while (0) | 1101 do { if (!WINDOWP ((x))) x = wrong_type_argument (Qwindowp, (x)); } while (0) |
1100 | 1102 |
1101 /* This macro rejects windows on the interior of the window tree as | 1103 /* This macro rejects windows on the interior of the window tree as |
1102 "dead", which is what we want; this is an argument-checking macro, and | 1104 "dead", which is what we want; this is an argument-checking macro, and |
1103 the user should never get access to interior windows. | 1105 the user should never get access to interior windows. |
1104 | 1106 |
1105 A window of any sort, leaf or interior, is dead iff the buffer, | 1107 A window of any sort, leaf or interior, is dead iff the buffer, |
1106 vchild, and hchild members are all nil. */ | 1108 vchild, and hchild members are all nil. */ |
1107 | 1109 |
1311 | 1313 |
1312 /* Nonzero if ought to quit now. */ | 1314 /* Nonzero if ought to quit now. */ |
1313 | 1315 |
1314 #define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) | 1316 #define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) |
1315 | 1317 |
1318 /* Current buffer's map from characters to lower-case characters. */ | |
1319 | |
1320 #define DOWNCASE_TABLE XCHAR_TABLE (current_buffer->downcase_table)->contents | |
1321 | |
1322 /* Current buffer's map from characters to upper-case characters. */ | |
1323 | |
1324 #define UPCASE_TABLE XCHAR_TABLE (current_buffer->upcase_table)->contents | |
1325 | |
1326 /* Downcase a character, or make no change if that cannot be done. */ | |
1327 | |
1328 #define DOWNCASE(CH) (XFASTINT (DOWNCASE_TABLE[CH])) | |
1329 | |
1316 /* 1 if CH is upper case. */ | 1330 /* 1 if CH is upper case. */ |
1317 | 1331 |
1318 #define UPPERCASEP(CH) \ | 1332 #define UPPERCASEP(CH) (DOWNCASE(CH) != (CH)) |
1319 (XCHAR_TABLE (current_buffer->downcase_table)->contents[CH] != (CH)) | 1333 |
1334 /* 1 if CH is neither upper nor lower case. */ | |
1335 | |
1336 #define NOCASEP(CH) (XFASTINT (UPCASE_TABLE[CH]) == (CH)) | |
1320 | 1337 |
1321 /* 1 if CH is lower case. */ | 1338 /* 1 if CH is lower case. */ |
1322 | 1339 |
1323 #define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH)) | 1340 #define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH)) |
1324 | 1341 |
1325 /* 1 if CH is neither upper nor lower case. */ | |
1326 | |
1327 #define NOCASEP(CH) \ | |
1328 (XCHAR_TABLE (current_buffer->upcase_table)->contents[CH] == (CH)) | |
1329 | |
1330 /* Upcase a character, or make no change if that cannot be done. */ | 1342 /* Upcase a character, or make no change if that cannot be done. */ |
1331 | 1343 |
1332 #define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH)) | 1344 #define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH)) |
1333 | 1345 |
1334 /* Upcase a character known to be not upper case. */ | 1346 /* Upcase a character known to be not upper case. */ |
1335 | 1347 |
1336 #define UPCASE1(CH) (XCHAR_TABLE (current_buffer->upcase_table)->contents[CH]) | 1348 #define UPCASE1(CH) (XFASTINT (UPCASE_TABLE[CH])) |
1337 | |
1338 /* Downcase a character, or make no change if that cannot be done. */ | |
1339 | |
1340 #define DOWNCASE(CH) \ | |
1341 (XCHAR_TABLE (current_buffer->downcase_table)->contents[CH]) | |
1342 | |
1343 /* Current buffer's map from characters to lower-case characters. */ | |
1344 | |
1345 #define DOWNCASE_TABLE XCHAR_TABLE (current_buffer->downcase_table)->contents | |
1346 | 1349 |
1347 extern Lisp_Object Vascii_downcase_table; | 1350 extern Lisp_Object Vascii_downcase_table; |
1348 | 1351 |
1349 /* Number of bytes of structure consed since last GC. */ | 1352 /* Number of bytes of structure consed since last GC. */ |
1350 | 1353 |
1407 gcprolist = &gcpro5; } | 1410 gcprolist = &gcpro5; } |
1408 | 1411 |
1409 /* Call staticpro (&var) to protect static variable `var'. */ | 1412 /* Call staticpro (&var) to protect static variable `var'. */ |
1410 | 1413 |
1411 void staticpro(); | 1414 void staticpro(); |
1412 | 1415 |
1413 #define UNGCPRO (gcprolist = gcpro1.next) | 1416 #define UNGCPRO (gcprolist = gcpro1.next) |
1414 | 1417 |
1415 /* Evaluate expr, UNGCPRO, and then return the value of expr. */ | 1418 /* Evaluate expr, UNGCPRO, and then return the value of expr. */ |
1416 #define RETURN_UNGCPRO(expr) \ | 1419 #define RETURN_UNGCPRO(expr) \ |
1417 if (1) \ | 1420 if (1) \ |
1896 extern char *getenv (), *ctime (), *getwd (); | 1899 extern char *getenv (), *ctime (), *getwd (); |
1897 extern long *xmalloc (), *xrealloc (); | 1900 extern long *xmalloc (), *xrealloc (); |
1898 extern void xfree (); | 1901 extern void xfree (); |
1899 | 1902 |
1900 extern char *egetenv (); | 1903 extern char *egetenv (); |
1901 | 1904 |
1902 /* Set up the name of the machine we're running on. */ | 1905 /* Set up the name of the machine we're running on. */ |
1903 extern void init_system_name (); | 1906 extern void init_system_name (); |
1904 | 1907 |
1905 /* Some systems (e.g., NT) use a different path separator than Unix, | 1908 /* Some systems (e.g., NT) use a different path separator than Unix, |
1906 in addition to a device separator. Default the path separator | 1909 in addition to a device separator. Default the path separator |