emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/charset.h


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/charset.h
Date: Wed, 15 Jan 2003 23:31:29 -0500

Index: emacs/src/charset.h
diff -c emacs/src/charset.h:1.71 emacs/src/charset.h:1.72
*** emacs/src/charset.h:1.71    Fri Jul 19 10:26:53 2002
--- emacs/src/charset.h Wed Jan 15 23:31:29 2003
***************
*** 634,639 ****
--- 634,667 ----
     ? 1                                                        \
     : multibyte_form_length (str, len))
  
+ /* If P is before LIMIT, advance P to the next character boundary.  It
+    assumes that P is already at a character boundary of the sane
+    mulitbyte form whose end address is LIMIT.  */
+ 
+ #define NEXT_CHAR_BOUNDARY(p, limit)  \
+   do {                                        \
+     if ((p) < (limit))                        \
+       (p) += BYTES_BY_CHAR_HEAD (*(p));       \
+   } while (0)
+ 
+ 
+ /* If P is after LIMIT, advance P to the previous character boundary.
+    It assumes that P is already at a character boundary of the sane
+    mulitbyte form whose beginning address is LIMIT.  */
+ 
+ #define PREV_CHAR_BOUNDARY(p, limit)                                  \
+   do {                                                                        
\
+     if ((p) > (limit))                                                        
\
+       {                                                                       
\
+       const unsigned char *p0 = (p);                                  \
+       do {                                                            \
+         p0--;                                                         \
+       } while (p0 >= limit && ! CHAR_HEAD_P (*p0));                   \
+       (p) = (BYTES_BY_CHAR_HEAD (*p0) == (p) - p0) ? p0 : (p) - 1;    \
+       }                                                                       
\
+   } while (0)
+ 
+ 
  #ifdef emacs
  
  /* Increase the buffer byte position POS_BYTE of the current buffer to




reply via email to

[Prev in Thread] Current Thread [Next in Thread]