X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer.h;h=0f7340444b3ad73c6356f4b92e4adec1732cd94e;hb=c12e4565febaec653c6a23a96ee6fd7512836801;hp=623c1cc17d4705f0d07b71b6ce82aea9ca827890;hpb=7bf73f92d718adbf3e8a18232425911b6a7873d3;p=chise%2Fxemacs-chise.git- diff --git a/src/buffer.h b/src/buffer.h index 623c1cc..0f73404 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -32,8 +32,10 @@ Boston, MA 02111-1307, USA. */ #ifndef _XEMACS_BUFFER_H_ #define _XEMACS_BUFFER_H_ -#ifdef MULE -#include "mule-charset.h" +#include "character.h" + +#ifdef UTF2000 +#include "mb-utf-8.h" #endif /************************************************************************/ @@ -413,6 +415,9 @@ for (mps_bufcons = Qunbound, \ #define REAL_INC_CHARPTR(ptr) \ ((void) ((ptr) += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr)))) +#define REAL_INC_CHARBYTIND(ptr,pos) \ + (pos += REP_BYTES_BY_FIRST_BYTE (* (unsigned char *) (ptr))) + #define REAL_DEC_CHARPTR(ptr) do { \ (ptr)--; \ } while (!VALID_CHARPTR_P (ptr)) @@ -423,6 +428,11 @@ for (mps_bufcons = Qunbound, \ REAL_INC_CHARPTR (ptr); \ } while (0) +#define INC_CHARBYTIND(ptr,pos) do { \ + ASSERT_VALID_CHARPTR (ptr); \ + REAL_INC_CHARBYTIND (ptr,pos); \ +} while (0) + #define DEC_CHARPTR(ptr) do { \ CONST Bufbyte *dc_ptr1 = (ptr); \ CONST Bufbyte *dc_ptr2 = dc_ptr1; \ @@ -433,6 +443,7 @@ for (mps_bufcons = Qunbound, \ } while (0) #else /* ! ERROR_CHECK_BUFPOS */ +#define INC_CHARBYTIND(ptr,pos) REAL_INC_CHARBYTIND (ptr,pos) #define INC_CHARPTR(ptr) REAL_INC_CHARPTR (ptr) #define DEC_CHARPTR(ptr) REAL_DEC_CHARPTR (ptr) #endif /* ! ERROR_CHECK_BUFPOS */ @@ -530,27 +541,6 @@ charptr_copy_char (CONST Bufbyte *ptr, Bufbyte *ptr2) /* (D) For working with Emchars */ /* ---------------------------- */ -#ifdef MULE - -#ifdef UTF2000 -#define valid_char_p(ch) 1 -#else -int non_ascii_valid_char_p (Emchar ch); - -INLINE int valid_char_p (Emchar ch); -INLINE int -valid_char_p (Emchar ch) -{ - return ((unsigned int) (ch) <= 0xff) || non_ascii_valid_char_p (ch); -} -#endif - -#else /* not MULE */ - -#define valid_char_p(ch) ((unsigned int) (ch) <= 0xff) - -#endif /* not MULE */ - #define CHAR_INTP(x) (INTP (x) && valid_char_p (XINT (x))) #define CHAR_OR_CHAR_INTP(x) (CHARP (x) || CHAR_INTP (x)) @@ -1366,6 +1356,8 @@ Bufbyte *convert_from_external_format (CONST Extbyte *ptr, #ifndef MULE +typedef int Charset_ID; + #define Vcharset_ascii Qnil #define CHAR_CHARSET(ch) Vcharset_ascii @@ -1618,10 +1610,10 @@ int beginning_of_line_p (struct buffer *b, Bufpos pt); /* from insdel.c */ void set_buffer_point (struct buffer *buf, Bufpos pos, Bytind bipos); -void find_charsets_in_bufbyte_string (unsigned char *charsets, +void find_charsets_in_bufbyte_string (Charset_ID *charsets, CONST Bufbyte *str, Bytecount len); -void find_charsets_in_emchar_string (unsigned char *charsets, +void find_charsets_in_emchar_string (Charset_ID *charsets, CONST Emchar *str, Charcount len); int bufbyte_string_displayed_columns (CONST Bufbyte *str, Bytecount len);