comparison src/lisp.h @ 5092:3aa3888729c3

move inclusion point of text.h to clean things up a bit -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-03-02 Ben Wing <ben@xemacs.org> * lisp.h: * text.h: Move inclusion point of text.h earlier in lisp.h -- just before the definition of characters, which needs some of the stuff in text.h. With text.h later, some basic character properties had to be defined in lisp.h -- put them back into text.h where they belong. Move some text in lisp.h at the point of text.h inclusion into text.h -- it serves as a mini-introduction.
author Ben Wing <ben@xemacs.org>
date Tue, 02 Mar 2010 06:19:51 -0600
parents d372b17f63ce
children 33bc58a32dc2
comparison
equal deleted inserted replaced
5091:ed624ab64583 5092:3aa3888729c3
3446 #define CONCHECK_NATNUM(x) do { \ 3446 #define CONCHECK_NATNUM(x) do { \
3447 if (!NATNUMP (x)) \ 3447 if (!NATNUMP (x)) \
3448 x = wrong_type_argument (Qnatnump, x); \ 3448 x = wrong_type_argument (Qnatnump, x); \
3449 } while (0) 3449 } while (0)
3450 3450
3451 END_C_DECLS
3452
3453 /* -------------- properties of internally-formatted text ------------- */
3454
3455 #include "text.h"
3456
3451 /*------------------------------- char ---------------------------------*/ 3457 /*------------------------------- char ---------------------------------*/
3458
3459 BEGIN_C_DECLS
3460
3461 #ifdef ERROR_CHECK_TYPES
3452 3462
3453 /* NOTE: There are basic functions for converting between a character and 3463 /* NOTE: There are basic functions for converting between a character and
3454 the string representation of a character in text.h, as well as lots of 3464 the string representation of a character in text.h, as well as lots of
3455 other character-related stuff. There are other functions/macros for 3465 other character-related stuff. There are other functions/macros for
3456 working with Ichars in charset.h, for retrieving the charset of an 3466 working with Ichars in charset.h, for retrieving the charset of an
3457 Ichar, the length of an Ichar when converted to text, etc. 3467 Ichar, the length of an Ichar when converted to text, etc.
3458 */ 3468 */
3459
3460 #ifdef MULE
3461
3462 MODULE_API int non_ascii_valid_ichar_p (Ichar ch);
3463
3464 /* Return whether the given Ichar is valid.
3465 */
3466
3467 DECLARE_INLINE_HEADER (
3468 int
3469 valid_ichar_p (Ichar ch)
3470 )
3471 {
3472 return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch);
3473 }
3474
3475 #else /* not MULE */
3476
3477 /* This works when CH is negative, and correctly returns non-zero only when CH
3478 is in the range [0, 255], inclusive. */
3479 #define valid_ichar_p(ch) (! (ch & ~0xFF))
3480
3481 #endif /* not MULE */
3482
3483 #ifdef ERROR_CHECK_TYPES
3484 3469
3485 DECLARE_INLINE_HEADER ( 3470 DECLARE_INLINE_HEADER (
3486 int 3471 int
3487 CHARP_1 (Lisp_Object obj, const Ascbyte *file, int line) 3472 CHARP_1 (Lisp_Object obj, const Ascbyte *file, int line)
3488 ) 3473 )
3825 /* The following two are only called by the garbage collector */ 3810 /* The following two are only called by the garbage collector */
3826 int finish_marking_weak_lists (void); 3811 int finish_marking_weak_lists (void);
3827 void prune_weak_lists (void); 3812 void prune_weak_lists (void);
3828 3813
3829 END_C_DECLS 3814 END_C_DECLS
3830
3831 /************************************************************************/
3832 /* Definitions related to the format of text and of characters */
3833 /************************************************************************/
3834
3835 /* Note:
3836
3837 "internally formatted text" and the term "internal format" in
3838 general are likely to refer to the format of text in buffers and
3839 strings; "externally formatted text" and the term "external format"
3840 refer to any text format used in the O.S. or elsewhere outside of
3841 XEmacs. The format of text and of a character are related and
3842 there must be a one-to-one relationship (hopefully through a
3843 relatively simple algorithmic means of conversion) between a string
3844 of text and an equivalent array of characters, but the conversion
3845 between the two is NOT necessarily trivial.
3846
3847 In a non-Mule XEmacs, allowed characters are numbered 0 through
3848 255, where no fixed meaning is assigned to them, but (when
3849 representing text, rather than bytes in a binary file) in practice
3850 the lower half represents ASCII and the upper half some other 8-bit
3851 character set (chosen by setting the font, case tables, syntax
3852 tables, etc. appropriately for the character set through ad-hoc
3853 means such as the `iso-8859-1' file and the
3854 `standard-display-european' function).
3855
3856 #### Finish this.
3857
3858 */
3859 #include "text.h"
3860
3861 3815
3862 /************************************************************************/ 3816 /************************************************************************/
3863 /* Definitions of primitive Lisp functions and variables */ 3817 /* Definitions of primitive Lisp functions and variables */
3864 /************************************************************************/ 3818 /************************************************************************/
3865 3819