Mercurial > hg > xemacs-beta
changeset 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 | ed624ab64583 |
children | 33bc58a32dc2 |
files | src/ChangeLog src/lisp.h src/text.h |
diffstat | 3 files changed, 71 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Tue Mar 02 05:22:10 2010 -0600 +++ b/src/ChangeLog Tue Mar 02 06:19:51 2010 -0600 @@ -1,3 +1,14 @@ +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. + 2010-03-02 Ben Wing <ben@xemacs.org> * Makefile.in.in:
--- a/src/lisp.h Tue Mar 02 05:22:10 2010 -0600 +++ b/src/lisp.h Tue Mar 02 06:19:51 2010 -0600 @@ -3448,8 +3448,18 @@ x = wrong_type_argument (Qnatnump, x); \ } while (0) +END_C_DECLS + +/* -------------- properties of internally-formatted text ------------- */ + +#include "text.h" + /*------------------------------- char ---------------------------------*/ +BEGIN_C_DECLS + +#ifdef ERROR_CHECK_TYPES + /* NOTE: There are basic functions for converting between a character and the string representation of a character in text.h, as well as lots of other character-related stuff. There are other functions/macros for @@ -3457,31 +3467,6 @@ Ichar, the length of an Ichar when converted to text, etc. */ -#ifdef MULE - -MODULE_API int non_ascii_valid_ichar_p (Ichar ch); - -/* Return whether the given Ichar is valid. - */ - -DECLARE_INLINE_HEADER ( -int -valid_ichar_p (Ichar ch) -) -{ - return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch); -} - -#else /* not MULE */ - -/* This works when CH is negative, and correctly returns non-zero only when CH - is in the range [0, 255], inclusive. */ -#define valid_ichar_p(ch) (! (ch & ~0xFF)) - -#endif /* not MULE */ - -#ifdef ERROR_CHECK_TYPES - DECLARE_INLINE_HEADER ( int CHARP_1 (Lisp_Object obj, const Ascbyte *file, int line) @@ -3829,37 +3814,6 @@ END_C_DECLS /************************************************************************/ -/* Definitions related to the format of text and of characters */ -/************************************************************************/ - -/* Note: - - "internally formatted text" and the term "internal format" in - general are likely to refer to the format of text in buffers and - strings; "externally formatted text" and the term "external format" - refer to any text format used in the O.S. or elsewhere outside of - XEmacs. The format of text and of a character are related and - there must be a one-to-one relationship (hopefully through a - relatively simple algorithmic means of conversion) between a string - of text and an equivalent array of characters, but the conversion - between the two is NOT necessarily trivial. - - In a non-Mule XEmacs, allowed characters are numbered 0 through - 255, where no fixed meaning is assigned to them, but (when - representing text, rather than bytes in a binary file) in practice - the lower half represents ASCII and the upper half some other 8-bit - character set (chosen by setting the font, case tables, syntax - tables, etc. appropriately for the character set through ad-hoc - means such as the `iso-8859-1' file and the - `standard-display-european' function). - - #### Finish this. - - */ -#include "text.h" - - -/************************************************************************/ /* Definitions of primitive Lisp functions and variables */ /************************************************************************/
--- a/src/text.h Tue Mar 02 05:22:10 2010 -0600 +++ b/src/text.h Tue Mar 02 06:19:51 2010 -0600 @@ -47,6 +47,33 @@ BEGIN_C_DECLS +/************************************************************************/ +/* A short intro to the format of text and of characters */ +/************************************************************************/ + +/* + "internally formatted text" and the term "internal format" in + general are likely to refer to the format of text in buffers and + strings; "externally formatted text" and the term "external format" + refer to any text format used in the O.S. or elsewhere outside of + XEmacs. The format of text and of a character are related and + there must be a one-to-one relationship (hopefully through a + relatively simple algorithmic means of conversion) between a string + of text and an equivalent array of characters, but the conversion + between the two is NOT necessarily trivial. + + In a non-Mule XEmacs, allowed characters are numbered 0 through + 255, where no fixed meaning is assigned to them, but (when + representing text, rather than bytes in a binary file) in practice + the lower half represents ASCII and the upper half some other 8-bit + character set (chosen by setting the font, case tables, syntax + tables, etc. appropriately for the character set through ad-hoc + means such as the `iso-8859-1' file and the + `standard-display-european' function). + + For more info, see `text.c' and the Internals Manual. +*/ + /* ---------------------------------------------------------------------- */ /* Super-basic character properties */ /* ---------------------------------------------------------------------- */ @@ -166,6 +193,29 @@ #endif /* not MULE */ +#ifdef MULE + +MODULE_API int non_ascii_valid_ichar_p (Ichar ch); + +/* Return whether the given Ichar is valid. + */ + +DECLARE_INLINE_HEADER ( +int +valid_ichar_p (Ichar ch) +) +{ + return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch); +} + +#else /* not MULE */ + +/* This works when CH is negative, and correctly returns non-zero only when CH + is in the range [0, 255], inclusive. */ +#define valid_ichar_p(ch) (! (ch & ~0xFF)) + +#endif /* not MULE */ + /* For more discussion, see text.c, "handling non-default formats" */ typedef enum internal_format