Mercurial > hg > xemacs-beta
comparison src/text.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 | 22179cd0fe15 |
children | 6c6d78781d59 |
comparison
equal
deleted
inserted
replaced
5091:ed624ab64583 | 5092:3aa3888729c3 |
---|---|
45 char *strupr (char *); | 45 char *strupr (char *); |
46 #endif | 46 #endif |
47 | 47 |
48 BEGIN_C_DECLS | 48 BEGIN_C_DECLS |
49 | 49 |
50 /************************************************************************/ | |
51 /* A short intro to the format of text and of characters */ | |
52 /************************************************************************/ | |
53 | |
54 /* | |
55 "internally formatted text" and the term "internal format" in | |
56 general are likely to refer to the format of text in buffers and | |
57 strings; "externally formatted text" and the term "external format" | |
58 refer to any text format used in the O.S. or elsewhere outside of | |
59 XEmacs. The format of text and of a character are related and | |
60 there must be a one-to-one relationship (hopefully through a | |
61 relatively simple algorithmic means of conversion) between a string | |
62 of text and an equivalent array of characters, but the conversion | |
63 between the two is NOT necessarily trivial. | |
64 | |
65 In a non-Mule XEmacs, allowed characters are numbered 0 through | |
66 255, where no fixed meaning is assigned to them, but (when | |
67 representing text, rather than bytes in a binary file) in practice | |
68 the lower half represents ASCII and the upper half some other 8-bit | |
69 character set (chosen by setting the font, case tables, syntax | |
70 tables, etc. appropriately for the character set through ad-hoc | |
71 means such as the `iso-8859-1' file and the | |
72 `standard-display-european' function). | |
73 | |
74 For more info, see `text.c' and the Internals Manual. | |
75 */ | |
76 | |
50 /* ---------------------------------------------------------------------- */ | 77 /* ---------------------------------------------------------------------- */ |
51 /* Super-basic character properties */ | 78 /* Super-basic character properties */ |
52 /* ---------------------------------------------------------------------- */ | 79 /* ---------------------------------------------------------------------- */ |
53 | 80 |
54 /* These properties define the specifics of how our current encoding fits | 81 /* These properties define the specifics of how our current encoding fits |
161 /* Maximum number of bytes per Emacs character when represented as text, in | 188 /* Maximum number of bytes per Emacs character when represented as text, in |
162 any format. | 189 any format. |
163 */ | 190 */ |
164 | 191 |
165 #define MAX_ICHAR_LEN 4 | 192 #define MAX_ICHAR_LEN 4 |
193 | |
194 #endif /* not MULE */ | |
195 | |
196 #ifdef MULE | |
197 | |
198 MODULE_API int non_ascii_valid_ichar_p (Ichar ch); | |
199 | |
200 /* Return whether the given Ichar is valid. | |
201 */ | |
202 | |
203 DECLARE_INLINE_HEADER ( | |
204 int | |
205 valid_ichar_p (Ichar ch) | |
206 ) | |
207 { | |
208 return (! (ch & ~0xFF)) || non_ascii_valid_ichar_p (ch); | |
209 } | |
210 | |
211 #else /* not MULE */ | |
212 | |
213 /* This works when CH is negative, and correctly returns non-zero only when CH | |
214 is in the range [0, 255], inclusive. */ | |
215 #define valid_ichar_p(ch) (! (ch & ~0xFF)) | |
166 | 216 |
167 #endif /* not MULE */ | 217 #endif /* not MULE */ |
168 | 218 |
169 /* For more discussion, see text.c, "handling non-default formats" */ | 219 /* For more discussion, see text.c, "handling non-default formats" */ |
170 | 220 |