diff src/text.h @ 3063:d30cd499e445

[xemacs-hg @ 2005-11-13 10:48:01 by ben] further error-checking, etc. alloc.c, lrecord.h: Move around the handling of setting of lheader->uid so it's in set_lheader_implementation() -- that way, even non-MC-ALLOC builds get useful uid's in their bare lrecords. Redo related code for strings so the non-ascii count that is stored in the uid isn't hosed. events.c: Save and restore the uid around event zeroing/deadbeefing. lisp.h: Set the correct value of MAX_STRING_ASCII_BEGIN under MC_ALLOC. lisp.h: rearrange the basic code handling ints and chars. basic int stuff goes first, followed by basic char stuff, followed in turn by stuff that mixes ints and chars. this is required since some basic defn's have become inline functions. XCHAR and CHARP have additional error-checking in that they check to make sure that the value in question is not just a character but a valid character (i.e. its numeric value is valid). print.c: debug_p4 now has a useful UID in all cases and uses it; but it also prints the raw header address (previously, you just got one of them). text.h: some basic char defn's that belonged in lisp.h have been moved there. valid_ichar_p() is moved too since the inline functions need it.
author ben
date Sun, 13 Nov 2005 10:48:04 +0000
parents 902d5bd9b75c
children 1ce0622a56a3
line wrap: on
line diff
--- a/src/text.h	Sun Nov 13 10:39:41 2005 +0000
+++ b/src/text.h	Sun Nov 13 10:48:04 2005 +0000
@@ -1,7 +1,7 @@
 /* Header file for text manipulation primitives and macros.
    Copyright (C) 1985-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -1006,73 +1006,6 @@
 #define itext_ichar_n(ptr, offset) \
   itext_ichar (itext_n_addr (ptr, offset))
 
-
-/* ---------------------------- */
-/*      Working with Ichars     */
-/* ---------------------------- */
-
-/* NOTE: There are other functions/macros for working with Ichars in
-   charset.h, for retrieving the charset of an 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 */
-
-#define valid_ichar_p(ch) (! (ch & ~0xFF))
-
-#endif /* not MULE */
-
-DECLARE_INLINE_HEADER (
-Lisp_Object
-make_char (Ichar val)
-)
-{
-  type_checking_assert (valid_ichar_p (val));
-  return make_char_1 (val);
-}
-
-#define CHAR_INTP(x) (INTP (x) && valid_ichar_p (XINT (x)))
-
-#define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x))
-
-DECLARE_INLINE_HEADER (
-Ichar
-XCHAR_OR_CHAR_INT (Lisp_Object obj)
-)
-{
-  return CHARP (obj) ? XCHAR (obj) : XINT (obj);
-}
-
-/* Signal an error if CH is not a valid character or integer Lisp_Object.
-   If CH is an integer Lisp_Object, convert it to a character Lisp_Object,
-   but merely by repackaging, without performing tests for char validity.
-   */
-
-#define CHECK_CHAR_COERCE_INT(x) do {		\
-  if (CHARP (x))				\
-     ;						\
-  else if (CHAR_INTP (x))			\
-    x = make_char (XINT (x));			\
-  else						\
-    x = wrong_type_argument (Qcharacterp, x);	\
-} while (0)
-
-
 
 /************************************************************************/
 /*									*/